3 Replies Latest reply on Dec 21, 2007 5:10 AM by Frank

    How to read Controller variables in an Action ?

    Frank Newbie

      Hi all !
      I have a state which has associated a Controller

      <start-state name="start">
       <task name="task1" blocking="true" swimlane="ernie">
       <variable name="var1" access="read"></variable>
       <variable name="var2" access="read"></variable>
       <transition name="to_state" to="first"> </transition>

      Now in the next state I fire an action when node is entered....

      <state name="first">
       <event type="node-enter">
       <action name="action1"></action>
       <transition name="to_end" to="end">
       <action name="action" class="com.sample.action.MyActionHandler">
       <message>About to finish!</message>

      I'd like to read the Controller variables in the Action....
      but I get null.....

      String var1 = (String)context.getContextInstance().getVariable("var1");

      returns null

      How can I read Controller variables ? if it's not possible to do it, how can I inject those variables in my Java code ?
      Thanks a lot