specs/models/M_TRIG

Triggers

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.

Fields

NameDescription
EventThe event that triggers the execution of logic (i.e. 'When' in the App Editor). See below for possible events.
ClausesThe conditions that control the execution of logic (i.e. 'If', 'If/Else', 'Then'). See below for more details.
ValuesExisting data inside the Tulip system such as 'Part Count' or 'Order Number'. See below for possible value types.
ActionsWhat the trigger does. Many actions are possible in the Tulip system. See below for possible actions.

Events

An event can be triggered from multiple sources. Possible sources and examples below:

Trigger EventDescription
On Step EnterA new step has been displayed to the user
TimersRepeated at some interval, e.g. every 30 seconds
Machines and DevicesA signal has been received from a device or machine
On Step ExitThe user is navigating away from a step
App StartedRun once when the App starts before other logic
App CompletedRun each time the App is completed
App CancelledRun if the App is cancelled
Button is PressedA user has pressed a button object in the App
A Row is SelectedA user has selected a row in a table widget in the App

Clauses

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

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 - Checks if a specified Tulip Table has or does not have a record by ID.
  • Table Record - A record placeholder holding the value of an entry in a Tulip Table. See Record Placeholder
  • Table Aggregations - The result of aggregating a field in a Table (e.g. sum, average). See Table Aggregation
  • Expression - An expression defined via the expression editor. See Expression Editor
  • Machine Activity Field - checks the up/down of a given machine. See Machine Type
  • Machine - Compares two specified machines. See Machine
  • Last Machine Output - Evaluates the last output of a specified machine and attribute. Machine can be set statically, dynamically by station, or dynamically by machine variable.
  • Users - Values associated with a given Tulip user.
  • Static Value - Can be set to any unchanging value.
  • Station - Compares two specified stations.
  • App Info - Set of information about the App itself. The default App Info fields include:
    • Logged In User: Select from a list of Tulip users
    • Logged In User/Badge ID: The badge ID of the logged-in user
    • Logged In User/Name: The name of the logged-in user
    • Time Elapsed on Step: The total amount of time spent on a specific step
    • Time Elapsed on Current Step: The total amount of time spent on the current step
    • Time Elapsed on App: The total amount of time spent in the app during this runtime
    • App Name: The name of the app
    • App Version: The current version of the app
    • Most Recent Published Version: The latest version that has been published for an app
    • Station Name: The name of the station where the app is running
    • Step Name: The name of the current step
    • Step Group Name: The name of the current step group
    • Shift Name: The name of the current shift, as defined in the Schedules tool
    • Current Date And Time: The date/time when the app was started
    • Target Cycle Time For Current Step: The specified expected cycle time for the step that the operator is viewing
    • Target Cycle Time for App: The specified cycle time for the whole app
  • Variable - A named value held in the given App context. Each variable has a type, see variables

Action

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.

Available transition actions:

DEPRECATION NOTICE: A deprecation notice will be shown as of LTS11 for apps that use the previous transition runtime for triggers. This only applies to apps that were created before 2022 and have not yet been migrated with the provided tool. Apps with this message should be updated immediately. Apps that have not been migrated will no longer run in the Tulip Player as of LTS12. After LTS13 (fall 2024) it will no longer be possible to migrate the apps and they will be automatically archived. Refer to the Tulip Knowledge Base for more details: https://support.tulip.co/docs/a-guide-to-app-transitions .

  1. Go to Step - Users can enter the step name or select next or previous as defined in the step list panel.
  2. Go To Step by Name - User can use a variable value to determine the next step, rather than a predefined value.
  3. Go To Next Step Group - Navigate to the next Step Group in the order listed in the App Editor.
  4. Cancel App execution - current App context will be cleared and completion data will be reset.
  5. Complete App execution - current App context and execution state will be persisted. See completion.
  6. 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. The destination has the following options:
  • Logout Current User: Return to the operator login screen in the Player
  • Change to App: Change to the first step of a different app
  • Change To Step: Change to a specific step in a different app
  • Go To Splash Screen: Return to the introductory screen of the app, which requires an operator to press "Begin" before reaching the first step.
  • Change to App by Name: Dynamically define the next app within the context of the current app and go to first step of that app
  • Go To Step By Name: Go to a dynamically defined step within the same app after completion

