Parallel Process Starter
The adapter executes an X4 process in any user folder in <X4>/X4DB
any number of times in parallel and allows to synchronize the results again afterwards. The adapter expects an input XML document with data to be processed, each stored within arbitrarily named child elements below the root element. Depending on the configuration, the adapter outputs an XML document or a Base64-encoded string.
The Parallel Process Starter allows you to set the process name (and path) at runtime via dynamic parameters. In addition, each X4 process started via the Parallel Process Starter has its own process instance ID, is executed in a separate thread and therefore cannot access variables of the calling process.
General properties and parameters
Properties
Operation | Determines which operation the adapter executes Possible values: |
Parameter
Adapter | Main class of the adapter (do not change!) Possible values: de.softproject.integration.adapter.parallelprocessstarter.Adapter: Main class (default) |
X4ProcessURL | Path to the X4 process to be executed Possible values: Any valid |
MaxThread | Number of threads to be used Possible values:
|
InputIsBase64 | Specifies the data format for the adapter input Possible values:
|
expandOutput | Controls the output format of the adapter Possible values:
|
Status values
1 | The operation was executed successfully. |
0 | The operation was executed successfully, but without any result. |
-1 | The operation failed due to a technical error. |
Input
In the input XML document, an arbitrarily named root element can contain any number of child elements. For each child element, an X4 process is called and the element node is passed as input.
Sample input
<SomeRootElement>
<SomeInputElement/>
<SomeInputElement>with some content</SomeInputElement>
<SomeInputElement someAttribute="someValue">more content</SomeInputElement>
</SomeRootElement>
With the parameter InputlsBase64:False
the above example is executed as follows:
Process call 1
<SomeInputElement/>
Process call 2
<SomeInputElement>with some content</SomeInputElement>
Process call 3
<SomeInputElement someAttribute="someValue">more content</SomeInputElement>
Output
The result of the process execution could be structured as follows in the above example:
Output
<Results>
<Result childProcessStatus="1" childProcessPid="4711" encoding="UTF-8" content-type="text/plain">...some base64 string...</Result>
<Result childProcessStatus="1" childProcessPid="4712" encoding="UTF-8" content-type="text/plain">...some base64 string...</Result>
<Result someAttribute="someValue" childProcessStatus="1" childProcessPid="4713" encoding="UTF-8" content-type="text/plain">...some base64 string...</Result>
</Results>
In case of an error, no Result
element is generated, but e.g. the following result is output:
Output in case of error
<Error attributesFromInput="">
<TopException class="java.lang.NullPointerException">exception message</TopException>
<CausedByException class="some.other.Exception">exception message</CausedByException>
</Error>