public void calledWorkflowInstanceEnded(final ActivityInstanceImpl callingActivityInstance, WorkflowInstanceImpl calledWorkflowInstance) { mapOutputVariables(callingActivityInstance, calledWorkflowInstance); calledWorkflowInstance.workflow.getWorkflowEngine() .send(new Message() .workflowInstanceId(callingActivityInstance.workflowInstance.getId()) .activityInstanceId(callingActivityInstance.getId()), callingActivityInstance.workflowInstance); }
@POST @Produces(MediaType.APPLICATION_JSON) public WorkflowInstance send(Message message) { log.info("Message "+message.getWorkflowInstanceId()+" / "+message.getActivityInstanceId()); return workflowEngine.send(message); } }
public WorkflowInstance send(Message message, WorkflowInstanceImpl workflowInstance) { Map<String, Object> transientData = message.getTransientData(); if (transientData !=null) { for (String key: transientData.keySet()) { workflowInstance.setTransientProperty(key, transientData.get(key)); } } String activityInstanceId = message.getActivityInstanceId(); ActivityInstanceImpl activityInstance = workflowInstance.findActivityInstance(activityInstanceId); if (activityInstance==null) { workflowInstanceStore.unlockWorkflowInstance(workflowInstance); throw new RuntimeException("Activity instance "+activityInstanceId+" not in workflow instance"); } if (log.isDebugEnabled()) log.debug("Signalling "+activityInstance); ActivityImpl activity = activityInstance.getActivity(); activity.activityType.message(activityInstance, message); return workflowInstance.executeWork(); }
@Override public WorkflowInstance send(Message message) { WorkflowInstanceImpl workflowInstance = lockWorkflowInstanceWithRetry(message.getWorkflowInstanceId()); return send(message, workflowInstance); }
public WorkflowInstance sendMessage(WorkflowInstance workflowInstance, String activityInstanceId) { return workflowEngine.send(new Message() .workflowInstanceId(workflowInstance.getId()) .activityInstanceId(activityInstanceId)); }
@POST @Produces(MediaType.APPLICATION_JSON) public WorkflowInstance send(Message message) { log.info("Message "+message.getWorkflowInstanceId()+" / "+message.getActivityInstanceId()); return workflowEngine.send(message); } }
public WorkflowInstance endTask(WorkflowInstance workflowInstance, String activityId) { ActivityInstance activityInstance = workflowInstance.findOpenActivityInstance(activityId); assertNotNull("Activity '"+activityId+"' not in workflow instance", activityInstance); return workflowEngine.send(new Message() .workflowInstanceId(workflowInstance.getId()) .activityInstanceId(activityInstance.getId())); }
subInstance = workflowEngine.send(new Message() .workflowInstanceId(subInstance.getId()) .activityInstanceId(subtaskInstance.getId()));