3 Replies Latest reply on Jul 31, 2008 9:52 AM by ajanz

    get current state of ProcessInstance

    ajanz

      hi,

      i want to get the current state of a processinstance, especially which transitionnames are availiable at the current state.

      how can i get this?

      i am writing a jsf application on jbpm and need this, so the user can choose which transistion he would like to signal, means a combobox filled with all availiable transistions at the current node, like on tokens view at the jbpm console.

        • 1. Re: get current state of ProcessInstance
          ajanz

          i created the processinstances with the newprocessinstancecommand.

          but the root token is null. is this correct?

          Process defintion is

          
          
           <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="ad-hoc">
          
          
           <start-state name="Start">
           <transition to="in Bearbeitung" name="beginnen"></transition>
           </start-state>
          
          
           <state name="in Bearbeitung">
           <transition to="Ende" name="beenden"></transition>
           <transition to="in Bearbeitung" name="weiterleiten"></transition>
           </state>
          
          
           <end-state name="Ende"></end-state>
          
          
          </process-definition>
          


          • 2. Re: get current state of ProcessInstance
            memius

            after creating your process, I think you need to actually 'start' it with a signal call

            ProcessInstance processInstance = < your newly created processInstance >
            processInstance.getRootToken().signal();

            at least, that's what I would try ;)

            Hope this helps.
            Dieter D'haeyere.

            • 3. Re: get current state of ProcessInstance
              ajanz

              no, reason was lazy hibernate.

              implementing my own command solved my problem.