Skip to content

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 is 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 enter 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 the certian 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 : 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 : Calling workflows workflow object
  • pTriggerRef : TriggerRef : 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 : Calling workflows workflow object
  • pTriggerRef : TriggerRef : 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.

Workload Automation and Orchestration