[jboss-user] [JBoss jBPM] - proccess not execute HactionHandler

scull do-not-reply at jboss.com
Wed Apr 23 15:24:38 EDT 2008


Hi

I'm have a procces like this:

<process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="Flujo">


	<start-state name="start-state1">
		
	</start-state>


	<task-node name="crear_tarea" signal="first-wait"  create-tasks="false" >
		
		
			
		
		
	</task-node>

	
		
		
	

	<task-node name="tomar_fotos" signal="first-wait"  create-tasks="false" >
		
		
			
		
		
	</task-node>

	<task-node name="redactar_tarea" signal="first-wait"  create-tasks="false" >
		
		
		
			
		
		
	</task-node>

 continue *******

I create N task in taskNode(crear_tarea) and work fine, after that when I finish one of my task the proccess make one task in (crear_tarea) and (tomar_fotos), this work fine , but when I finish another of my task in (crear_tarea)  node,  the proccess the process not create the taskInstance of  (crear_tarea) and (tomar_fotos), and not make a new taskInstance.

I call that method for do that:
 
 public String asignar() {
        
        WorkflowUtil util = new WorkflowUtil();
        JbpmContext context = util.getContexto();
        guardar();
        try{
            
            System.out.println("Id de la tarea a terminar: " + this.tareaId);
            
            TaskInstance t_instance = context.getTaskInstance(this.tareaId);
            
            System.out.println("instance :"+t_instance.getCreate());
            
            t_instance.getContextInstance().setTransientVariable("ids_periodistas", new String[]{"10117", "10308"});
            t_instance.getContextInstance().setTransientVariable("id_fotografo", "2");
            // seleccionar el id del texto en la tabla tb_texto y ponerlo en las variables temporales
            
            Long id_texto = new Long(this.getTexto().getId_texto());
            System.out.println("id texto a enviar :");
            //para el fotografo..
            t_instance.getContextInstance().setTransientVariable(WorkflowUtil.T_ID_TEXTO, id_texto);
            t_instance.getContextInstance().setTransientVariable(WorkflowUtil.T_FECHA_LIM, t_instance.getDueDate());
            //para el periodista...
            t_instance.getContextInstance().setTransientVariable(WorkflowUtil.T_ID_TEXTOP, id_texto);
            t_instance.getContextInstance().setTransientVariable(WorkflowUtil.T_FECHA_LIMP, t_instance.getDueDate());
            
            t_instance.end();
            context.save(t_instance.getToken().getProcessInstance());
            
        } catch (Exception e) {
            e.getCause();
        } finally {
            context.close();
        }
        return "to_view";
    }

and the one of my action handlers ActionHandler execute method ist that:
  public void execute(ExecutionContext executionContext) throws Exception {

        TaskMgmtInstance tskMgtInstance = executionContext.getTaskMgmtInstance();
TaskMgmtDefinition tmd = (TaskMgmtDefinition)executionContext.getDefinition(TaskMgmtDefinition.class);

            Task task = tmd.getTask("toma_fotos");
            TaskInstance t_intance = tskMgtInstance.createTaskInstance(task,executionContext.getToken());
            t_intance.setVariableLocally(WorkflowUtil.T_ID_TEXTO,executionContext.getContextInstance().getTransientVariable(WorkflowUtil.T_ID_TEXTO));
            
            String fecha = executionContext.getContextInstance().getTransientVariable(WorkflowUtil.T_FECHA_LIM).toString();
            DateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd");
            
            t_intance.setDueDate(dFormat.parse(fecha.substring(0,fecha.indexOf(" "))));
            t_intance.setActorId(String.valueOf(executionContext.getContextInstance().getTransientVariable("id_fotografo")));
            
            t_intance.start();
            
            executionContext.getContextInstance().deleteTransientVariable(WorkflowUtil.T_ID_TEXTO);
            executionContext.getContextInstance().deleteTransientVariable("id_fotografo");
            executionContext.getJbpmContext().save(t_intance);
        
     
    }

I see already 9 post abaut this problem , but never found the solution.

What can I do for resolve that problem.

Tnks for any help…


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

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




More information about the jboss-user mailing list