Appearance
Introduction to Variables (Deprecated)
**NOTE:**This applies to the deprecated way of referencing variables. Please reference Intro to Variables
Everything is configurable through variables.
When you configure a task, you can almost always enter an expression that uses variables instead of a concrete value. At runtime, these expressions are expanded and the resulting value is used.
The concept of variables is very important because while a workflow models the behavior, or steps to take, the data describes what is acted upon.
Let's say, for example, you have a workflow that starts an application. The steps to start the application is a behavior that is modeled by the tasks that make up the workflow.
Now, let's also say you now want to start that process in a dev environment, Q/A environment, or production environment. The behavior does not change. The data changes. What differenciates these environments is configuration. Where the process runs, what database it connect to, are all data relating to the configuration.
Variables let you separate the behavior from the configuration. It allows you to write a workflow (behavior) and introduce configuration at runtime.
To get the most out of Situate, you need to think about separating data from behavior whenever possible.
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 enter a variable name, for instance.
$
The variable ${foo} will be resolved or expanded at runtime of the workflow.
Every workflow executed, by default, has the following varialbles injected. These variable 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 by which the workflow executes as.
- installPath : String : The installation path of Situate server.
- timeStarted : Date : The start time of the workflow.
- workflow : [Workflow](java-doc/com/xona/wf/Workflow.html) : The actual workflow object.
- triggerName : String : The name of the trigger name that started 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 : Calling workflows (or parent) instance id. (This now different the "id" above which is the notify workflows instance id)
- pTimeStarted : Date : Calling workflows start time.
- pTimeStopped : Date : Calling workflows stop time.
- pTriggerName : String : Calling workflows trigger name that started the workflow.
- pWorkflow : [Workflow](java-doc/com/xona/wf/Workflow.html) : Calling workflows workflow object
- pTriggerRef : [TriggerRef](java-doc/com/xona/wf/Workflow.TriggerRef.html) : Calling workflows trigger ref object. (Allows for detailed information about trigger)
As of version 1.4.5 and later
- pCalTimeStarted : Calendar : Calling workflows start time.
- pCalTimeStopped : Calendar : Calling workflows 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 : Calling workflows (or parent) instance id. (This now different the "id" above which is the notify workflows instance id)
- pTimeStarted : Date : Calling workflows start time.
- pTimeStopped : Date : Calling workflows stop time.
- pTriggerName : String : Calling workflows trigger name that started the workflow.
- pWorkflow : [Workflow](java-doc/com/xona/wf/Workflow.html) : Calling workflows workflow object
- pTriggerRef : [TriggerRef](java-doc/com/xona/wf/Workflow.TriggerRef.html) : Calling workflows trigger ref object. (Allows for detailed information about trigger)
As of version 1.4.5 and later
- pCalTimeStarted : Calendar : Calling workflows start time.
- pCalTimeStopped : Calendar : Calling workflows 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.