OutboundManyToOne - is an example script that can be used in Find step of an Outbound automation objects to locate outbound messages related to the parent inbound in many to one scenarios. This approach should be leverage only in situations when related messages can’t be obtain via standard middleware platform mechanisms like for example Correlation ID for SAP CI or Related Messages in SAP PO.
An example could be EDI message with multiple orders split into several idocs each containing one order reference and no reference to the EDI file identifier. In such case regular Find on XPath or REGEX can’t be leveraged.
Below script is fetching list of all the values for a given variable from the parent message, finding corresponding single value in the output message and checking if the value is on the list from parent.
#Int4 KB sample — AS IS, not official docs, no support. Test before use.
#Get variable values from context
var_tab=GET_TC_VAR("VARIABLE_NAME") ["VAR"];
#fetch output payload for verification
payload=GET_CONTEXT_PAYLOAD();
#find variable value for the current output_var
output_var=CXPATH("//VARIABLE_XPATH", payload);
#Check if output_var from output is in variables values fetched from parent
IF(output_var IN var_tab, _TRUE_ , _FALSE_ );
#=============================================================================
# SUPPLEMENTARY SAMPLE — NOT OFFICIAL DOCUMENTATION
#=============================================================================
# Provided AS IS to active customers via the Int4 Knowledge Base.
# No warranty, no SLA, no support coverage. Test in a non-production
# environment before use. You are responsible for any consequences of
# running or modifying this code.
#=============================================================================