Triggers are the core unit of user-definable logic in the Tulip system. Triggers wait for
events to fire then they check various values and compare them inside clauses to
determine whether to perform actions. This document describes triggers as they relate to Apps; Refer to Machine Triggers for triggers as they relate to machines.
Name | Description |
---|
Event | The event that the trigger executes in response to. See below for possible events. |
Clauses | The logical operation the trigger performs before deciding if it should execute an action in response to the event. See below for possible clauses. |
Values | Existing data inside the Tulip system. An example value could be: "if the Tulip variable X is greater than 3" where X is the value. See below for possible values. |
Actions | What the trigger does. Many actions are possible in the Tulip system. See below for possible actions. |
An event can result from multiple sources. Possible sources and examples below:
Source | Example |
---|
Physical interaction | - Barcode being scanned by a USB barcode scanner
- USB footpedalpressed
|
User interface interaction | a user presses a virtual button inside of a Tulip App. |
Time Interval | 60 seconds have elapsed since the App was started. |
Machine Event | A machine emits a state change event, e.g. The machine has stopped. |
Clauses allow users to define a series of boolean logic expressions (if/then statements) that must
all evaluate to true before a given action is performed in response to a trigger event. A user can
define a series of comparisons and then decide to execute a number of actions if one of the
statements evaluates to true of if all of the statements evaluate to true.
Values can be any data-store that is maintained in the context of an App execution. Values can come
from a number of sources, including:
- Table Record - A record placeholder holding the value of an entry in a Tulip Table. See
Record Placeholder
- Expression - An expression defined via the expression editor. See
Expression Editor
- Machine Activity Field - checks the up/down of a given machine.
- Users - Values associated with a given Tulip user.
- Static Value - Can be set to any unchanging value.
- App Info - Set of information about the App itself.
- Variable - A named value held in the given App context. Each variable has a type, see
variables
There are two categories of actions that triggers can cause: transition actions and regular actions.
Transitions are changes to the flow state of the App. Transitions can occur by changing the current
step, canceling the current App (resetting completion data) or completing the App. In a trigger
there can only be one transition per action section. Once a transition has been executed by the App,
any triggers for that same event will not fire. For example, if a user defines two separate triggers
for a barcode scan and they both contain a transition, only the first to execute will be run.
- Go to step - Users can enter the step name or select next or previous as defined in the step
list panel.
- Cancel App execution - current App context will be cleared and completion data will be reset.
- Complete App execution - current App context and execution state will be persisted.
See completion.
- Change App - The ‘cancel App’ and ‘complete App’ actions both have an
option to change Apps. If this action is selected the system will route to the App selected in
the trigger. It will open the App to the version assigned at the station. If there is no assignment
of the App at the station, then it will open the most recently published. If there is no published
version then the system will error.
- Arrays
- Clear array clears the values stored in an array value.
- Concatenate array Combines a source array with a destination array value.
- Get from index in array Gets the item at a specified index from an array value.
- Get length of array Returns a number that corresponds to the number of items in the array.
- Join to string Returns a string of all values combined by a specified delimiter.
- Pop from array Returns the last item of an array and removes it from the array.
- Push onto array Adds an item to the end of an array.
- Set index in array Adds an item at a specified index. If there was already an item at
that index it will be overwritten.
- Add after index in array Add a new value after a specified index within an array variable
- Remove element from array Remove an element at a specific index from an array
- Remove and store element from array Remove an element at a specific index from an array and store it in a specific variable
- Swap elements in array Swap the elements in an array at 2 given indices
- Data manipulation
- Store in Variable - store a new value in the context of the current execution.
- Increment Variable - increments a specified numeric value.
- Decrement Variable - increments a specified numeric value.
- Clear Variable - set a value to its initial zero-value.
- Set Downtime Reason - set the reason a specified machine is down.
- Logout current user - logout the current user and cancel the current App execution.
- Open link - open a specified link in another window.
- Play sound - play a short audio snippet. Options include: Warning, Overtime, Doorbell,
Three notes, Xylophone.
- Player menu - display player menu to a specific section. The 3 menu options are Open Comments
Menu, Pause App, or Open Regular Menu.
- Scan optical barcode - triggers a scan action at a specified barcode.
- Print using system dialog - bring up the system print menu for the current step.
- Run connector function - users can select from one of the connector functions defined in
the Tulip system, and specify which value to save the results to. For more information on
connector functions see Connector functions.
- Run device function - users can select from the set of device integrations available in
the Tulip system.
- Send email - sends an email to the user specified (with either a static value or user
variable) with a specified message in the email body.
- Send SMS - sends an SMS to a specified user (with either a static value or user
variable)with a specified message as the content of the SMS.
- Send SMS With Image - sends an SMS to a specified user with a specified message and a
specified image as the content of the SMS.
- Show error - Brings up the error toast in the player with a specified message.
- Show message - Brings up the message toast in the player with a specified message.
- Split string - A function that takes two strings, the 'split' string and the 'by' string,
and returns an array of strings that can be saved to a variable. The resulting array splits the
split string by every instance of the by string.
- Table records - a collection of actions for how Apps utilize table 'record placeholders. See Record Placeholder