06-18-2015 08:52 PM
<receiveTask id="waitTask" name="Dummy Wait State to force db commit">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="${receiveTaskListener}"/>
</extensionElements>
</receiveTask>
@Component("receiveTaskListener")
public class ReceiveTaskListener implements ExecutionListener {
public void notify(DelegateExecution execution) throws Exception {
Task task = execution.getEngineServices().getTaskService().createTaskQuery()
.taskDefinitionKey("waitTask").singleResult();
execution.getEngineServices().getTaskService().complete(task.getId());
}
}
public class ProcessListener implements ActivitiEventListener {
@Override
public void onEvent(ActivitiEvent event) {
switch (event.getType()) {
case ACTIVITY_STARTED:
ExecutionQuery q = event.getEngineServices().getRuntimeService().createExecutionQuery();
List<Execution> executions = q.processInstanceId(event.getProcessInstanceId())
.activityId("waitTask").list();
if (executions != null) {
for (Execution execution : executions) {
event.getEngineServices().getRuntimeService().signal(execution.getId());
}
}
06-19-2015 12:44 PM
06-21-2015 02:35 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.