Nuxeo Server

Variables Available in the Automation Context

Updated: September 22, 2017 Page Information Edit on GitHub

For a broader look about variables available in different contexts, have a look at the Understand Expression and Scripting Languages Used in Nuxeo page.

You need to be familiar with the concept of Automation for this section.

In the chains run on nodes (Input chain, output chain, transition and escalation chains) you have access to some data linked to the workflow being run.

  • WorkflowVariables: A hashmap, used like this: WorkflowVariables['my_workflow_level_variable']
  • NodeVariables: A hashmap, used like this: NodeVariables['my_Node_level_variable']
  • workflowInitiator: The user who launched the workflow.
  • workflowStartTime: The time when the workflow was started, useful for example when computing a due date (Eg: MVEL Due date expression: workflowStartTime.days(8)).
  • documents: The documents bound to the workflow. These documents are also set as input of all executed chains.
  • button: The button id that was clicked for processing the task, if the current node is a task node.
  • nodeId
  • state: The node state. A node waiting for its originating tasks to be completed is suspended. At the end of the workflow the node is done.
  • nodeStartTime: The time when the node was started, useful for example when computing a due date (Eg: MVEL Due date expression: nodeStartTime.days(8))
  • nodeEndTime: The time when the node was ended.
  • nodeLastActor: The last actor on the node. Useful for instance to know who closed a task when the task was assigned to a group.
  • CurrentUser.getActingUser(): All the automation operations executed by the workflow engine are executed using a temporary unrestricted session (if the current user is not an administrator, this is a session with the user "system"). This function returns the ID of the actual user performing the task.
  • ChainParameters: A hashmap, used like this: ChainParameters['my_chain_parameter']. Since 5.7.2, all chains are able to contain parameters as operation to be used from the automation context along their execution.
  • workflowInstanceId: The id of the workflow instance.
  • NodeVariables["tasks"]: Holds information about all tasks created by a node. Is a list of objects of type TaskInfo. You can iterate on this list and fetch for every task: the lifecycle state (ended or not), the user who ended the task, the comment if any, and the id of the button the user clicked to complete the task (status).

You can use these variables on the node configuration form Studio: in automation chains, in the fields "Due Date expression" , "Compute additional assignees" and when setting up conditions on transitions or escalation rules .

3 days ago manonlumeau NXDOC-1323: Update BDE doc
3 years ago Anahide Tchertchian 18 | orma
3 years ago Guillaume Renard 17
4 years ago Solen Guitter 16
4 years ago Mariana Cedica 15
4 years ago Mariana Cedica 14
4 years ago Solen Guitter 13
4 years ago Alain Escaffre 12
4 years ago Vladimir Pasquier 11
4 years ago Alain Escaffre 10
4 years ago Bertrand Chauvin 9
4 years ago Bertrand Chauvin 8 | Added originating user
4 years ago Solen Guitter 7
5 years ago stan 6
5 years ago Alain Escaffre 4
5 years ago Alain Escaffre 5
5 years ago Alain Escaffre 1
5 years ago Alain Escaffre 2
5 years ago Alain Escaffre 3 | Migrated to Confluence 4.0
History: Created by Alain Escaffre