2 Replies Latest reply on Jul 31, 2006 3:05 PM by kukeltje

    Swimlane in start

    dlipski

      Hi
      I want to remeber process initiator and then assign some task only to such person. So I've created some smple process definition:

      <process-definition name="orderManagement">
       <swimlane name="creator" />
      
       <start-state name="start">
       <task swimlane="creator"/>
       <transition name="init" to="somewhere"></transition>
       </start-state>
      </process-definition>
      


      And after invoking this code:
      InputStream is = new FileInputStream("processes/orderManagement/processdefinition.xml");
      ProcessDefinition def = ProcessDefinition.parseXmlInputStream(is);
      ProcessInstance pi = def.createProcessInstance();
      Token t = pi.getRootToken();
      t.signal();
      


      I get such log:

      [org.jbpm.configuration.ObjectFactoryImpl] - adding object info 'jbpm.mail.address.resolver'
      [org.jbpm.jpdl.xml.JpdlXmlReader] - process xml warning: swimlane 'creator' does not have an assignment
      [org.jbpm.graph.def.GraphElement] - event 'process-start' on 'ProcessDefinition(orderManagement)' for 'Token(/)'
      [org.jbpm.graph.def.GraphElement] - event 'before-signal' on 'StartState(start)' for 'Token(/)'
       [org.jbpm.graph.def.GraphElement] - event 'node-leave' on 'StartState(start)' for 'Token(/)'
      [org.jbpm.graph.def.GraphElement] - event 'transition' on 'Transition(init)' for 'Token(/)'
      


      What is wrong ? It is very similar to example from documentaion(11.7).



        • 1. Re: Swimlane in start
          cormierjf

          I think the warning about the swimlane is normal.

          "Starting" a process instance is different if there is a task in the start node. I do not know exactly why.

          I think you need something like this to start the processInstance:

          
          if (processDef.getTaskMgmtDefinition().getStartTask() != null) {
           TaskInstance startTask = processInstance.getTaskMgmtInstance().createStartTaskInstance();
          } else {
           processInstance.signal();
          }
          


          I use this code with Jbpm 3.1.1, it may be different for 3.2.

          JF


          • 2. Re: Swimlane in start
            kukeltje

            afaik it should be called INITIATOR