cancel
Showing results for 
Search instead for 
Did you mean: 

sending document to other users

sofie24
Champ in-the-making
Champ in-the-making
Hi all

does anyone of you know how I can send the document in the workflow to another person while that workflow is still processing?

Here is the situation:
    - user A starts the workflow with document X
    - document X was send to user B
    - user B approves this document and then it has to be sent to user C
    - if user B rejects this document nothing special should happen
I only got to manage this until step 2 (the document was sended to user B and he can just approve/reject this).

Thanx in advance

Sofie
    3 REPLIES 3

    davidc
    Star Contributor
    Star Contributor
    The approve transition needs to go to a new task (assigned to user C).

    User C is determined by either hard-coding their name in the process definition (least attractive) or assigning the username to a process variable (more attractive).  The selection of user can be done in javascript or UI.

    http://wiki.alfresco.com/wiki/WorkflowAdministration

    sofie24
    Champ in-the-making
    Champ in-the-making
    Hi david

    thankx for your reply. I can now assign a task to another user.

    Sofie

    sofie24
    Champ in-the-making
    Champ in-the-making
    hi,

    in the previous post I said that I could assign a task to another person. Well I can do this, but it never arrives at the other person.

    Here's my code:
    processdefinition
    <?xml version="1.0" encoding="UTF-8"?>

    <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="Facturatie">
         
        <!– swimlane initiator bv admin –>
        <swimlane name="initiator" />
           
        <start-state name="start">
            <task name="wf:submitFirstReviewTask" swimlane="initiator" />
          <transition name="" to="start review"></transition>
        </start-state>
              
          <node name="start review">
             <event type="node-enter">
                <script>
                   <variabele name="wf_approveCount" access="write"></variabele>
                   <!– <variabele name="wf_outcome" access="write"></variabele>–>
                   <expression>
                      wf_approveCount = 0;
                      <!– wf_outcome = "";–>
                   </expression>
                </script>
             </event>
             <transition name="review" to="review"></transition>
       </node>
      
       <task-node name="review">
            <task name="wf:checkBillTask">
               <assignment actor-id="vandenackers"/>
            </task>
          <transition name="reject" to="endreviewA">
             <!– <script>
                <variabele name="wf_outcome" access="write"></variabele>
                <expression>
                   wf_outcome = "reject";
                </expression>
             </script>–>
          </transition>
          <transition name="approve" to="endreviewA">
             <!–  <script>
                <variabele name="wf_outcome" access="write"></variabele>
                <expression>
                   wf_outcome = "approve";
                </expression>
             </script>–>
          </transition>
       </task-node>
      
       <join name="endreviewA">
          <transition name="" to="isapprovedA"></transition>
       </join>
      
       <decision name="isapprovedA">
          <transition name="reject" to="rejected">
             <!– <condition>#{wf_outcome == 'reject'}</condition>–>
          </transition>
          <transition name="approve" to="bedrag &gt; 10.000">
             <!–  <condition>#{wf_outcome == 'approve'}</condition>–>
          </transition>
       </decision>
      
       <task-node name="rejected">
            <task name="rejectedTask"></task>
            <transition name="" to="end"></transition>
       </task-node>
      
       <decision name="bedrag &gt; 10.000">
          <transition name="bedrag kleiner" to="controle door B">
             <condition>#{wf_amount !> 10000}</condition>
          </transition>
          <transition name="bedrag groter" to="controles">
             <condition>#{wf_amount >= 10000}</condition>
          </transition>
       </decision>
      
       <task-node name="controle door B">
            <task name="wf:reviewTask">
               <assignment actor-id="vandenackere"></assignment>
            </task>
          <transition name="reject" to="endreviewB"></transition>
          <transition name="approve" to="endreviewB"></transition>
       </task-node>
      
       <join name="endreviewB">
          <transition name="" to="isApprovedBCD"></transition>
       </join>
      
       <decision name="isApprovedBCD">
       <transition name="reject" to="rejected">
          <condition>#{wf_approveCount != 2}</condition>
       </transition>
       <transition name="approve" to="approved">
          <condition>#{wf_approveCount == 2}</condition>
       </transition>         
       </decision>
      
       <fork name="controles">
          <transition name="eerste controle" to="controle door C"></transition>
          <transition name="tweede controle" to="controle door D"></transition>
       </fork>
      
       <task-node name="controle door C">
            <task name="reviewTask">
               <assignment actor-id="vandenackerk"/>
            </task>
          <transition name="reject" to="endcheckCD">
             <script>
                <variabele name="wf_approveCount" access="write"></variabele>
                <expression>
                   wf_approveCount= wf_approveCount;
                </expression>
             </script>
          </transition>
          <transition name="approve" to="endcheckCD">
             <script>
                <variabele name="wf_approveCount" access="write"></variabele>
                <expression>
                   wf_approveCount = wf_approveCount + 1;
                </expression>
             </script>
          </transition>
       </task-node>
      
       <task-node name="controle door D">
            <task name="reviewTask">
               <assignment actor-id="vaneykenc"/>
            </task>
          <transition name="reject" to="endcheckCD">
             <script>
                <variabele name="wf_approveCount" access="write"></variabele>
                <expression>
                   wf_approveCount = wf_approveCount;
                </expression>
             </script>
          </transition>
          <transition name="approve" to="endcheckCD">
             <script>
                <variabele name="wf_checkStatusD" access="write"></variabele>
                <expression>
                   wf_approveCount = wf_approveCount + 1;
                </expression>
             </script>
          </transition>
       </task-node>
      
       <join name="endcheckCD">
          <transition name="" to="endreviewCD">
          </transition>
       </join>
      
       <join name="endreviewCD">
            <transition name="" to="isApprovedBCD"></transition>
       </join>
      
       <task-node name="approved">   
            <task name="wf:approvedTask"></task>
            <transition name="" to="end"></transition>
       </task-node>
      
       <end-state name="end" />
    </process-definition>

    The code below are only the changes I maid in those files. The rest is the default code.
    web-client-config-properties
    <config evaluator="node-type" condition="wf:submitFirstReviewTask" replace="true">
          <property-sheet>
             <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>
             <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
             <show-property name="bpm:workflowPriority" display-label-id="wf_review_priority" />
             <show-property name="bpm:workflowDueDate" display-label-id="wf_review_due_date" />
          </property-sheet>
       </config>

    <config evaluator="node-type" condition="wf:checkBillTask" replace="true">
         <property-sheet>
           <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
           <show-property name="bpm:taskId" />
           <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
           <show-property name="bpm:dueDate" read-only="true"/>
           <show-property name="bpm:priority" read-only="true" />
           <show-property name="bpm:status" />
           <!–<show-property name="bpm:amount" component-generator="TextAreaGenerator" read-only="false" />–>
           <!–<separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
           <show-association name="bpm:assignees" /> –>
           <separator name="sep3" display-label-id="wf_review_options" component-generator="HeaderSeparatorGenerator" />
             <show-property name="wf:amount" />
         </property-sheet>
       </config>

    workflowModel
    <type name="wf:submitFirstReviewTask">
             <parent>bpm:startTask</parent>
          </type>

    <type name="wf:checkBillTask">
             <parent>bpm:workflowTask</parent>
             <properties>
                <property name="wf:amount">
                   <type>d:int</type>
                   <mandatory>true</mandatory>
                </property>
             </properties>
            <!– <overrides>
                <property name="bpm:packageItemActionGroup">
                   <default>edit_package_item_actions</default>
                </property>
             </overrides> –>
           <mandatory-aspects>
                <aspect>wf:firstReviewStats</aspect>
             </mandatory-aspects>
          </type>

    <aspect name="wf:firstReviewStats">
                <properties>
                   <property name="wf:outcome">
                      <type>d:text</type>
                   </property>
                </properties>
            </aspect>
       </aspects>

    bpmModel
    <!– Task amount –>
                    <property name="bpm:amount">
                       <type>d:int</type>
                    </property>

    Does anyone knows where it get stuck? I didn't get any error.

    Thanks in advance

    Sofie