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">
       <controller>
       <variable name="var1" access="read"></variable>
       <variable name="var2" access="read"></variable>
       </controller>
       </task>
       <transition name="to_state" to="first"> </transition>
       </start-state>


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

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


      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
      Francesco