8 Replies Latest reply on Oct 3, 2008 11:21 AM by kukeltje

    Swimlane, groups and their fields

    provajbpm

      Hi all.

      i've create a start state.


      <start-state name="holiday reservation">
      <task name="reservation question" swimlane="Clients">
      <controller>
      <variable name="
      departure date" access="read,write,required" mapped-name="
      departure date"></variable>
      </controller>
      </task>
      <transition name="check availability" to="check_availability"></transition>
      </start-state>


      after i've assign two role

      < swimlane name="Clients">
      <assignment expression="group(Clients)"></assignment>
      < /swimlane>
      < swimlane name="TourOperator">
      <assignment expression="group(TourOperator)"></assignment>
      < /swimlane>


      now, how can i to know with jbpm api the complete list of all fields for that start-state ??


        • 1. Re: Swimlane, groups and their fields
          kukeltje

          use [ c o d e ] instead of [ q u o t e ]

          • 2. Re: Swimlane, groups and their fields
            kukeltje

            Look at the api. on the TaskInstance there is a method called getVariables

            • 3. Re: Swimlane, groups and their fields
              provajbpm

              i've do

              TaskMgmtSession taskSession = jbpmContext.getTaskMgmtSession();
              List<TaskInstance> listaTask = TaskSession.findTaskInstancesByProcessInstance(processInstance);
              


              but my list is void !!!


              on my start node there are two groups of user like here:

               <swimlane name="Clienti">
               <assignment expression="group(Clienti)"></assignment>
               </swimlane>
               <swimlane name="TourOperator">
               <assignment expression="group(TourOperator)"></assignment>
               </swimlane>
               <start-state name="richiesta pacchetto vacanza">
               <task name="Richiesta domanda" swimlane="Clienti">
               <controller>
               <variable name="data partenza" access="read,write,required" mapped-name="Data di partenza"></variable>
               </controller>
               </task>
               <transition name="richiesta verifica" to="verifica disponibilita"></transition>
               </start-state>
              


              • 4. Re: Swimlane, groups and their fields
                salaboy21

                Before your query for obtain the tasks

                TaskMgmtSession taskSession = jbpmContext.getTaskMgmtSession();
                List<TaskInstance> listaTask = TaskSession.findTaskInstancesByProcessInstance(processInstance);
                


                Do you create your process Instance right?

                • 5. Re: Swimlane, groups and their fields
                  provajbpm

                  Of course:

                  
                  jbpmConfiguration = JbpmConfiguration.getInstance("WEB-INF/jbpm.cfg.xml");
                   jbpmContext = jbpmConfiguration.createJbpmContext();
                   graphSession = jbpmContext.getGraphSession();
                  
                   processDefinition = graphSession.findLatestProcessDefinition("trip");
                   processInstance = new ProcessInstance(processDefinition);
                  
                   // other tests
                   ContextInstance ci = processInstance.getContextInstance();
                   Map vars = ci.getVariables();
                   Token token = processInstance.getRootToken();
                   Map maps = processInstance.getTaskMgmtInstance().getSwimlaneInstances();
                  


                  • 6. Re: Swimlane, groups and their fields
                    salaboy21

                    Ok, now i think i can see the problem.
                    You are not working with persistence? (a Database for storing the process information?)

                    • 7. Re: Swimlane, groups and their fields
                      provajbpm

                      i'm working with HyperSqL default db for jbpm-suite.

                      this is my flow:

                      <process-definition
                       xmlns="urn:jbpm.org:jpdl-3.2" name="trip">
                       <swimlane name="Clienti">
                       <assignment expression="group(Clienti)"></assignment>
                       </swimlane>
                       <swimlane name="TourOperator">
                       <assignment expression="group(TourOperator)"></assignment>
                       </swimlane>
                       <start-state name="richiesta pacchetto vacanza">
                       <task name="Richiesta domanda" swimlane="Clienti">
                       <controller>
                       <variable name="data partenza" access="read,write,required" mapped-name="Data di partenza"></variable>
                       </controller>
                       </task>
                       <transition name="richiesta verifica" to="verifica disponibilita"></transition>
                       </start-state>
                      
                      
                       <decision name="verifica disponibilita">
                       <handler
                       class='com.sample.action.VerificaDisponibilita'>
                       </handler>
                       <transition name="verifica negativa" to="prenotazione terminata"></transition>
                       <transition name="verifica positiva" to="invio pagamento"></transition>
                       </decision>
                       <fork name="invio pagamento">
                       <event type="node-enter">
                       <action name="controllo scelta pagamento" class="com.sample.action.VerificaTipoPagamento"></action>
                       </event>
                       <transition name="pagamento carta" to="carta di credito"></transition>
                       <transition name="pagamento contanti" to="contanti"></transition>
                       </fork>
                       <state name="carta di credito">
                       <transition name="pagamento carta ok" to="pagamento ok"></transition>
                       </state>
                       <state name="contanti">
                       <transition name="pagamento contanti ok" to="pagamento ok"></transition>
                       </state>
                       <join name="pagamento ok">
                       <transition name="prenotazione eseguita" to="prenotazione ok"></transition>
                       </join>
                      
                       <end-state name="prenotazione terminata"></end-state>
                       <state name="prenotazione ok">
                       <transition name="termina flusso" to="prenotazione terminata"></transition>
                       </state>
                      
                      </process-definition>
                      



                      it is in italian language :) thanks.

                      • 8. Re: Swimlane, groups and their fields
                        kukeltje

                        MAKE A SMALL UNIT TEST PLEASE...... that demonstrates the problem... not code snippets process snippets, postting assumptions.... please.......