AnsweredAssumed Answered

timer issue

Question asked by pobe on Oct 31, 2007
Latest reply on Jan 25, 2008 by tbillard
I want to make a workflow where a timer is triggered when the reciever has not answered in a specific timeperiod. When it is triggered the flow enters a node called TIMEOUT. The problem is that the transition to timeout is selectable by the user. Is there any way to hide that transition button.

/Pontus




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

<process-definition
  xmlns="urn:jbpm.org:jpdl-3.2"  name="granskning">
   
     <swimlane name="initiator"></swimlane>

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

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

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

   <swimlane name="beställare">
      <assignment
         class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{sguwf_bestallare}</actor>
      </assignment>
   </swimlane>

   <swimlane name="projektägare">
      <assignment
         class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{sguwf_projektagare}</actor>
      </assignment>
   </swimlane>

   <start-state name="start">
      <task name="sguwf:startaProcess" swimlane="initiator"></task>
      <transition name="sänd" to="Utarbeta utkast"></transition>
   </start-state>
   
   <task-node name="Utarbeta utkast">
      <task name="sguwf:utarbetaUtkast" swimlane="projektledare" />
      
      <transition name="Öppna för synpunkter" to="fork1"></transition>
   </task-node>
   
  <fork name="fork1">
         <transition name="tr1" to="Starta granskning"></transition>
      <transition name="tr2" to="Granska och redigera bs"></transition>
      <transition name="tr3" to="Granska och redigera pa"></transition>
      <transition name="tr4" to="Granska och redigera ec"></transition>
      <transition name="tr5" to="Granska och redigera vc"></transition>
   </fork>

   <node name="Starta granskning">
      <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
         <foreach>#{sguwf_ovriga}</foreach>
         <var>reviewer</var>
      </action>
      <event type="node-enter">

      </event>
      <transition name="" to="Granska och redigera ovr">
      </transition>
   </node>
   
   <task-node name="Granska och redigera ovr">
      <task name="sguwf:granskaRedigera">
         <assignment
            class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{reviewer}</actor>
         </assignment>
      </task>
      <transition name="Granskning klar" to="join1"></transition>
   </task-node>

   <join name="join1">
      <transition name="" to="endredigering"></transition>
   </join>

   <task-node name="Granska och redigera vc">
      <task name="sguwf:granskaRedigera" swimlane="verksamhetschef">
       <timer name="TIMER" duedate="60 seconds">
                  <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                   var mail = actions.create("mail");
                  mail.parameters.to = sguwf_verksamhetschef.properties["cm:email"];
                  mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
                  mail.parameters.from = sguwf_verksamhetschef.properties["cm:email"];
                  mail.parameters.text = "Du har ett dokument som är klart för granskning";
                  mail.execute(bpm_package);
                   </script>
                </action>
       </timer>
       
        <timer name="TIMER2" duedate="10 minutes" transition="TIMEOUT">
                  <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                   var mail = actions.create("mail");
                  mail.parameters.to = sguwf_verksamhetschef.properties["cm:email"];
                  mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
                  mail.parameters.from = sguwf_verksamhetschef.properties["cm:email"];
                  mail.parameters.text = "Ditt ärende i alfresco har avslutats";
                  mail.execute(bpm_package);
                   </script>
                </action>
          </timer>
       </task>
      
      <transition name="TIMEOUT" to="TIMEDOUT" ></transition>
      <transition name="Granskning klar" to="endredigering" />
   </task-node>

   <task-node name="TIMEDOUT">
       <task name="sguwf:timeOut"/>
      <transition name="" to="endredigering" />
   </task-node>

   <task-node name="Granska och redigera bs">
      <task name="sguwf:granskaRedigera" swimlane="beställare"></task>
      <transition name="Granskning klar" to="endredigering" />
   </task-node>

   <task-node name="Granska och redigera pa">
      <task name="sguwf:granskaRedigera" swimlane="projektägare"></task>
      <transition name="Granskning klar" to="endredigering" />
   </task-node>

   <task-node name="Granska och redigera ec">
      <task name="sguwf:granskaRedigera" swimlane="enhetschef"></task>
      <transition name="Granskning klar" to="endredigering" />
   </task-node>

   <join name="endredigering">
      <transition to="end" />
   </join>
   
    <end-state name="end"/>
   
</process-definition>

Outcomes