2 Replies Latest reply on Dec 28, 2007 3:33 AM by Marc Kropholler

    number of swimlanes retrieved by taskMgmntInstance.getSwimla

    Marc Kropholler Newbie

      Hi all,

      Does anybody know how it comes that the number of swimlanes reported by TaskMgmtInstance is not constant, and how to get swimlanes when they are not reported by TaskMgmtInstance? After adding an Action with the following code to a processdefinition:

      ProcessInstance pi = executionContext.getProcessInstance();
      if (pi != null) {
       TaskMgmtInstance taskMgmtInstance = pi.getTaskMgmtInstance();
       if (taskMgmtInstance != null) {
       Map swimlanes = taskMgmtInstance.getSwimlaneInstances();
       if (swimlanes != null) {
       int nSwimlanes = swimlanes.size();
       log.info("ProcessInstance contains " + nSwimlanes + " swimlanes.");
       for (Iterator iterator = swimlanes.values().iterator(); iterator.hasNext();) {
       SwimlaneInstance swimlane = (SwimlaneInstance) iterator.next();
       log.info("Swimlane: " + swimlane.getName());
       }
       } else {
       log.info("Swimlane instances is null");
       }
       } else {
       log.info("TaskManagementInstance is null.");
       }
      } else {
       log.info("ProcessInstance is null.");
      }
      


      The number of swimlanes varied and getSwimlaneInstances() returned null at some point, logging details:

      2007-12-27 15:35:13,812 INFO [com.syfact.workflow.jbpm.handler.LoggingActionHandler] Swimlane instances is null
      ...
      2007-12-27 15:35:45,265 INFO [com.syfact.workflow.jbpm.handler.LoggingActionHandler] ProcessInstance contains 1 swimlanes.
      ...
      2007-12-27 15:35:45,265 INFO [com.syfact.workflow.jbpm.handler.LoggingActionHandler] ProcessInstance contains 2 swimlanes.
      


      Please say so if you need more information. We would like to call setActorId() on a swimlane but can't retrieve it now.

      thanks for the help,
      Marc

        • 1. Re: number of swimlanes retrieved by taskMgmntInstance.getSw
          Anurag Paliwal Newbie

          Your processDefinition.xml would be of some help in investigating it.

          • 2. Re: number of swimlanes retrieved by taskMgmntInstance.getSw
            Marc Kropholler Newbie

            Hi Anuragpaliwal,

            Here is the processdefinition. The loggingActionHandlers report
            1 swimlane, 2 swimlanes, 2 swimlanes. They are also called when the application starts, then they report swimlanes = null.

            thx,
            Marc


            <?xml version="1.0" encoding="UTF-8"?>
            <!-- jBPM process definition for syfact. Created with
            jBPM eclipse plugin, Eclipse 3.3.0 and jBPM JPDL 3.2.2.-->
            
            <process-definition xmlns="urn:jbpm.org:jpdl-3.2"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://docs.jboss.org/jbpm/xsd/jpdl-3.2.xsd"
             name="reassign-dossier-processdefinition">
            
             <swimlane name="initialUser">
             <assignment config-type="bean" class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy">
             <targetBean>currentUserAssignmentHandler</targetBean>
             </assignment>
             </swimlane>
            
             <swimlane name="investigator">
             <assignment config-type="bean" class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy">
             <targetBean>currentUserAssignmentHandler</targetBean>
             </assignment>
             </swimlane>
            
             <swimlane name="assignedUser">
             <assignment class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>usernameInContextAssignmentHandler_AssignedUser</targetBean>
             </assignment>
             </swimlane>
            
             <start-state name="start">
             <transition name="" to="Reassign dossier for first user"></transition>
             </start-state>
             <task-node name="Reassign dossier for first user">
             <event type="node-enter">
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>loggingActionHandler</targetBean>
             </action>
             </event>
             <task name="Reassign dossier" blocking="true" swimlane="initialUser">
             <event type="task-assign">
             <action name="Put first users username in context"
             class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>putUsernameInContextActionHandler_Investigator</targetBean>
             </action>
             </event>
             <controller>
             <variable name="comment" access=",write,required" mapped-name="Comment:STRING"></variable>
             <variable name="assignedUsername" access=",write,required" mapped-name="username:STRING"></variable>
             </controller>
             </task>
             <transition name="" to="Accept dossier"></transition>
             </task-node>
             <task-node name="Accept dossier">
             <event type="node-enter">
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>copyInvestigatorToAssigningUsername</targetBean>
             </action>
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>loggingActionHandler</targetBean>
             </action>
             </event>
             <task name="Accept dossier" blocking="true" swimlane="assignedUser">
             <controller>
             <variable name="comment" access="read" mapped-name="Comment:STRING"></variable>
             <variable name="acceptDossier" access="read,write,required"
             mapped-name="Accept dossier:BOOL"></variable>
             </controller>
             </task>
             <transition name="" to="Decision for Accept dossier">
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>loggingActionHandler</targetBean>
             </action>
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>copyAssignedUsernameToInvestigatorIfDossierAccepted</targetBean>
             </action>
             </transition>
             </task-node>
             <decision name="Decision for Accept dossier">
             <transition name="Reject dossier" to="Reassign dossier for subsequent users">
             <condition>#{not acceptDossier}</condition>
             <action name="Notify assigning user of rejection" class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy"
             config-type="bean">
             <targetBean>notifyAssigningUserActionHandler_Rejection</targetBean>
             </action>
             </transition>
             <transition name="Accept dossier" to="Reassign dossier for subsequent users">
             <condition>#{acceptDossier}</condition>
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>reassignDossierActionHandler</targetBean>
             </action>
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>reassignDossierActionHandler</targetBean>
             </action>
             <action name="Notify assigning user of acceptance"
             class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy">
             <targetBean>notifyAssigningUserActionHandler_Acceptance</targetBean>
             </action>
             </transition>
             </decision>
            
             <task-node name="Reassign dossier for subsequent users">
             <task name="Reassign dossier" blocking="true" swimlane="investigator">
             <event type="task-start">
             <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" config-type="bean">
             <targetBean>reassignDossierActionHandler</targetBean>
             </action>
             </event>
             <controller>
             <variable name="comment" access=",write,required" mapped-name="Comment:STRING"></variable>
             <variable name="assignedUsername" access=",write,required" mapped-name="username:STRING"></variable>
             </controller>
             </task>
             <transition name="" to="Accept dossier"></transition>
             </task-node>
            
            </process-definition>