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=4180502#4180502

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

Reply via email to