[jboss-user] [JBoss Seam] - node enter and assign localvariabile to the task instance

szaccaria do-not-reply at jboss.com
Tue Jul 3 13:04:03 EDT 2007


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



More information about the jboss-user mailing list