X4 Produktdokumentation

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: Execute: Execute process(es)

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 x4db: URL to the X4 process in the X4 Repository (e.g. x4db:/1/Project/Folder/Process.wrf)

MaxThread

Number of threads to be used

Possible values:

  • Any positive integer (e.g. 3)

  • 0 or negative integer: do not restrict parallel execution (e.g. -1)

InputIsBase64

Specifies the data format for the adapter input

Possible values:

    • True: The content of each element is a Base64 encoded string which is decoded and passed as input to the child process.

    • False: The XML element content is passed directly to the child process.

expandOutput

Controls the output format of the adapter

Possible values:

    • True: The result is output completely as an XML document.

    • False: The result is output as a Base64 encoded string.

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.

XML
<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:

XML
<SomeInputElement/>


XML
<SomeInputElement>with some content</SomeInputElement>


XML
<SomeInputElement someAttribute="someValue">more content</SomeInputElement>

Output

The result of the process execution could be structured as follows in the above example:

XML
 <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:

XML
<Error attributesFromInput="">
  	<TopException class="java.lang.NullPointerException">exception message</TopException>
  	<CausedByException class="some.other.Exception">exception message</CausedByException>
</Error>