cancel
Showing results for 
Search instead for 
Did you mean: 

changing start task variables after workflow has been started

stefan2
Champ on-the-rise
Champ on-the-rise
I have a activiti workflow where the task inherits the value of the properties of the start task. There is for example a description field in the start task form, which needs to show up for every subsequent task form. Now I need to be able to change the value of this description field, after the workflow has been started, so that subsequent tasks will inherit (show) the modified value.
Is there perhaps a alfresco node where the properties of the start task are saved? I do not seem to be able to retrieve it.
7 REPLIES 7

mrogers
Star Contributor
Star Contributor
I'm not too familiar with workflow.  But you shoudn't be able to change the start task properties.  if the start task has finished then its completed and all that remains is audit.    You should be able to change the process properties and possibly the current task properties but even then I have my doubts.

douglascrp
World-Class Innovator
World-Class Innovator
Use something like this to save into the workflow instance:
execution.setVariable('variable_name', task.getVariable('variable_name'));

and then this to show the property into the task:
task.variable_name = variable_name;

Let me know if you need more detailed sample.

stefan2
Champ on-the-rise
Champ on-the-rise
Thank you for answering douglascrp ,
I understand that it is possible to change workflow properties (execution variables) through listeners on workflow tasks.
What I was hoping to do is to change workflow properties through a edit form, that is not related to a task (independent of the active task of the workflow).
Say for example I start a workflow with a given Due date and priority , and afterwards I would like to change these (independent of which task the workflow is in), how would I create a form for this ?
Thank you.

rachana
Champ in-the-making
Champ in-the-making
Hi,

I am also facing the same issue. I want to change due date at middle of the workflow. Any Solution please.

mrogers
Star Contributor
Star Contributor
Have "due_date" as a process variable and you can change it at will.    You may need an "update due date" task.

darkredd
Star Contributor
Star Contributor
Mike is correct with the updating of the "due date" variable. However I have found that the "save and close" button on a task does not persist data into the database but just stores the for data somewhere else. What I did was to have an update button on a specific task that required date updating. All my update button does is to allow for the workflow to persist new data in the workflow data and does not complete the task though.

sihnu
Champ in-the-making
Champ in-the-making
You can retrieve the start task with java using workflow service

workflowService.getStartTask(workflowInstanceId);


Hope this helps! Smiley Happy