cancel
Showing results for 
Search instead for 
Did you mean: 

Event to intercept when a workflow is reassigned

alarocca
Champ in-the-making
Champ in-the-making
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>
1 REPLY 1

electroshokker
Champ on-the-rise
Champ on-the-rise
Add the following event:
<event type="task-assign"></event>

To get the newly assigned user, use "taskInstance.actorId".

(For other process variables you want access to, see http://wiki.alfresco.com/wiki/WorkflowAdministration#Process_Data)
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.