Data harness functions
The WTX Map service supports data harness functions that operate on Sterling B2B Integrator correlations, process data, code lists, delimiters, and the transaction register. You can use data harness functions in map rules and type trees.
- Command
- Description
- getBinaryDocument
- Retrieves the specified binary document.
- getEnvelope
- Retrieves the specified field from an envelope.
- setCorrelation
- Updates the Sterling B2B Integrator correlation table with the specified name/value pair for the document or business process.
- getProcessData
- Retrieves process data from the XML document object model (DOM) specified by the XPath. A business process can store and retrieve process data in order to access the data during process execution. See the Sterling B2B Integrator documentation for details about process data.
- setProcessData
- Stores process data from the current field into the XML DOM that is specified by the XPath. A business process can store and retrieve process data in order to access the data during process execution. See the Sterling B2B Integrator documentation for details about process data.
- getCodeListItemBySenderCode
- Retrieves a trading-partner code-list entry from Sterling B2B Integrator by sender code. A trading partner code list consists of one or many pairs of code values containing a sender code and a receiver code. Sterling B2B Integrator uses code pairs in code lists to identify items in transactions between two or more trading partners. See the See the Sterling B2B Integrator Trading Partner documentation for details about code lists.
- getCodeListItemByReceiverCode
- Retrieves a trading-partner code list from Sterling B2B Integrator by receiver code. A trading partner code list consists of one or many pairs of code values containing a sender code and a receiver code. Sterling B2B Integrator uses code pairs in code lists to identify items in transactions between two or more trading partners. See the Sterling B2B Integrator Trading Partner documentation for details about code lists.
- getTransactionRegister
- Compares the fields that you loaded into the Transaction Register
with the input data, returns a code, and clears the Transaction Register.
- 0
- Success; no duplicate data found.
- 1
- Failure; duplicate data found.
- 8
- No updates performed to this transaction register yet. Cannot perform a select before an update. The Transaction Register is empty. You must invoke setTransactionRegister to load the Transaction Register before you can invoke getTransactionRegister.
The following example:PUT("Sterling", "-t+ -c setTransactionRegister -k 1", "Reg 1") GET("Sterling", "-t+ -c getTransactionRegister") GET("Sterling", "-t+ -c getTransactionRegister")
- Loads Transaction Register field 1 with the literal value Reg 1.
- Compares the input document data to the content of the Transaction Register and returns 0 or 1.
- Attempts to invoke getTransactionRegister again without loading the Transaction Register, resulting in return code 8.
The following example loads Transaction Register field 3 with the contents of the specified input data field:PUT("Sterling", "-t+ -c setTransactionRegister -k 3",PONumber Field:In1)
- setTransactionRegister
- Loads the specified Transaction Register field with the specified
data. You can load up to six fields of data into memory for the Transaction
Register. See the See the Sterling B2B Integrator documentation for
details about the size limits of the fields.
After you run the setTransactionRegister command, you can run the getTransactionRegister command to check for duplicate input data.
- getDelimiter
- Gets a delimiter from an X12 or EDIFACT envelope.
This example PUT rule
uses the Sterling adapter to create an element under process data
that is called "getmap." The -NOW option creates
the key even if the map fails:
=PUT("Sterling", "-t+ -c setProcessData -k getmap -now", "data")
This
example GET rule uses the Sterling adapter to read the value of a
key called "getmap" from the process data:
=GET rule " + VALID( GET("Sterling", "-t+ -c getProcessData -k getmap")
This
example of a Sterling adapter command line on a card creates a correlation
that is called "adapter" when the card completes. The correlation
includes all of the data that was built on the card:
-c setCorrelation -k adapter -t+
The
Sterling adapter supports the harness functions with the following
command line arguments:
Command Long Form | Command Short Form | Description |
---|---|---|
-Command | -C | Command |
-Key | -K | Key |
-Now | -N | Executes the harness function as soon as the PUT rule is processed, even if the map fails |
-T | -T | Adapter trace (overwrite) |
-T+ | -T+ | Adapter trace (append) |
-TE | -TE | Adapter trace error (overwrite) |
-TE+ | -TE+ | Adapter trace error (append) |
-TV | -TV | Adapter trace verbatim (overwrite) |
-TV+ | -TV+ | Adapter trace verbatim (append) |
-Code | -D | Sender/Receiver code |
-Table | -B | Code table name |
This table describes the data harness functions and
key values that you can use on the Sterling adapter:
Command | Key |
---|---|
getBinaryDocument | The name of the document to retrieve. |
setCorrelation | The name of the correlation to update. |
getProcessData | The XPATH to select. |
setProcessData | The XPATH to update. |
getCodeListItemBySenderCode | The sender value for the code-list entry to retrieve. The command requires a sender code, codeListTable name, and column. |
getCodeListItemByReceiverCode | The receiver value for the code-list entry to retrieve. The command requires a receiver code, codeListTable name, and column. |
getEnvelope | The envelope field name. |
getTransactionRegister | There are no keys for this command. |
setTransactionRegister | Each entry is a number between 1 and 6 that indicates the field to update. See the Sterling B2B Integrator documentation for details about the field-size limits. |
getDelimiter | An array of numbers that indicates the fields to select. The list is defined in Table 4. |
This table lists the sender and receiver keys and
values to use with the getCodeListItemBySenderCode and getCodeListItemByRecieverCode
functions.
Key | Value |
---|---|
COL_SENDER | 0 |
COL_RECEIVER | 1 |
COL_DESC | 2 |
COL_TEXT1 | 4 |
COL_TEXT2 | 5 |
COL_TEXT3 | 6 |
COL_TEXT4 | 7 |
COL_TEXT5 | 8 |
COL_TEXT6 | 9 |
COL_TEXT710 | 10 |
COL_TEXT8 | 11 |
COL_TEXT9 | 12 |
This table lists the keys and values to use with the
getDelimiter function.
Key | Value |
---|---|
SEGMENT_TERMINATOR | 0 |
TAG_DELIMITER | 1 |
ELEMENT_DELIMITER | 2 |
SUB_ELEMENT_DELIMITER | 3 |
REPEATING_ELEMENT_DELIMITER | 4 |
RELEASE_CHAR | 5 |
DECIMAL_SEPARATOR | 6 |
This table lists the keys and values to use with the
setTransactionRegister function.
Key | Value |
---|---|
COL_TEXT1 | 0 |
COL_TEXT2 | 1 |
COL_TEXT3 | 2 |
COL_TEXT4 | 3 |
COL_TEXT5 | 4 |
COL_TEXT6 | 5 |