10-23-2012 09:03 AM
runtimeService.signalEventReceived("invokeSubProcessC");
<intermediateCatchEvent id="catch_invokeSubProcessC" name="SignalCatchEvent">
<signalEventDefinition signalRef="invokeSubProcessC"></signalEventDefinition>
</intermediateCatchEvent>
…
<sequenceFlow id="flow9" name="" sourceRef="catch_invokeSubProcessC" targetRef="subProcessC"></sequenceFlow>
…
<subProcess id="subProcessC" name="Sub Process">
</subProcess>
10-23-2012 11:14 AM
<boundaryEvent id="boundary" attachedToRef="task" cancelActivity="false">
<signalEventDefinition signalRef="invokeSubProcessC"/>
</boundaryEvent>
10-23-2012 12:06 PM
10-23-2012 06:28 PM
10-24-2012 02:15 AM
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn" targetNamespace="Examples">
<signal id="alertSignal" name="alert" />
<process id="nonInterruptingSignalEvent">
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theUserTask" />
<userTask id="theUserTask" name="My User Task" />
<boundaryEvent id="signal" attachedToRef="theUserTask" cancelActivity="false">
<signalEventDefinition signalRef="alertSignal" />
</boundaryEvent>
<sequenceFlow id="flow2" sourceRef="theUserTask" targetRef="theEnd" />
<endEvent id="theEnd" />
<sequenceFlow id="flow3" sourceRef="signal" targetRef="theUserTask2" />
<userTask id="theUserTask2" name="My Second User Task" />
<sequenceFlow id="flow4" sourceRef="theUserTask2" targetRef="theEnd2" />
<endEvent id="theEnd2" />
</process>
</definitions>
@Deployment
public void testNonInterruptingSignal() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("nonInterruptingSignalEvent");
List<Task> tasks = taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).list();
assertEquals(1, tasks.size());
Task currentTask = tasks.get(0);
assertEquals("My User Task", currentTask.getName());
runtimeService.signalEventReceived("alert");
tasks = taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).list();
assertEquals(2, tasks.size());
for (Task task : tasks) {
if (!task.getName().equals("My User Task") && !task.getName().equals("My Second User Task")) {
fail("Expected: <My User Task> or <My Second User Task> but was <" + task.getName() + ">.");
}
}
…
10-24-2012 05:19 AM
helpfull post
[org.activiti.engine.impl.interceptor.CommandContext] (http-localhost-127.0.0.1-8090-11) Error while closing command context: org.activiti.engine.ActivitiException: Execution '1008' has not subscribed to a signal event with name 'startSubProcessAfromX'.
at org.activiti.engine.impl.cmd.SignalEventReceivedCmd.execute(SignalEventReceivedCmd.java:52) [activiti-engine-5.10.jar:5.10]
at org.activiti.engine.impl.cmd.SignalEventReceivedCmd.execute(SignalEventReceivedCmd.java:29) [activiti-engine-5.10.jar:5.10]
…
<definitions …>
<signal id="startSubProcessAfromX" name="startSubProcessAfromX"></signal>
<signal id="startSubProcessAfromY" name="startSubProcessAfromY"></signal>
…
<process id="processP" name="processP">
…
<userTask id="TaskX" …></userTask>
<boundaryEvent id="boundarysignal1" cancelActivity="false" attachedToRef="TaskX">
<signalEventDefinition signalRef="startSubProcessAfromX"></signalEventDefinition>
</boundaryEvent>
<userTask id="TaskY" …></userTask>
<boundaryEvent id="boundarysignal2" cancelActivity="false" attachedToRef="TaskY">
<signalEventDefinition signalRef="startSubProcessAfromY"></signalEventDefinition>
</boundaryEvent>
…
<sequenceFlow id="flow34" name="" sourceRef="boundarysignal1" targetRef="exclusivegateway1"></sequenceFlow>
<sequenceFlow id="flow35" name="" sourceRef="boundarysignal2" targetRef="exclusivegateway1"></sequenceFlow>
…
public void triggerSubProcessAButtonClicked(BusinessProcess businessProcess){
…
runtimeService.signalEventReceived("startSubProcessAfromX", businessProcess.getProcessInstanceId());
…
}
10-24-2012 05:27 AM
10-24-2012 05:43 AM
Try signaling the exact execution instead of the process-instance… Try querying the task and use the executionId you get from there.
//send signal to current task only.
String taskId = Helper.getContextHelper().getParameter(RequestConstants.TASK_ID_PARAMETER_NAME);
runtimeService.signalEventReceived(TaskConstants.TRIGGER_SUBPROCESS_SIGNAL_NAME, taskId);
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.