AnsweredAssumed Answered

Share workflow variables

Question asked by sokolko on Apr 18, 2012
Hello, all!
I've come across one interesting thing about alfresco and its share interface. In our project we use SumitParallelReviewTask several times to allow user enter the necessary data on different stages of a workflow. If the workflow is executed in alfresco old web UI, all the task variables (including dueDate, Priority and Description) get synchronized when the user selects an action in UI(clicks on a button with the name of the desired workflow transition). So another user who can see the task can also see the changes (new values, I guess they are modified in the workflow itself). When doing the same thing in Share, no modifications of workflow variables are made. So the first user changes, say, the description of task expecting to change it for the workflow, clicks on the desired transition button, but his collegues can't see any changes in the following tasks. To deal with this problem I decided to write a script that would synchronize the values manually on task end:

<event type="task-end">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
            [b]   <variable name="bpm_workflowDueDate" access="write"/> [/b]
               <variable name="bpm_workflowDescription" access="write"/>
            [b]  <variable name="bpm_workflowPriority" access="write"/> [/b]
                <expression>
                    bpm_workflowDueDate = taskInstance.dueDate;
             bpm_workflowPriority = taskInstance.priority;
                   bpm_workflowDescription = taskInstance.description;
                 </expression>
                </script>
              </action>
            </event>

But modifying more than one workflow variable also doesn't work (I get the "failed to signal transition" error message when I try to do so), which is also described in https://forums.alfresco.com/en/viewtopic.php?f=34&t=40095 If I remove the two bold lines from my workflow definition - everything works and Description in workflow and task is synchronized, but I still can do nothing with priority and dueDate. So, does anyone has an idea of how this can be solved? Maybe there's another way to sync variables between task and workflow?

Outcomes