1 Reply Latest reply on Oct 13, 2006 2:13 AM by Konstantin Kolev

    Swimlane assigment

    juraj Newbie

      Hello,

      I want to run my first jbpm application and have some troubles with assigment of swimlanes. My configuration is that:

      <process-definition
       xmlns="urn:jbpm.org:jpdl-3.1" name="Urlaubsantrag">
       <swimlane name="Antragssteller">
       <assignment expression="group(applicant)"></assignment>
       </swimlane>
       <swimlane name="Vorgesetzer">
       <assignment expression="group(supervisor)"></assignment>
       </swimlane>
       <start-state name="Urlaubsantrag erstellen">
       <task name="Sende Urlaubsantrag" swimlane="Antragssteller">
       <controller>...
       </controller>
       </task>
       <transition name="Urlaubsantrag versenden" to="Urlaubsantrag entscheiden"></transition>
       </start-state>
       <end-state name="Ende"></end-state>
       <task-node name="Urlaubsantrag entscheiden">
       <task name="Urlaubsantrag lesen" swimlane="Vorgesetzer">
       <controller>...
       </controller>
       </task>
       <transition name="Urlaubsantrag bearbeitet" to="Ende"></transition>
       </task-node>
      </process-definition>


      I run the first task:
       Token token = processInstance.getRootToken();
       Node node = (Node)token.getNode();
       System.out.println("Current node: "+node.getName());
      
       Task task = processInstance.getProcessDefinition().
       getTaskMgmtDefinition().getStartTask();
      
       TaskInstance taskInstance = new TaskInstance(task.getName(), "Antragssteller");
       token.signal("Urlaubsantrag versenden");
      

      and get the exception:

      Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: couldn't resolve assignment expression 'group(supervisor)'
       at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:97)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentDelegation(TaskMgmtInstance.java:217)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:193)
       ... 11 more
      Caused by: java.lang.RuntimeException: no active JbpmContext for resolving assignment expression'group(supervisor)'
       at org.jbpm.identity.assignment.ExpressionAssignmentHandler.getExpressionSession(ExpressionAssignmentHandler.java:109)
       at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:69)
       ... 13 more
      Exception in thread "main"


      What is wrong? What I have to do?

      Thank you,
      nort

        • 1. Re: Swimlane assigment
          Konstantin Kolev Newbie

          Hi, nort!
          it seems there is some problem with your JBPM Context. Seems like it is closed upon entering your task node "Urlaubsantrag entscheiden". And this is the reason for not resolving the assignment expression. Since you are entering the task node it means that the process has already left its start state with no problem, i.e. the first swimlane assignment is correct.
          Check if you are calling JbpmContext.close() somewhere in the middle.