Hello!
Today I try all the day with this problem:
I want to set a local variable to the task instance when the enter node:

ES: I have this kind of process


  | 
  | <process-definition
  |     name="todo">
  |    
  |    <start-state name="start">
  |       <transition to="task1"/>
  |    </start-state>
  |    
  |    <task-node name="task1">
  |       <task name="todo" description="#{todoList.description}">         
  |          <assignment pooled-actors="commerciale"/>         
  |       </task>
  |       <transition to="done" name="end"/>
  |       <transition name="toTask2" to="task2"></transition>
  |    </task-node>
  |    
  |    <end-state name="done"/>
  |    <task-node name="task2">
  |       <event type="node-enter">
  |          <action name="action1" class="AssegnaSuperVisore">
  |             <superVisore>valore</superVisore>
  |          </action>
  |       </event>
  |       <transition name="toTask1" to="task1"></transition>
  |    </task-node>
  |    
  |    
  | </process-definition>
  | 
  | 

When the wf pass from the task1 to the task2 and enter i want to set the 
variabile var1 with the ActionHandler class


  | package xxx.xxxxxx.wf.bpm;
  | 
  | import org.jbpm.graph.def.ActionHandler;
  | import org.jbpm.graph.exe.ExecutionContext;
  | import org.jbpm.taskmgmt.exe.TaskInstance;
  | 
  | public class AssegnaSuperVisore implements ActionHandler {
  |     
  |     private String superVisore;
  | 
  |     private static final long serialVersionUID = 1L;
  | 
  |     public void execute(ExecutionContext arg0) throws Exception {
  |             
  |             TaskInstance taskInstance = arg0.getTaskInstance();
  |                     
  |             if( taskInstance != null )
  |                     taskInstance.setVariableLocally("supervisore", 
superVisore);
  |             else
  |                     arg0.getContextInstance().setVariable("supervisore", 
superVisore);
  | 
  |     }
  | 
  |     public String getSuperVisore() {
  |             return superVisore;
  |     }
  | 
  |     public void setSuperVisore(String superVisore) {
  |             this.superVisore = superVisore;
  |     }
  | 
  | }
  | 
  | 
  | 

But seem that the taskInstance is every null.

Help me!!!
Thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060084
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to