Product level info | |
---|---|
This functionality is not entirely available with every Loftware Automation product level. |
Loftware Automation is an event-based application that triggers the execution of actions upon changes in monitored events. You can use any of the available triggers to monitor changes in events, such as file drop into a certain folder, acquired data on a specific TCP/IP socket, HTTP message, and others. Main purpose of a trigger is to detect changes in events, retrieve the data provided by the event, and to execute actions.
The majority of triggers passively listens for the monitored event to occur. There are two exceptions. Database trigger is an active trigger that periodically checks for changes in the monitored database. Serial port trigger can wait for incoming connection, or can actively poll for data in specified time intervals.
Processing Triggers
In most cases, the trigger receives data that must be printed on labels. Once the trigger receives the data, the actions are executed in the defined order from top to bottom. The received data can contain values for label objects. However, before you can use these values, you must extract them from the received data and save them in variables. The filters define extraction rules. When executed, filters save the extracted data to the mapped variables. Once you have the data stored in variables, you can run actions that use the variables, such as Print Label.
After an event occurs, the provided input data is saved in a temporary file located in the service user's %temp%
folder. The internal variable DataFileName
refers to the temporary file location. The file is deleted when the trigger completes its execution.
Trigger Properties
To configure a trigger, define how to accept the data and the actions that you want to run. Optionally, you can also use variables. There are three sections that form the trigger configuration.
-
Settings: Defines main parameters of the selected trigger. Select the event that the trigger will monitor for changes, or define the inbound communication channel. Settings tab allows you to select the script programming engine and security options. The available options depend on the trigger type. For more information, see section Trigger Types below.
-
Variables: This tab defines the variables you need inside the trigger. Usually, you import variables from the label templates, so you can map them with the fields extracted from the inbound data. You can also define variables to be used internally in various actions and won't be sent to the label. For more information, see section Variables.
-
Actions: This tab defines the actions to be executed whenever the trigger detects a change in the monitored event. Actions execute in order from top to bottom. For more information, see section Actions.
Trigger Types
-
File Trigger: Monitors the change in the file or in a set of files in the folder. Contents of the file can be parsed in filters and used in actions.
-
Serial Port Trigger: Monitors inbound communication on the serial RS232 port. Contents of the input stream are parsed by filters and used in actions. The data can be also polled from the external device in defined time intervals.
-
Database Trigger: Monitors record changes in SQL database tables. Contents of the returned data set can be parsed and used in actions. The database is monitored in defined time intervals. The trigger can also update the database after the actions execute using
INSERT
,UPDATE
andINSERT SQL
statements. -
Scheduler Trigger: Executes your trigger in scheduled time intervals.
-
TCP/IP Server Trigger: Monitors the inbound raw data stream arriving on the defined socket. Contents of the input stream is parsed by filters and used in actions. TCP/IP server trigger can be bidirectional and used to provide feedback.
-
TCP/IP Client Trigger: Turns your Automation into a listening client that connects to TCP/IP servers.
-
HTTP Server Trigger: Monitors the inbound HTTP-formatted data stream arriving on the defined socket. Contents of the input stream is parsed by filters and used in actions. User authentication can be enabled. Is bidirectional, providing feedback.
-
Web Service Trigger: Monitors the inbound data stream arriving on the defined Web Service method. Contents of the input stream are parsed by filters and used in actions. Is bidirectional, providing feedback.
-
Cloud Trigger: Captures data from Loftware Cloud.
Error Handling in Triggers
-
Configuration errors: The trigger is in error state if it is configured improperly or incompletely. For example, you have configured the file trigger, but failed to specify the file name to check for changes. Or, you defined the action to print labels, but you haven't specified the label name. You can save triggers that contain configuration errors, but you cannot run them in Automation Manager until you resolve the issue. The error reported in the lower level of the configuration propagates itself all the way to the higher level, so it is easy to find the error location.
Example 18. Example
If you have one action in error state, all upper-level actions indicate the error state. The error icon is displayed in Actions tab and in trigger name.
-
Overlapping configurations: While it is perfectly acceptable for the configuration to include triggers monitoring the same event, such as the same file name, or listening on the same TCP/IP port, such triggers cannot run simultaneously. When you start the trigger in Automation Manager, it starts only if no other trigger from the same or other configuration monitors the same event.
Print Job Status Feedback
See section Print Job Status Feedback.