12-06-2013 05:33 AM
public class JavaServiceSignal implements JavaDelegate
{
@Override
public void execute(DelegateExecution execution) throws Exception {
List<HistoricVariableInstance> hvi = historyService.createHistoricVariableInstanceQuery().variableValueEquals("rcvwait", "true").orderByProcessInstanceId().desc().list();
String waitProcessInstanceIdString = hvi.get(0).getProcessInstanceId();
Execution execution1 = runtimeService.createExecutionQuery().processInstanceId(waitProcessInstanceIdString).activityId("receivetask1").singleResult();
runtimeService.signal(execution1.getId());
System.out.println("Wait Completed");
}
}
repositoryService.createDeployment().addClasspathResource("diagrams/signalWaitReceiveProcess.bpmn20.xml").deploy();
repositoryService.createDeployment().addClasspathResource("diagrams/waitReceiveProcess.bpmn20.xml").deploy();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("waitReceiveProcess");
System.out.println("Main: Started wait for Message Process instance id " + processInstance.getProcessInstanceId());
ProcessInstance pi2 = runtimeService.startProcessInstanceByKey("signalWaitReceiveProcess");
12-06-2013 05:43 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.