Input Data Extension
Input extensions can be used to extend context on a method. An input extension is always configured on a method and executed before the main method. The input extension returns output which can be used as input on the main method. Input extensions are mainly used when you want to read extra context from another system.
E.g. when we know the user account, but the external application uses a verification code that exists in the Active Directory, we can create a method to get the user from the Active Directory and fetch the verification code to enrich the data the Business Connector sends to the external application.
Use the following steps to configure an Input Data Extension on a method:
- Go to the method you want to create the extension on.
- Click the Advanced tab.
Click the Input Data Extensions tab.
Click on the green + icon.
Specify an object and a method where you want to get the extra information from.
- Check the checkbox after Stop on error if you want to stop if an error occurs.
- Click the Field Relations icon to add a field relation. A field relation is used to map the unique value of a record in the extension method to a field from the current method. If no field relation is configured, the first record from the extension method is used to enrich the global context.
When a match is found in the relations, the values of both rows are joined together.
Behavior with Context Records
Context records within the Ometa Framework allows a method to be executed multiple times in one 'transaction'. This can save processing time because there is no need to connect additional framework clients, or start additional interface processes. However, keep in mind that context records, including possible extensions, are currently executed sequentially on the target interface.
Currently context records are only used in:
- Synchronizations
- Sequential item functions
- Custom DLL's
The behavior when using context records with input extensions is as follows:
- The context records are passed to the input extension method. If the main method is executed with 5 context records, so is the input extension(s).
- The records retrieved from the input extension for one context record, is only used for that same context record in the main method.
Examples
See the table below for a few examples on how the data is mapped when using context records.
In this example the main method is called with 2 context records. The original input are only the NameID
and Amount
for each context record. Using an input extension, the FirstName
and LastName
are fetched before executing the main method.
Because there is no field relation defined for NameID
on the extension, the first record retrieved from each input extension respectively is used and appended to the context record input. Fields that aren't returned by the input extension (Amount
in this example) are kept without change. All data from the matching record in the input extension, will override the input on the main method for that context record.