0 Replies Latest reply on Feb 20, 2006 11:18 AM by mennen

    How can i get the previous transition?

    mennen

      I have been trying to get the previous transition to a node.
      I did an action with does this:

       Transition t = executionContext.getTransition();
       String transition_name = t.getName();
      
       // Node n = executionContext.getTransitionSource();
       //String nodeName = n.getName();
      
      
      And i get a null pointer exception.
      
      Here is my process definition:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition name="transition test">
       <swimlane name="demandeur">
       <assignment expression="user(mennen)"></assignment>
       </swimlane>
      
      
       <start-state name="start transition tests">
       <task swimlane="demandeur">
       <controller>
       <variable name="Date_demande" access="read"/>
       <variable name="transition" access="read"/>
       </controller>
      
       </task>
       <transition name="transition_1" to="task1"> </transition>
       </start-state>
      
       <end-state name="end1"></end-state>
      
       <task-node name="task1">
       <task swimlane="demandeur">
       <controller>
       <variable name="Date_demande" access="read"/>
       <variable name="transition" access="read"/>
       </controller>
      
       <event type="task-create">
       <script>
       <expression>
       Date today = new Date();
       executionContext.getContextInstance().setVariable("Date_demande",today);
       String t = executionContext.getTransition();
       // String t = executionContext.getTransitionSource().getName();
       executionContext.getContextInstance().setVariable("transition",t);
       </expression>
       </script>
       </event>
      
       </task>
       <transition name="transition_2" to="task2"></transition>
       </task-node>
      
      
       <task-node name="task2">
       <task swimlane="demandeur">
       <controller>
       <variable name="Date_demande" access="read"/>
       <variable name="transition" access="read"/>
       </controller>
       </task>
       <transition name="transition_3" to="end1"></transition>
       </task-node>
      
      
      </process-definition>
      
      
      Thanks in advance,