02-22-2011 05:08 AM
final String deploymentId = repositoryService.createDeployment()
.addClasspathResource("diagrams/test.activiti.bpmn20.xml").deploy().getId();
final HashMap<String, Object> variables = new HashMap<String, Object>();
variables.put("vehicleId", 42L);
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("helloworld", variables);
Execution execution = runtimeService.createExecutionQuery().processDefinitionKey("helloworld")
.variableValueEquals("vehicleId", 42L).singleResult();
System.out.println(runtimeService.getActiveActivityIds(execution.getId()));
runtimeService.signal(execution.getId());
02-22-2011 06:06 AM
02-22-2011 06:13 AM
runtimeService.createExecutionQuery()
.processDefinitionKey("helloworld")
.variableValueEquals("vehicleId", 42L)
.list();
And this one the list with only the process instance ([ProcessInstance[5]])Execution execution = runtimeService.createExecutionQuery()
.processDefinitionKey("helloworld")
.variableValueEquals("vehicleId", 42L)
.activityId("receiveTask")
.singleResult();
02-22-2011 06:24 AM
ProcessInstance pi = runtimeService.createProcessInstanceQuery().processDefinitionKey("helloworld").variableValueEquals("vehicleId", 42L).singleResult();
List<Execution> execution = runtimeService.createExecutionQuery().processInstanceId(pi.getProcessInstanceId()).activityId("receiveTask").list();
-it's somewhat less efficient but should work I think.
02-22-2011 06:47 AM
ProcessInstance pi = runtimeService.createProcessInstanceQuery().processDefinitionKey("helloworld").variableValueEquals("vehicleId", 42L).singleResult();
List<Execution> execution = runtimeService.createExecutionQuery().processInstanceId(pi.getProcessInstanceId()).activityId("receiveTask").list();
Your code results in an empty list execution.02-22-2011 06:56 AM
02-22-2011 10:04 AM
Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(processInstance.getId())
.activityId("receivetask1")
.singleResult();
This doesn't:execution = runtimeService.createExecutionQuery()
.variableValueEquals("vehicleId", 42L)
.activityId("receivetask1")
.singleResult();
02-23-2011 02:00 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.