Hello,
I have defined an Activiti process and I can not force variables to be persistent across whole process (they just "evaporate")!
Let's say I have "san:value" property defined in mainUserTask type in workflowModel.xml.
Every other task is a child of this mainUserTask.
Now, in the Alfresco Share, in the user task I enter the value of "san:value" and click "Task done".
In the next task, I want to have the same input field with the value I entered earlier. But the value is empty! Why?
I managed to solve the problem by declaring a TaskListener which gets variable from task and saves it to the execution.
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.
<activiti:field name="script">
<activiti:string><![CDATA[execution.setVariable('san_value', task.getVariable('san_value'));]]></activiti:string>
</activiti:field>
</activiti:taskListener>
But do I really have to do it in every single task with every single variable?
The next problem is, that in the "Workflow Detalis" view, those variables are empty...
Anyone has an idea how this can be fixed?
I also tried calling Java class in the taskListener and instantiate variables there but with the same result.
String myprocessinstanceid = delegateTask.
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService myruntimeservice = processEngine.getRuntimeService();
myruntimeservice.setVariable(myprocessinstanceid, "san_value", delegateTask.getVariable("san_value"));
Regards,
Mike
Ok, i believe there is NO way to achieve that. Workflow History view displays only the history and tt was designed not to be edited...
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.