cancel
Showing results for 
Search instead for 
Did you mean: 

Timers for Pooled Actors

jgreen
Champ in-the-making
Champ in-the-making
I'm trying to get a timer to fire when a group of actors fails to complete a task in time

It appears that timers are not firing against tasks in pooled actor swimlanes.


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

<process-definition xmlns="urn:jbpm.org:jpdl-3.2"   name="TIMER-TEST">
   <description>Test workflow to diagnose timer issue</description>

   <!– Swimlane Definitions –>
   <swimlane name="initiator">
      <assignment actor-id="admin" />
   </swimlane>

   <swimlane name="pool">
      <assignment   class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <pooledactors>GROUP_Pool</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="admin">
      <assignment   class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>admin</actor>
      </assignment>
   </swimlane>

   <start-state name="start">
      <task name="Submit Timer Test" swimlane="initiator"> </task>

      <transition to="TIMER-TEST"></transition>

      <event type="node-leave">
         <action
            class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("TIMER-MSG: "+bpm_package.children[0].name + " submitted");
               logger.log("TIMER-MSG: by("+person.properties["cm:firstName"] + ", " + person.properties["cm:lastName"]+")");
               logger.log("TIMER-MSG: The bpm_package node is "   + bpm_package.nodeRef);
            </script>
         </action>
      </event>

   </start-state>

   <task-node name="TIMER-TEST">
   
      <event type="node-enter">
         <action   class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("TIMER-MSG: ["+ bpm_package.nodeRef+"] Timer-Task Started");
            </script>
         </action>
      </event>
      
      <event type="node-leave">
         <action   class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("TIMER-MSG: ["+ bpm_package.nodeRef+"] Timer-Task Exited");
            </script>
         </action>
      </event>
      
      <task name="TIMER" swimlane="admin">
         <timer name="TIMER-TEST" duedate="1 minute"   transition="TIMEOUT">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  logger.log("TIMER-MSG: ["+ bpm_package.nodeRef+"] Timeout Fired");
               </script>
            </action>
         </timer>
      </task>
      
      <transition name="TIMEOUT" to="TimedOut" ></transition>
      <transition name="Approve" to="Approved" ></transition>
   </task-node>

   <end-state name="TimedOut"></end-state>
   <end-state name="Approved"></end-state>

</process-definition>

If the TIMER-TEST task is assigned to the pool, it never fires, but the same workflow against an individual (admin) will.

Here are the messages from the log file with 2 process variants, the first was against the pool. no exceptions are posted.

11:26:47,107 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: TEST submitted
11:26:47,107 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: by(Administrator, )
11:26:47,107 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: The bpm_package node is workspace://SpacesStore/382edd46-728e-11dc-bc31-1571387eae17
11:26:47,123 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: [workspace://SpacesStore/382edd46-728e-11dc-bc31-1571387eae17] Timer-Task Started
11:28:48,497 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: TEST submitted
11:28:48,497 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: by(Administrator, )
11:28:48,497 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: The bpm_package node is workspace://SpacesStore/807d9b8e-728e-11dc-bc31-1571387eae17
11:28:48,544 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: [workspace://SpacesStore/807d9b8e-728e-11dc-bc31-1571387eae17] Timer-Task Started
11:31:18,677 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: [workspace://SpacesStore/807d9b8e-728e-11dc-bc31-1571387eae17] Timeout Fired
11:31:18,708 DEBUG [repo.jscript.ScriptLogger] TIMER-MSG: [workspace://SpacesStore/807d9b8e-728e-11dc-bc31-1571387eae17] Timer-Task Exited
1 REPLY 1

jgreen
Champ in-the-making
Champ in-the-making
It looks like the JBPM engine is generating a Authentication Fault when trying to execute the action. 
This kind of makes sense for a timered action on pooled actors.  The exception is being converted to a warning by the JBPM timer (so it won't halt the JVM) and the log4J configuration is such that this never makes it into the Alfresco log files.

Anyway, easy workaround, just put the timer in it's own node and give it an owner ID to use.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.