...
Блок кода |
---|
public class MPSResponseScript extends EventScriptBase<MPSBeforeResponseEvent> { @Override public void onEvent( MPSBeforeResponseEvent mpsBeforeResponseEvent, Setup setup, ConnectionSet connectionSet ) throws Exception { Contract contract = mpsBeforeResponseEvent.getResponse().getContract(); if ( contract != null ) { MPSResponse response = mpsBeforeResponseEvent.getResponse(); try( ContractParameterManager contractParameterManager = new ContractParameterManager( connectionSet.getConnection() ); ) { ContractAddressParamValue contractAddressParamValue = contractParameterManager.getAddressParam( contract.getId(), PARAM_ADDRESS_ID ); if ( contractAddressParamValue != null ) { address = contractAddressParamValue.getAddress(); } } Map<String, String> responseParameters = new HashMap<>(); if ( address != null ) { responseParameters.put( "add", "address: " + address ); } if ( !responseParameters.isEmpty() ) { response.getParameters().put( MPSTransactionManager.KEY_RESPONSE_PARAMETERS, responseParameters ); } } } } |