[jboss-user] [JBoss jBPM] - create-task="false" does not wok

ahmadyan do-not-reply at jboss.com
Mon Oct 6 04:37:14 EDT 2008


Hi,
I wanted to dynamically create my tasks, hence I put this task-node:

<task-node create-task="false" name="task-node-1" >
		
				<assignment class="MyRoleAssignmentHandler" config-type="bean">
      				RoleName
      			
			
		
			<action class="CreateMultiTask" 
					config-type="bean" 
					name="createMultiplyRepairTask" 
					create-task="false">
			
		
		
	</task-node>

with the following actionHandler:


public class CreateMultiTask implements ActionHandler {
	public void execute(ExecutionContext executionContext) throws Exception {
		Token token = executionContext.getToken();
		TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();
		TaskNode taskNode = (TaskNode) executionContext.getNode();
		
		// Assignee:
		Vector roleInstanceSet = (Vector) tmi.getProcessInstance().getContextInstance().getVariable("__assignee");
		if ( roleInstanceSet == null ) throw new Exception("Role instance set is null . ..");
		// Task
		Task task = taskNode.getTask( tmi.getProcessInstance().getContextInstance().getVariable("__task").toString());
		for( Long ri : roleInstanceSet ){
			TaskInstance ti = tmi.createTaskInstance(task, executionContext);
			ti.setActorId("$RI_" + ri.toString());
		}
	}
}

it does as it supposed to do, it creates some task based myActionHandler but also it create one additional task than expected ( the default task for task-node, which is defined in the task tag. ) it seems that create-task="false" does not work.

any comments or suggestion are welcome. 

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

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



More information about the jboss-user mailing list