[jboss-user] [JBoss jBPM] - How to read Controller variables in an Action ?

francis1970 do-not-reply at jboss.com
Thu Dec 20 11:37:05 EST 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114712#4114712

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114712



More information about the jboss-user mailing list