Appearance
Introduction to Variables (Legacy - Velocity)
NOTE: This information is deprecated as of version 1.11.
Everything is configurable through variables.
When configuring a task, almost every field will allow an expression with one or more variables instead of a concrete value. At runtime, variable expressions are expanded and the variable's value is used.
Variables are integral tools in any workflow because while a workflow models a behavior, variables control the configuration which is acted upon.
Let's say, for example, you have a workflow that starts an application. The steps to start the application are a behavior that is modeled by the tasks that make up the workflow. Different parameters necessary to start the process in a dev environment, Q/A environment, or production environment are the purview of variables, as the workflow's behavior does not change. Where the process runs, what database it connects to, and its credentials are all data relating to the configuration.
Variables
To use a variable, simply enter an expression that contains a variable that will be available when the workflow executes. An expression can be as simple as entering a variable name: ${foo} This simple variable usage causes the variable foo to be resolved or expanded at runtime. Every workflow executed, by default, has certain variables injected. These variables can be used throughout a workflow in any task or entry that accepts a directive.
- id : String : The instance id of the running workflow.
- runBy : String : The username of who started the workflow
- effectiveUser : String : The user the workflow executes as.
- installPath : String : The installation path of Situate server.
- timeStarted : Date : The start time of the workflow.
- workflow : Workflow : The actual workflow object.
- triggerName : String : The name of the trigger that started the workflow.
As of version 1.4.5 and later:
- calTimeStarted : Calendar : The start time of the workflow.
- calTimeStopped : Calendar : The stop time of the workflow.
All notify workflows include the list above and add the following:
- finalState : String : The state of the workflow that just ran (states = "succeeded" | "failed")
- who : String : Whatever has been put into the "Who" textfield of the workflow.
- pId : String : Instance id of the calling instance (the caller). This is different from "id" above, which is the notify workflow's own instance id.
- pTimeStarted : Date : Calling workflow's start time.
- pTimeStopped : Date : Calling workflow's stop time.
- pTriggerName : String : Calling workflow's trigger name that started the workflow.
- pWorkflow : Workflow : Calling workflow's workflow object
- pTriggerRef : TriggerRef : Calling workflow's trigger ref object. (Allows for detailed information about trigger)
As of version 1.4.5 and later:
- pCalTimeStarted : Calendar : Calling workflow's start time.
- pCalTimeStopped : Calendar : Calling workflow's stop time.
All nested workflows include the first list and add the following:
- finalState : String : The state of the workflow that just ran (states = "succeeded" | "failed")
- pId : String : Instance id of the calling instance (the caller). This is different from "id" above, which is the nested workflow's own instance id.
- pTimeStarted : Date : Calling workflow's start time.
- pTimeStopped : Date : Calling workflow's stop time.
- pTriggerName : String : Calling workflow's trigger name that started the workflow.
- pWorkflow : Workflow : Calling workflow's workflow object
- pTriggerRef : TriggerRef : Calling workflow's trigger ref object. (Allows for detailed information about trigger)
As of version 1.4.5 and later:
- pCalTimeStarted : Calendar : Calling workflow's start time.
- pCalTimeStopped : Calendar : Calling workflow's stop time.
As of version 1.4.8 and later:
- [task name].result : int : This state indicates the result of the executed command status.
As of version 1.6.0 and later:
- finalState : String : The state of the workflow that just ran (states = "succeeded" | "failed" | "canceled")
As of version 1.7.0 and later:
The following additional variables are injected into a File trigger. These variables are available to the Trigger itself and not the actual workflow:
- TODAY : String : Current date ISO-8601 standard - YYYYMMDD.
- TOMORROW : String : Date for next day in ISO-8601 standard - YYYYMMDD.
- YESTERDAY : String : Date for previous day in ISO-8601 standard - YYYYMMDD.
These date variables can be used to match the watched directory and/or as a matching file filter.