Class WorkflowVars

java.lang.Object
com.axelor.workflow.expression.WorkflowVars

public final class WorkflowVars extends Object
The value policy for vars: what a run's variables may hold and how they go to and from the run's row.

An entity is stored as a {model, id} reference and re-read on resume, so it never disagrees with the current self.

Checked at the write, converted at the park. check(java.lang.String, java.lang.String, java.lang.Object) runs on assignment so the failure names the script; conversion waits for the park because later nodes in the same walk still read the live entity.

  • Method Details

    • check

      public static void check(String nodeId, String key, Object value)
      Refuses, on assignment, anything these variables could never carry. The value is stored unchanged; this only walks it.
      Parameters:
      nodeId - the node whose script is assigning, for the failure; may be null outside a walk
      key - the variable being assigned, which names the failure's path
    • toJson

      public static String toJson(String nodeId, Map<String,Object> vars)
      The variables as the run row's JSON, or null when there are none.
    • fromJson

      public static Map<String,Object> fromJson(String json)
      The variables a resuming run starts from, never null, with references re-read as records.