Transaction
The Transaction action sends data to or receives data from an endpoint enterprise application program.
For transactions that result in data flowing from the enterprise application (for example, a database select operation or stored procedure), the trigger's Output tab will the returned output variables.
Parameter descriptions
Parameter | Description |
---|---|
Transport Map | Use the Transport
Map drop-down list to select a
transport map defined on the
node. For example, MATERIAL_LOT_INSERT supports an SQL Insert operation. The Input tab becomes populated with the names of the map variables from the transport map MATERIAL_LOT_INSERT Notice the names col_LOT_ID, col_DESCRIPTION, and so forth. These are the map variables that were defined when the transport map was defined. |
Use LUW | This field is only displayed when a
database Transport Map is selected in
the Transport Map pick
list. It allows you to indicate that
the Transaction is
part of a logical unit of work. The 36
character LUWId is
obtained by executing the
Logical Unit of Work Begin
action.
The options are True or False
. |
Input tab
The Input tab is where you associate the variables from the trigger with the map variables defined in the transport map. You do so by selecting local, static, event, device or macro variables, or entering a constant in the Value column.
Parameter | Description |
---|---|
Input Variables | The parameters on the Input tab appear based on the definition of the transport map. For example, a transport map for a database insert operation would have map variables for each of the database table columns. |
Example Input tab
A completed Input tab with selected device variables, macros and constants might look like this:
For this example Transaction action, each time the trigger executes, the variables from the trigger are inserted into the database table identified in the MATERIAL_LOT_INSERT transport map.
Output tab
The Output tab can contain the map variables that will be used as output from the transaction and additional output variables that are updated after the transport map executes. The additional output variables depend on the type of transport map that is being used. For transactions that use database operations, the Transaction action's Output tab provides the resultCount , resultStatus and optionally resultKey output variables.
Output | Description |
---|---|
Output variables | |
resultStatus | Provides a return value that indicates the success of the action. A 0 indicates the action was successful. |
resultCount | Provides a return value that indicates the number of rows that were processed from the result of a database insert, update, select, and stored procedure operation. |
resultKey | This INT8 field is only available for a database INSERT transaction action. It will contain the value of an autogenerated column after the transaction that uses the $GENERATED macro has executed successfully. |
Example Output tab with output variables
The Output tab will also contain variables, as defined in the transport map:
If you had selected a transport map that was defined for a database select or stored procedure operation, the Output tab will contain the output variables that were defined on the transport map's Output tab. This means that the database data values will be output from the Transaction action and can be mapped to variables by selecting the variable in the Value column.
Another example shows an Output tab that contains an output variable and the resultStatus and resultCount variables associated with PLC device variables.
Routing tab
The Transaction action will have a On Result row for Store and Forward that can be used for a Transaction action that references a transport map that references a transport that supports the store and forward function.
On Result | Description |
---|---|
Success | The route to take upon a successful completion of the action. |
Failure | The route to take upon a failed completion of the action. |
Store and Forward | The route to take if the result of the
Transaction action was the
writing of the transaction data to a store
and forward queue. The transport associated
with the Transaction action's transport
map, must have store and forward
capabilities and that capability must be
enabled. For information about transports
and how to enable Store and Forward, see
Transports. When using the Canvas Editor, the Transaction action will have an output port (route) for the Store and Forward result. |