use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class ThrowEscalationEventActivityBehavior method executeEscalationHandler.
protected void executeEscalationHandler(EscalationEventDefinition escalationEventDefinition, ActivityExecutionMappingCollector activityExecutionMappingCollector) {
PvmActivity escalationHandler = escalationEventDefinition.getEscalationHandler();
PvmScope escalationScope = getScopeForEscalation(escalationEventDefinition);
ActivityExecution escalationExecution = activityExecutionMappingCollector.getExecutionForScope(escalationScope);
if (escalationEventDefinition.getEscalationCodeVariable() != null) {
escalationExecution.setVariable(escalationEventDefinition.getEscalationCodeVariable(), escalation.getEscalationCode());
}
escalationExecution.executeActivity(escalationHandler);
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class AbstractBpmnActivityBehavior method signalCompensationDone.
protected void signalCompensationDone(ActivityExecution execution) {
if (((PvmExecutionImpl) execution).getNonEventScopeExecutions().isEmpty()) {
if (execution.getParent() != null) {
ActivityExecution parent = execution.getParent();
execution.remove();
parent.signal(SIGNAL_COMPENSATION_DONE, null);
}
} else {
((ExecutionEntity) execution).forceUpdate();
}
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class CancelEndEventActivityBehavior method doLeave.
public void doLeave(ActivityExecution execution) {
// continue via the appropriate cancel boundary event
ScopeImpl eventScope = (ScopeImpl) cancelBoundaryEvent.getEventScope();
ActivityExecution boundaryEventScopeExecution = execution.findExecutionForFlowScope(eventScope);
boundaryEventScopeExecution.executeActivity(cancelBoundaryEvent);
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class InclusiveGatewayActivityBehavior method execute.
public void execute(ActivityExecution execution) throws Exception {
execution.inactivate();
lockConcurrentRoot(execution);
PvmActivity activity = execution.getActivity();
if (activatesGateway(execution, activity)) {
LOG.activityActivation(activity.getId());
List<ActivityExecution> joinedExecutions = execution.findInactiveConcurrentExecutions(activity);
String defaultSequenceFlow = (String) execution.getActivity().getProperty("default");
List<PvmTransition> transitionsToTake = new ArrayList<PvmTransition>();
// find matching non-default sequence flows
for (PvmTransition outgoingTransition : execution.getActivity().getOutgoingTransitions()) {
if (defaultSequenceFlow == null || !outgoingTransition.getId().equals(defaultSequenceFlow)) {
Condition condition = (Condition) outgoingTransition.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
if (condition == null || condition.evaluate(execution)) {
transitionsToTake.add(outgoingTransition);
}
}
}
// if none found, add default flow
if (transitionsToTake.isEmpty()) {
if (defaultSequenceFlow != null) {
PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);
if (defaultTransition == null) {
throw LOG.missingDefaultFlowException(execution.getActivity().getId(), defaultSequenceFlow);
}
transitionsToTake.add(defaultTransition);
} else {
// No sequence flow could be found, not even a default one
throw LOG.stuckExecutionException(execution.getActivity().getId());
}
}
// take the flows found
execution.leaveActivityViaTransitions(transitionsToTake, joinedExecutions);
} else {
LOG.noActivityActivation(activity.getId());
}
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class InclusiveGatewayActivityBehavior method getLeafExecutions.
protected Collection<ActivityExecution> getLeafExecutions(ActivityExecution parent) {
List<ActivityExecution> executionlist = new ArrayList<ActivityExecution>();
List<? extends ActivityExecution> subExecutions = parent.getNonEventScopeExecutions();
if (subExecutions.size() == 0) {
executionlist.add(parent);
} else {
for (ActivityExecution concurrentExecution : subExecutions) {
executionlist.addAll(getLeafExecutions(concurrentExecution));
}
}
return executionlist;
}
Aggregations