Mine is standalone Java Application and my use case is: To have a receive task (waiting to be triggered from outside later) After it gets runtimeService.signal(waitExecutionId), it should proceed further else should persist this state indefinately.I have selected 'receive task' for this and trying to signal this from another workflow whose service task has below code to trigger the receive task. In below code, I am fetching waiting receive task process instanceId via process variable that gets set through listener configured in receivetask.
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");
}
}
Basically In main method(standalone java application), I have first deployed a workflow with receivetask. Then again deployed another workflow that basically triggers the receive task in 1st workflow by above code through its servicetask.Code in main method below:
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");
I am getting error as <b>org.activiti.engine.ActivitiObjectNotFoundException: no processes deployed with key 'receiveTask'</b>Please help..