[jboss-user] [jBPM] - Manual reroute in Jbpm 4.3

Martin Pradny do-not-reply at jboss.com
Fri Jun 11 06:30:27 EDT 2010


Martin Pradny [http://community.jboss.org/people/mpradny] replied to the discussion

"Manual reroute in Jbpm 4.3"

To view the discussion, visit: http://community.jboss.org/message/547536#547536

--------------------------------------------------------------
Hi,

 still no luck. moveTo calls setActivity, so it probably not the issue. I think, I'm missing something in general here. The methods are called fine, but the state is not persisted. Here is my current test code - it looks to simple to work  :)  (Based on TaskCandidates test, because once the rerouting is working I want to make sure tasks are also correctly updated)

public void testReroute() {
    ProcessInstance processInstance = executionService.startProcessInstanceByKey("TaskReroute");
    String pid = processInstance.getId();

    // both johndoe and joesmoe will see the task in their *group* task list
    List<Task> taskList = taskService.findGroupTasks("johndoe");
    assertEquals("Expected a single task in johndoe's task list", 1, taskList.size());
    Task task = taskList.get(0);
    assertEquals("review", task.getName());
    taskService.completeTask(task.getId());

    // verify that process moved to the next state
    processInstance = executionService.findProcessInstanceById(pid);
    assertTrue(processInstance.isActive("approve"));

    //reroute back to review
    ExecutionImpl execution=(ExecutionImpl) processInstance.findActiveExecutionIn("approve");
    ProcessDefinitionQuery pdquery = repositoryService.createProcessDefinitionQuery();
    pdquery.processDefinitionId(execution.getProcessDefinitionId());
    ProcessDefinitionImpl pd=(ProcessDefinitionImpl) pdquery.list().get(0);
       ActivityImpl endActivity=pd.getActivity("review");
    execution.setActivity(endActivity);

    processInstance = executionService.findProcessInstanceById(pid);
    assertTrue(processInstance.isActive("review"));

  }

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/547536#547536]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100611/59943f63/attachment.html 


More information about the jboss-user mailing list