Class WorkflowInstance


  • public class WorkflowInstance
    extends ModelObject
    An instance of a workflow.
    • Field Detail

      • id

        public final Long id
        The workflow instance identifier.
      • executorId

        public final Integer executorId
        The id of executor that is currently processing this workflow. May be null.
      • parentWorkflowId

        public final Long parentWorkflowId
        The id of the workflow that created this sub workflow. Is null for root workflows.
      • parentActionId

        public final Long parentActionId
        The id of the workflow action that created this sub workflow. Is null for root workflows.
      • type

        public final String type
        The type of the workflow definition.
      • priority

        public final Short priority
        The priority of the workflow instance. When an executor chooses from many available scheduled workflow instances it primarily (unfairly) schedules the workflow instance with the larger priority value, and for workflows with the same priority, the one scheduled first. Priority defaults to 0 and can also be negative.
      • businessKey

        public final String businessKey
        Business key.
      • externalId

        public final String externalId
        External identifier of the workflow instance. Must be unique within the same executor group.
      • state

        public final String state
        The name of the current state.
      • stateText

        public final String stateText
        The description of the last action executed by the workflow.
      • nextActivation

        public final org.joda.time.DateTime nextActivation
        The next activation time for the workflow instance.
      • stateVariables

        public final Map<String,​String> stateVariables
        The state variables. Uses the variable name as the key and serialized variable value as value.
      • originalStateVariables

        public final Map<String,​String> originalStateVariables
        The state variable values before executor started processing the state.
      • retries

        public final int retries
        Number of retry attempts of the current state. Zero when the state is executed for the first time.
      • created

        public final org.joda.time.DateTime created
        The workflow instance creation time.
      • modified

        public final org.joda.time.DateTime modified
        The last modification time of the workflow instance.
      • started

        public final org.joda.time.DateTime started
        Time when workflow processing was started, that is, time when processing of first action started.
      • executorGroup

        public final String executorGroup
        The name of the executor group for this workflow instance.
      • signal

        public final Optional<Integer> signal
        The signal raised for this workflow instance.
      • isArchived

        public final boolean isArchived
        True if this instance is archived. Archived instances are read-only, no modifications are allowed to them.
      • childWorkflows

        public Map<Long,​List<Long>> childWorkflows
        Child workflow instance IDs created by this workflow instance, grouped by instance action ID.
    • Method Detail

      • getChangedStateVariables

        public Map<String,​String> getChangedStateVariables()
        Return the state variables that have been added or modified during state processing.
        Returns:
        New and modified state variables.
      • getStateVariable

        public String getStateVariable​(String name)
      • getStateVariable

        public <T> T getStateVariable​(String name,
                                      Class<T> valueType)
      • getStateVariable

        public <T> T getStateVariable​(String name,
                                      Class<T> valueType,
                                      T defaultValue)
      • getStateVariable

        public String getStateVariable​(String name,
                                       String defaultValue)