Workflow Concepts - NeoSOFT-Technologies/workflow-plugins GitHub Wiki
Workflow Variables
Every workflow instance can have a set of workflow variables.
A workflow variable is a simple key/value pair stored as part of the workflow instance, and is useful to store information that can later be used by other activities.
Workflow variables can be in JavaScript or Liquid Expression format.
JavaScript Expression
Any workflow variable can be accessed directly as if they were a global variable.
For example, if the SetVariable activity sets a variable called FirstName to '_Luk_e', it can be accessed as follows:
`Hello ${FirstName}`
Value stored in the variable:
"Hello Luke"
This also works when setting variables using the setVariable function. Because ultimately, both the SetVariable activity and setVariable function use the same API under the cover to set a workflow variable.
Liquid Expression
Use the following syntax to access a workflow variable:
{{ Variables.NameOfVariable }}
For example, given a workflow variable called FirstName with a value of "Alice", the expressionHello {{ Variables.FirstName }} will result in Hello Alice.
Send Signal
Elsa comes with simple yet powerful signaling capabilities that allow you to send simple signals from and to workflows as well as from your application code.
You can thing of a signal as an event and consists of the following attributes:
- Signal Name
- Signal Payload
Workflow signals make it easy to publish a signal to multiple workflows or to signal a specific workflows, either via workflow instance ID or correlation ID.
Send Signal activity sends the specified signal.
Signal Received
Signal Received activity suspends workflow execution until the specified signal is received.
Correlate
Correlate activity sets the CorrelationId of the workflow to a given value. Elsa enables you to correlate workflows with a application-specific values. These values can be anything, but typically represent an identifier of an entity in your domain.