Skip to main content
Skip table of contents

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:

  • Collect: Encode data Base64, see section Operation Collect

  • Get: Read the process variable's content, see section Operation Get

  • GetAndRemove: Read the process variable's content and remove the process variable subsequently, see section Operation GetAndRemove

Parameters

Adapter

Main adapter class (do not change!)

Possible values: de.softproject.integration.adapter.merge.Collector: Main class (default)

nameName of the process variable
mode

Merge mode; Determines how the input is merged into the process variable.

Possible values:

  • BINARY: The input is merged as Byte stream
  • TEXT: The input is merged as string 
  • XML: The input is merged as XML document

Status values

1

The operation was executed successfully

-1A technical problem occurred during the operation's execution
0No 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.

  • NULL is considered as byte array of length 0.

  • 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).

  • NULL is considered as string of length 0.

  • The result's content type is text/plain with the encoding UTF-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/xml with the encoding UTF-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 (NULL is allowed), the adapter is terminated with the status -1 and NULL as 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 Merge is created.
  • If the process variable's content is not NULL, its content is merged as follows.
    If the process variable's root element is Merge, all child elements are taken over as child elements of the output Merge element. Otherwise, the root element is taken over as child of the output Merge element.
  • Subsequently, the same treatment is applied to the adapter input.
    After a successful Collect in XML mode, the process variable contains in any case an XML document with a root element Merge. From the view of the Collect operation in XML mode, 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.

(info) If the variable is empty, the neutral element is set into the variable and used as adapter output.

Mode
Corresponding neutral element
BINARYByte array of the length 0
TEXTString of the length 0
XMLAn 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.

(info) If the variable is empty, the neutral element is set into the variable and used as adapter output.

Mode
Corresponding neutral element
BINARYByte array of the length 0
TEXTString of the length 0
XMLAn XML document consisting exclusively of the root node Merge

The variable is empty after this operation.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.