04-04-2012 02:01 PM
<receiveTask id="waitState" name="wait" />
To continue a process instance that is currently waiting at such a receive task, the runtimeService.signal(executionId) must be called using the id of the execution that arrived in the receive task. The following code snippet shows how this works in practice:
ProcessInstance pi = runtimeService.startProcessInstanceByKey("receiveTask");
Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(pi.getId())
.activityId("wait")
.singleResult();
assertNotNull(execution);
04-04-2012 06:36 PM
TaskQuery taskQuery = processEngine.getTaskService().createTaskQuery();
List<Task> tasks = taskQuery.processInstanceId(processInstanceId).list();
for (Task task : tasks) {
if (task.getDelegationState == DelegationState.PENDING) {
// do stuff
}
}
04-26-2016 04:50 AM
// retrieve the current execution context of the process Id in the waiting state
Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(businessProcess.getProcessInstanceId())
.messageEventSubscriptionName("continueMessage")
.singleResult();
04-26-2016 07:03 AM
04-27-2016 04:03 AM
04-28-2016 05:26 AM
runtimeService.createNativeExecutionQuery()
.sql("SELECT * FROM " + mgmtService.getTableName(Execution.class) + " WHERE PROC_INST_ID_ = #{processInstanceId} AND IS_ACTIVE_ = 1" ).parameter("processInstanceId", processInstance.getProcessInstanceId()).singleResult();
05-03-2016 08:05 AM
05-03-2016 09:17 PM
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.