AnsweredAssumed Answered

Customize My Task Description for Workflows

Question asked by karimbuenaseda on Dec 11, 2013
Latest reply on Jan 10, 2014 by karimbuenaseda
Hi All,

Upon creating a Serial Workflow for a document I want to update My Task Description so that it will reflect the "Document Name followed by Task Description"

I have been trying to do this by modifying the code below:


<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="Serial Approval">
   <swimlane name="initiator" />
   <start-state name="start">
      <task name="ncm:startTask" description="Submit Serial Review Task" swimlane="initiator" />
      <event type="node-leave">

         <script>
            <variable name="approveCount" access="write" />
            <expression>approveCount = 0;</expression>
         </script>
      </event>
      <transition name="Send For Review" to="review" />
   </start-state>
   <task-node name="review">
      <task name="ncm:reviewTask">
         <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignees.get(approveCount)}</actor>
         </assignment>
         <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-assign" />
      </task>
      <event type="node-enter">
         <script>
            <variable name="reviewerCount" access="write" />
            <expression>reviewerCount = bpm_assignees.size();</expression>
         </script>
      </event>
      <transition name="Approve" to="isLast">
         <script>
            <variable name="approveCount" access="write" />
            <expression>approveCount = approveCount + 1  ;</expression>
         </script>
      </transition>
      <transition name="Reject" to="re_submit" />
   </task-node>
   <decision name="isLast">
      <transition name="No" to="review">
         <condition>#{approveCount &lt; reviewerCount}</condition>
      </transition>
      <transition name="Yes" to="FinalSubmit">
         <condition>#{approveCount == reviewerCount}</condition>
      </transition>
   </decision>
   <end-state name="end" />
   <task-node name="re_submit">
      <task name="ncm:reviewTask" swimlane="initiator">
         <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-assign" />
      </task>
      <transition name="ReSubmit" to="review">
         <script>
            <variable name="approveCount" access="write" />
            <expression>approveCount =0 ;</expression>
         </script>
      </transition>
      <transition name="Finish" to="end" />
   </task-node>
   <task-node name="FinalSubmit">
      <task name="ncm:reviewTask" swimlane="initiator">
         <event type="task-assign" />
      </task>
      <transition name="Finish" to="end" />
   </task-node>
</process-definition>


every time I add the variable declarations and Java action class under the task name "ncm:reviewTask" the serial workflow does not seem to work

snippet

<task name="ncm:reviewTask">
         <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignees.get(approveCount)}</actor>
         </assignment>
         <event type="task-create">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
              <variable name="docNodeRef" access="read, write" />
              <variable name="bpm_package" access="read" />
              <expression>
              if (bpm_workflowDueDate != void)
              taskInstance.dueDate = bpm_workflowDueDate;
              if (bpm_workflowPriority != void)
              taskInstance.priority = bpm_workflowPriority;
              <expression>
            </script>
           </action>
         </event>



Am I appending the Action Class and Variable name in the correct position?

Thanks Guys,

Outcomes