Skip to main content

Variable

The Variable class represents a workflow variable that can hold various types of data, including linked document values, and provides methods for manipulating and setting values from different sources, such as positions, professions, or documents.

Properties

NameDescription
CaptionThe caption dictionary representing localized captions for the flow object.
TextThe text representation of the variable, used for displaying purposes, especially when the variable is linked to a document control.
ValueTypeThe data type of the variable's value, such as integer, decimal, text, or date.
IsPublicSpecifies whether the variable is public, allowing access from other components or parts of the workflow.
IsHtmlIndicates whether the variable's value or text should be treated as HTML content.
LinkedObjectNameThe name of the object within the linked document that the variable corresponds to.
IsLinkedIndicates whether the variable is linked to a document control, determining whether its value is sourced from a linked document object.
TextMLA dictionary representing multilingual text values for the variable, allowing for language-specific text retrieval.
KeyA unique identifier for the workflow step.
NameName for the workflow step.
ValueThe value of the variable. It can be a simple data type or a complex object, depending on the variable's configuration and source.
LinkedDocumentObjectNameThe name of the linked document object that the variable is associated with, if any.
WorkflowCodeInstanceThe workflow code instance associated with the flow object.
CachedDMObjectsThe cached document management objects related to the flow object.
TypeCodeThe type code associated with the flow object.
ValueSourceTypeThe source type of the variable's value, which determines where the value is retrieved from (e.g., document, position, profession).

Constructors

NameDescription
Variable(name, workflowData, workflowCodeInstance)Constructor for the Variable class. Initializes a new instance of Variable with the specified name, workflow data, and optional workflow code instance.
Variable(name, workflowData, workflowCodeInstance)Constructor for the Variable class. Initializes a new instance of the Variable class.

Methods

NameDescription
Increment()Increments the variable's value by 1, assuming the value is numeric.
SetFromDepartment(sourceDepartment)Sets the variable's value from a department's ID.
UnlinkObject()Removes the link between the variable and its associated document object, making it a regular variable with no document link.
SetFromVariable(sourceVariable, sourceProperty)Sets the variable's value from another variable, using either its value or text, depending on the property specified.
SetFromProfession(sourceProfession)Sets the variable's value from a profession's ID.
SetFromProjectName()Sets the variable's value to the name of the current project in the workflow.
SetConstantValue(value)Sets the variable's value to a constant value, detaching it from any dynamic sources or links.
SetFromPosition(sourcePosition)Sets the variable's value from a workflow position's ID and description.
Initialize()Initializes the variable. Can be used to set up default values or configurations for the variable before use.
Decrement()Decrements the variable's value by 1, assuming the value is numeric.
ToLiquid()Converts the variable to a Liquid-compatible object, useful for rendering in templates or workflows.

Events

NameDescription
OnAfterExecution(sender, args)Occurs after the execution of the workflow step.
OnBeforeExecution(sender, args)Occurs before the execution of the workflow step.