Workflow: How to modify an assigned person in a task when the workflow has been initiated.

I have a workflow which has been initiated. Is it possible to change the name of the person assigned in a particular task or node? What is the best way to do it?

2 votes

2 answers

2432 views

ANSWER



Hello,

We have also this problem.

We need to change a task affectation during workflow running.

And got “org.nuxeo.ecm.platform.routing.api.exception.DocumentRouteException: Executing unexpected SUSPENDED state” when trying to reaffect to an other person.

0 votes



Actually the best way is to modify the workflow definition and to use the “Compute additional assignees” field when defining the task assignees on the General task tab. This allows you to dynamically compute the task assignees from a MVEL expression when the workflow is run. For example, you could have a global workflow variable, “assignees” that can be set from a automation chain at any point during the workflow. In this case, the expression to use on the workflow definition for the additional assignees would be :“@{WorkflowVariables[“assignees”]}“. Of course, this solution doesn't work for a workflow already started.

0 votes



Actually, we have already a global workflow variable called "collationneur-chef". We created an automation chain and associated it to a button. In this operation chain, we assigned a new value for the variable "collationneur-chef". However, the original value was not modified after the user clicked on the button "Change collationneur-chef".

Is there something we have missed or ought to do? Thank you.

10/29/2012

Just to verify my comment, we have a global variable that is used in "Compute additional assignees". However, we could not change the value using the automation chain.
10/29/2012

Are you using the SetWorkflowVariable operation ( available under the WorkflowContext category )?
But if you expect an user to submit the value for the "collationneur-chef" as part as your functional workflow there is a simplier way to set its value : when building the workflow, just add it into the form layout presented to the user ( on the Task form layout, its available under the Schema var_yourWorkflowName). When the task is completed, the engine will automatically save the value submitted by the user and later you get this from WorkflowVariables["collationneur-chef"].
10/30/2012