X4 Variable Collector
This adapter collects results from process loops and saves them in a variable.
Properties
| Operation | Defines the operation executed by the adapter Possible values:
|
Parameters
| Main adapter class (do not change!) Possible values: de.softproject.integration.adapter.merge.Collector: Main class (default) |
name | Name of the process variable |
mode | Merge mode; Determines how the input is merged into the process variable. Possible values:
|
Status values
1 | The operation was executed successfully |
-1 | A technical problem occurred during the operation's execution |
0 | No process variable was found (for Get and GetAndRemove) |
Operation Collect
Mode: BINARY
The following applies to the mode BINARY:
The adapter input is interpreted as byte array and appended to the process variable's content that is interpreted as byte array.
NULLis considered as byte array of length0.- The result's content type is
application/octet-stream. - The result is written into the process variable and returned as adapter result.
Mode: TEXT
The following applies to the mode TEXT:
The adapter input is interpreted as string (the encoding is considered therefore) and appended to the process variable's content that is interpreted as string (the encoding is used therefore).
NULLis considered as string of length0.- The result's content type is
text/plainwith the encodingUTF-8. - The result is written into the process variable and returned as adapter result.
Mode: XML
The following applies to the mode XML:
The adapter input is interpreted as XML and appended to the process variable's content that is interpreted as XML.
The result's content type is
text/xmlwith the encodingUTF-8.- The result is written into the process variable and returned as adapter result.
- If the adapter input or the process variable's content can not be interpreted as XML (
NULLis allowed), the adapter is terminated with the status-1andNULLas output. The process variable's content was not changed in this case.
It will be attached as follows:
- A new document with the root element
Mergeis created. - If the process variable's content is not
NULL, its content is merged as follows.
If the process variable's root element isMerge, all child elements are taken over as child elements of the outputMergeelement. Otherwise, the root element is taken over as child of the outputMergeelement. - Subsequently, the same treatment is applied to the adapter input.
After a successfulCollectin XML mode, the process variable contains in any case an XML document with a root elementMerge. From the view of theCollectoperation inXMLmode,NULL(nothing) and the<Merge>XML document are equivalent.
Operation Get
The operation Get returns the process variable's content. If the variable is filled, the status 1 is returned; If it is empty, the status 0. Thus, the operation Get behaves like the operation Test of the Variable component.
If the variable is empty, the neutral element is set into the variable and used as adapter output.
Mode | Corresponding neutral element |
|---|---|
BINARY | Byte array of the length 0 |
TEXT | String of the length 0 |
XML | An XML document consisting exclusively of the root node Merge |
Operation GetAndRemove
The operation GetAndRemove returns the process variable's content. If the variable is filled, the status 1 is returned; If it is empty, the status 0. Thus, the operation GetAndRemoves combines the operations Remove and Test of the Variable component.
If the variable is empty, the neutral element is set into the variable and used as adapter output.
Mode | Corresponding neutral element |
|---|---|
BINARY | Byte array of the length 0 |
TEXT | String of the length 0 |
XML | An XML document consisting exclusively of the root node Merge
|
The variable is empty after this operation.