AnsweredAssumed Answered

Event to intercept when a workflow is reassigned

Question asked by alarocca on Mar 7, 2011
Latest reply on May 31, 2011 by electroshokker
I customized the lifecycle approval workflow adding to the "status" aspect a new property "reviewer". This is initialized using the bpm_assignee. I would like update this property if the workflow is reassigned to someone else. Where I can put my javascript in order to achive it? Thanks


    <task-node name="review">
        <event type="node-enter">
            <!– Update the status to In Review when we enter this task –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                          bpm_package.children[i].properties["dnetwf:status"] = "In esame";
                        bpm_package.children[i].properties["dnetwf:reviewer"] = bpm_assignee.properties.userName;
                          bpm_package.children[i].save();
                    }
                </script>
            </action>
        </event>

        <task name="wf:reviewTask" swimlane="reviewer">
            <event type="task-create">
                <script>
                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                </script>
            </event>
        </task>
       
        <transition name="approve" to="approved" />
        <transition name="reject" to="rejected" />
    </task-node>

Outcomes