3 Replies Latest reply on Jun 30, 2008 8:09 PM by fernando.deleon

    Knowing which token you are in?

    fernando.deleon Newbie

      Ok...am starting to evaluate JBPM and doing some small proof of concepts.
      hooked JBPM with Spring + JSF running on Tomcat using an Oracle DB

      My simple question is this..
      I start a process instance and all is fine.

      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="myholidaydefenition">
      
       <start-state>
       <transition to="reqHoliday" name="requestHoliday"/>
       </start-state>
      
       <task-node name="reqHoliday">
       <task name="requestHolidayTask"/>
       <transition to="evaluateLeave" name="evaluateRequest"/>
       </task-node>
      
       <decision name="evaluateLeave">
       <handler class="au.com.qtc.simpleForms.jbpm.decision.EvaluateLeaveDecisionHandler"/>
       <transition to="end" name="yes">
       <action class="au.com.qtc.simpleForms.jbpm.action.NotifyAboutLeaveActionHandler"/>
       </transition>
       <transition to="giveDonuts" name="no"/>
       </decision>
      
       <!--<task-node name="evaluateLeave">
       <task name="evaluateLeaveTask"/>
       <transition to="end" name="giveLeave">
       <action class="au.com.qtc.simpleForms.jbpm.action.NotifyAboutLeaveActionHandler"/>
       </transition>
       <transition to="giveDonuts" name="noLeaveSorry"/>
       </task-node> -->
      
       <task-node name="giveDonuts">
       <task name="donutConsolation"/>
       <transition to="end" name="toEnd"/>
       </task-node>
      
       <end-state name="end"/>
      
      </process-definition>
      


      However...as you can see in the evaluateLeave decision i am at this page where the user needs to know whether they'll get leave or not.
      however programmatically how do i know at which node is the token at???
      getRootToken() gives the the root token..but i want the current token.
      so that i can get the name of the token...and say if is in the token 'giveDonuts" then perform a different behavior