use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance in project camunda-bpm-platform by camunda.
the class CallActivityBehavior method startInstance.
@Override
protected void startInstance(ActivityExecution execution, VariableMap variables, String businessKey) {
ProcessDefinitionImpl definition = getProcessDefinitionToCall(execution, getCallableElement());
PvmProcessInstance processInstance = execution.createSubProcessInstance(definition, businessKey);
processInstance.start(variables);
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance in project camunda-bpm-platform by camunda.
the class SignalEventReceivedCmd method startProcessInstances.
private void startProcessInstances(List<EventSubscriptionEntity> startSignalEventSubscriptions, Map<String, ProcessDefinitionEntity> processDefinitions) {
for (EventSubscriptionEntity signalStartEventSubscription : startSignalEventSubscriptions) {
ProcessDefinitionEntity processDefinition = processDefinitions.get(signalStartEventSubscription.getId());
if (processDefinition != null) {
ActivityImpl signalStartEvent = processDefinition.findActivity(signalStartEventSubscription.getActivityId());
PvmProcessInstance processInstance = processDefinition.createProcessInstanceForInitial(signalStartEvent);
processInstance.start(builder.getVariables());
}
}
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance in project camunda-bpm-platform by camunda.
the class ProcessTaskActivityBehavior method triggerCallableElement.
protected void triggerCallableElement(CmmnActivityExecution execution, Map<String, Object> variables, String businessKey) {
ProcessDefinitionImpl definition = getProcessDefinitionToCall(execution, getCallableElement());
PvmProcessInstance processInstance = execution.createSubProcessInstance(definition, businessKey);
processInstance.start(variables);
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance in project camunda-bpm-platform by camunda.
the class PvmActivityInstanceCompleteTest method testSingleEndAfterParallelJoin.
/**
* +----+
* +--->| a1 |---+
* | +----+ |
* | v
* +-----+ +----+ +------+ +-----+
* |start|-->|fork| | join |--->| end |
* +-----+ +----+ +------+ +-----+
* | ^
* | +----+ |
* +--->| a2 |---+
* +----+
*/
public void testSingleEndAfterParallelJoin() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("fork").endActivity().createActivity("fork").behavior(new ParallelGateway()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("a1").transition("a2").endActivity().createActivity("a1").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("join").endActivity().createActivity("a2").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("join").endActivity().createActivity("join").behavior(new ParallelGateway()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("end").endActivity().createActivity("end").behavior(new End()).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
verifier.assertNonCompletingActivityInstance("start", 1);
verifier.assertNonCompletingActivityInstance("fork", 1);
verifier.assertNonCompletingActivityInstance("a1", 1);
verifier.assertNonCompletingActivityInstance("a2", 1);
verifier.assertNonCompletingActivityInstance("join", 2);
verifier.assertIsCompletingActivityInstance("end", 1);
}
use of org.camunda.bpm.engine.impl.pvm.PvmProcessInstance in project camunda-bpm-platform by camunda.
the class PvmActivityInstanceCompleteTest method testSimpleSubProcess.
/**
* +-------------------------------+
* | embeddedsubprocess |
* | |
* +-----+ | +-----------+ +---------+ | +---+
* |start|-->| |startInside|-->|endInside| |-->|end|
* +-----+ | +-----------+ +---------+ | +---+
* | |
* | |
* +-------------------------------+
*/
public void testSimpleSubProcess() {
ActivityInstanceVerification verifier = new ActivityInstanceVerification();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder().createActivity("start").initial().behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("embeddedsubprocess").endActivity().createActivity("embeddedsubprocess").scope().behavior(new EmbeddedSubProcess()).executionListener(ExecutionListener.EVENTNAME_END, verifier).createActivity("startInside").behavior(new Automatic()).executionListener(ExecutionListener.EVENTNAME_END, verifier).transition("endInside").endActivity().createActivity("endInside").behavior(new End()).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().transition("end").endActivity().createActivity("end").behavior(new End()).executionListener(ExecutionListener.EVENTNAME_END, verifier).endActivity().buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
verifier.assertNonCompletingActivityInstance("start", 1);
verifier.assertNonCompletingActivityInstance("embeddedsubprocess", 1);
verifier.assertNonCompletingActivityInstance("startInside", 1);
verifier.assertIsCompletingActivityInstance("endInside", 1);
verifier.assertIsCompletingActivityInstance("end", 1);
}
Aggregations