AnsweredAssumed Answered

Overriding Take Ownership functionality?

Question asked by amanjure on Aug 17, 2007
Latest reply on Feb 22, 2008 by jimcornmell
Please see my process definition file.

The idea is I have an article and its submitted to a
1. either single content producer.. or a
2. pool of content producers..

when the user selects to submit it to a pool of content producers.. a particular content producer can "Take Ownership" of the article or assign some other Producer to it.  The assigning part works fine and the workflow is transitioned to the swimlane "singleproducer". what I want is when the content producers press Take Ownership.. I need the workflow to transition to the "singleproducer " swimlane too.. and its not happening currently..it just is stuck there in the same swimlane i.e "multipleproducers"

could anybody suggest me how I can manage to do that? following is my processdef.

thanks in advance

<?xml version="1.0" encoding="UTF-8"?>

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

    <swimlane name="initiator" />

    <start-state name="start">
        <task name="swwf:startArticleWorkflow" swimlane="initiator"></task>
        <transition name="" to="submit-article"></transition>
    </start-state>

    <swimlane name="submitarticle" />
   
    <task-node name="submit-article">
        <task name="swwf:submitArticleTask" swimlane="submitarticle"></task>
        <transition name="toMultipleProducers" to="multiple-producers"></transition>
        <transition name="toProducer" to="single-producer"></transition>
    </task-node>
       
    <swimlane name="multipleproducers">
        <assignment
            class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <pooledactors>#{people.getGroup('GROUP_cp')}</pooledactors>
        </assignment>
    </swimlane>
       
    <task-node name="multiple-producers">
        <task name="swwf:multipleProducers" swimlane="multipleproducers">
            <event type="task-end">
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                  <script>
                     <variable name="bpm_assignee" access="write"/>
                     <expression>
                        if (taskInstance.actorId != null)
                           people.getPerson(taskInstance.actorId);
                        else
                           person;
                     </expression>
                  </script>
               </action>
            </event>
        </task>
        <transition name="toProducer" to="single-producer"></transition>
    </task-node>  
       
    <swimlane name="singleproducer">
        <assignment
            class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>
        </assignment>
    </swimlane>

    <task-node name="single-producer">
        <task name="swwf:produceTask" swimlane="singleproducer" />
        <transition name="reject" to="returnToInitiator" />
        <transition name="sendToReviewers" to="validateIfThereAreReviewers" />
        <transition name="sendToProofing" to="proof" />
    </task-node>

    <task-node name="returnToInitiator">
        <task name="swwf:returnToInitiator" swimlane="initiator"></task>
    </task-node>

    <swimlane name="reviewers" />

    <!– This was added to return the task to the tray of the producer in case s/he doesnt
        select reviewers when hitting the send to reviewers button, TODO: find a way of sending
        a message to the user indicating what just happened.
    –>
    <decision name="validateIfThereAreReviewers">
        <transition name="reviewersNotProvided" to="single-producer">
            <condition>#{ swwf_assignees == void}</condition>
        </transition>
        <transition name="reviewersProvided" to="startReview">
            <condition>#{ swwf_assignees != void}</condition>
        </transition>
    </decision>


    <node name="startReview">
        <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
            <foreach>#{swwf_assignees}</foreach>
            <var>reviewer</var>
        </action>
        <transition name="" to="review" />
    </node>

    <task-node name="review">
        <task name="swwf:reviewTask">
            <assignment
                class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
                <actor>#{reviewer}</actor>
            </assignment>
        </task>
        <transition name="finished" to="single-producer" />
    </task-node>


    <swimlane name="editors">
        <assignment
            class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <pooledactors>#{people.getGroup('GROUP_ce')}</pooledactors>
        </assignment>
    </swimlane>

    <task-node name="proof">
        <task name="swwf:proofTask" swimlane="editors"></task>
        <transition name="reject" to="single-producer" />
        <transition name="finished" to="end" />
    </task-node>

    <end-state name="end"></end-state>
</process-definition>

Outcomes