AnsweredAssumed Answered

How to recycle the advanced workflow on rejecting the doc

Question asked by harishns on May 4, 2010
Latest reply on May 5, 2010 by sebp
Hi,

I am new to writing JPDL, I want to redo the review process with the same person as reviewer with updated document.
is anyone know how to write restart the workflow upon rejecting the document?

if I am not clear, this is how my workflow should be

start advance workflow –> reject the document in review process –> resend the updated document to the same person for approve/reject –> perform same operation till document get approve.

there is one reassign action which I can use it in alfresco webclient, if I did that, I don't get option to update the document and I get 'Task Done' button instead of approve/reject option on the reviewer side.

Can anyone helpme out in modifying the review-processdefinition.xml .

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:review">

    <swimlane name="initiator" />

    <start-state name="start">
        <task name="wf:submitReviewTask" swimlane="initiator" />
        <transition to="review" >
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <runas>admin</runas>
         </action>
         <script>
              var mail = actions.create("mail");
              mail.parameters.to = bpm_assignee.properties.email;
              mail.parameters.subject = "new Review Task";
              mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/notify_user_email.ftl");
              mail.parameters.text = "A document awaiting your approval at Alfresco";
              mail.execute(bpm_package.children[0]);
         </script>
      </transition>
    </start-state>

    <swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>
        </assignment>   
    </swimlane>

    <task-node name="review">
        <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>

    <task-node name="rejected">
        <task name="wf:rejectedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <task-node name="approved">
        <task name="wf:approvedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <end-state name="end" />


   <script></script>

</process-definition>

Thanks

Outcomes