[jboss-user] [jBPM] New message: "Re: Question on TaskQuery"

ben d do-not-reply at jboss.com
Wed Feb 10 15:11:53 EST 2010


User development,

A new message was posted in the thread "Question on TaskQuery":

http://community.jboss.org/message/525577#525577

Author  : ben d
Profile : http://community.jboss.org/people/bdahon

Message:
--------------------------------------------------------------
Hi there,
 
I'm using the following jpdl file:
 
<?xml version="1.0" encoding="UTF-8"?>
<process name="TestTaskProcess" xmlns="http://jbpm.org/4.3/jpdl">

     <start g="9,20,48,48">
          <transition to="Task1" />
     </start>

     <task g="159,16,127,52" name="Task1">
          <transition to="Task2" name="t" />
     </task>

     <task g="159,120,127,52" name="Task2">
          <transition to="Task3" name="t" />
     </task>

     <task g="161,231,124,52" name="Task3">
          <transition to="end" name="t" />
     </task>

     <end g="371,233,48,48" name="end" />

</process>
 
And my test case:
 
          ProcessEngine processEngine = new Configuration().buildProcessEngine();
          RepositoryService repositoryService = processEngine.getRepositoryService();
          TaskService taskService = processEngine.getTaskService();
          ExecutionService executionService = processEngine.getExecutionService();
 
          NewDeployment deployment = repositoryService.createDeployment().addResourceFromClasspath(
                    "task-test.jpdl.xml");
          deployment.deploy();
 
          ProcessInstance processInstance = executionService
                    .startProcessInstanceByKey("TestTaskProcess");
 
          // Move to Task2
          String activeExecutionId = processInstance.findActiveExecutionIn("Task1").getId();
          ProcessInstance instance = executionService.signalExecutionById(activeExecutionId, "t");
 
          TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(
                    processInstance.getId()).activityName("Task2");
          System.out.println(taskQuery.list());
          // --> [Task(Task1), Task(Task2)]

 
And the outcome is [Task(Task1), Task(Task2)]. Which means I get two tasks instances even though I restricted my query on the activity name.
 
Maybe this is due to the way I "navigate" from one task to another.
 
Thanks,
Ben

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

To reply to this message visit the message page: http://community.jboss.org/message/525577#525577




More information about the jboss-user mailing list