Available regular actions:

  1. App
    • Save All App Data Saves the current execution state of an app as a completion. Saves data only - does not clear/reset variables or Table Placeholders and does not restart the app.
  2. 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.
    • Insert at index in Array Add a new value after a specified index within an array variable
    • 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.
    • Remove and store element at index in Array Remove an element at a specific index from an array and store it in a specific variable
    • Remove at index in Array Remove an element at a specific index from 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.
    • Sum Array Sum all integers or floats in an array and return in one value
    • Swap elements in Array Swap the elements in an array at 2 given indices
  3. Copy Copies a value from App to system clipboard
  4. Data Manipulation

    • Clear - Set a value to its initial zero-value.
    • Decrement Variable - Increments a specified numeric value.
    • Increment Variable - Increments a specified numeric value.
    • Reset All App Variables to Defaults - Resets app variables to the defaults defined for each variable.
    • Set Downtime Reason - Set the reason a specified machine is down.
    • Store - Store a new value in the context of the current execution.
  5. Logout Current User - Logout the current user and cancel the current App execution.

  6. Open File - Open a specified file path using the default program on your computer (Windows only).
  7. Open Link - Open a specified link in another window.
  8. Play Sound - Play a short audio snippet. Options include: Warning, Overtime, Doorbell, Three notes, Xylophone.
  9. Player Menu - Display player menu to a specific section. The 3 menu options are Open Comments Menu, Pause App, or Open Regular Menu.
  10. Print Steps - Print the specified step or step groups during an App execution.
  11. Print Using System Dialog - Bring up the system print menu for the current step.
  12. 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.
  13. Run Device Function - Users can select from the set of device integrations available in the Tulip system.
  14. Save Image - Downloads an image to the local filesystem. Accepts an Image URL data type for the image and a string for the filepath.
  15. Scan Optical Barcode - Triggers a scan action at a specified barcode.
  16. Send Email - Sends an email to the specified user (with either a static value or user variable) with a configurable message to include in the email body.
  17. 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.
  18. 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.
  19. Show Error - Brings up the error toast in the player with a specified message. Can be translated into multiple languages after enabling App Translations NOTE: this action will not be available if errors have been disabled in the Account Settings.
  20. Show Message - Brings up the message toast in the player with a specified message. Can be translated into multiple languages after enabling App Translations
  21. 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.
  22. Table Records - A collection of actions for how Apps utilize table record placeholders. See Record Placeholder

Error Handling

When more than one trigger exists on an app, step or widget in the same group (e.g. On Step Enter, Timers) a configuration option will be available per group. This allows the user to decide how triggers will behave when an error occurs (e.g. a connector does not return the expected data). In this configuration, a group of triggers can be defined to 'Stop remaining triggers on error':

  • when enabled: following logic with not run after an error occurs. This includes logic within the originating trigger and following triggers within the same group.
  • when disabled: triggers logic will attempt to run, even after an error occurs.

Tests

IDName
QA-T57Variable Widget : 02 - Record View: Compound variables can be used with triggers
QA-T62Variable widget : 07 - Testing variables and compound variables in app
QA-T98Record Placeholders : 04 - Load Table Records Trigger, and Table Record Widget
QA-T99Record Placeholders : 05 - Create and Load Table Record Trigger
QA-T100Record Placeholders : 06 - Table Data Tab
QA-T148SQL Connectors : 02 - Add Function to SQL Connector
QA-T183Triggers - Print Using System Dialog Trigger
QA-T235User Table : 01 - User Table
QA-T240HTTP Connectors : 02 - Add several functions to HTTP Connector
QA-T305Configuration and Apps : 05A - Apps can use Vision Cameras and Regions
QA-T352Triggers - Basic Triggers App
QA-T399Table Links : 03 - Linking Records via App Triggers
QA-T404Configuration and Apps : 12 - Test Jig Enter/Exit region and Appear/Disappear events
QA-T469Schedules and Shifts : 02 - Applying shifts in apps
QA-T497Expression Editor : 01 - Create an expression in an app trigger
QA-T501Copying Triggers : 01 - Copying and pasting triggers between buttons
QA-T502Copying Triggers : 02 - Copying and pasting triggers between image widgets
QA-T504Copying Triggers : 03 - Copying and pasting triggers between Interactive Tables
QA-T505Copying Triggers : 04 - Copying and pasting Step Triggers
QA-T506Copying Triggers : 05 - Copying and pasting App Triggers between apps
QA-T515Base Layout - Widget triggers
QA-T516Base Layout - Step and App Triggers
QA-T521Expression Editor : 02 - Running the "Expressions" app
QA-T679Triggers - Sleep Trigger
QA-T728HTTP Connectors : 05 - Non-2xx Responses
QA-T814Table Links : 05 - Linking Records via App Triggers
QA-T1063Triggers - Default value for 'Stop remaining triggers on error' toggle
QA-T1064Triggers - Functionality of 'Stop remaining triggers on error' toggle
QA-T1093Triggers - Open Link
QA-T1140Machine Monitoring : 11 - Activity fields

Requirements

IDRequirement
PLAT-8859 (121)Ability to define procedural sequences with relevant process information that can guide an operator through task execution.
PLAT-8916 (803)All records shall be Accurate. there must be the ability to build accuracy checks into the design of the system or configure verification for manually entered data as necessary.
PLAT-8948 (805)All records shall be Consistent, ie capture and recorded in the same manner and in the correct sequence of the acitivities or action being recroded.