AnsweredAssumed Answered

Problems with the workflow's customization

Question asked by ejml on Mar 6, 2007
Hello folks, I have customizated the Review & aprove workflow with the help of davidc. I want to appear the user that realized the last step on the workflow in "my task todo" or in "my task done". The problem is that the user showed is ever the initiator of workflow, I need the user of the last step.

Is possible that it's a silly, but I'm novice and I don't see where is the problem.

Thanks in Advance!!.

The wf_from's field is the field that it shows on the jsp.

this is the proccessdefinition:


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

<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" >
            <event type="task-end">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    <expression>wf_from = initiator.properties['cm:userName'];</expression>
                    <variable name="wf_from" access="write"/>
                </script>
            </action>
            </event>
        </task>
        <transition name="" to="review" />
    </start-state>

    <swimlane name="reviewer">
        <assignment actor-id="#{bpm_assignee.properties['cm:userName']}" />
    </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>
            <event type="task-end">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    <expression>wf_from = bpm_assignee.properties['cm:userName'];</expression>
                    <variable name="wf_from" access="write"/>
                </script>
            </action>
            </event>
        </task>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approved" />
    </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" />

</process-definition>


this is the workflomodel:



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

<model name="wf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
   </namespaces>
     
   <types>

      <!–                               –>
      <!–  Basic Review & Approve Tasks –>              
      <!–                               –>
     
      <type name="wf:submitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:reviewTask">
          <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
         <mandatory-aspects>
            <aspect>wf:from</aspect>
         </mandatory-aspects>
      </type>

         <type name="wf:approvedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>wf:from</aspect>
         </mandatory-aspects>
      </type>
     
      <type name="wf:rejectedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>wf:from</aspect>
         </mandatory-aspects>
      </type>
     
      <!–                               –>
      <!–  Adhoc Tasks –>              
      <!–                               –>
     
      <type name="wf:submitAdhocTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:notifyMe">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:adhocTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:completedAdhocTask">
         <parent>bpm:workflowTask</parent>
      </type>

   </types>
  
   <aspects>
      <aspect name="wf:from">
            <properties>
               <property name="wf:from">
                  <type>d:text</type>
               </property>
            </properties>
     </aspect>
  </aspects>

</model>

Outcomes