use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class EventBasedGatewayActivityBehavior method execute.
@Override
public void execute(ActivityExecution execution) throws Exception {
// If conditional events exist after the event based gateway they should be evaluated.
// If a condition is satisfied the event based gateway should be left,
// otherwise the event based gateway is a wait state
ActivityImpl eventBasedGateway = (ActivityImpl) execution.getActivity();
for (ActivityImpl act : eventBasedGateway.getEventActivities()) {
ActivityBehavior activityBehavior = act.getActivityBehavior();
if (activityBehavior instanceof ConditionalEventBehavior) {
ConditionalEventBehavior conditionalEventBehavior = (ConditionalEventBehavior) activityBehavior;
ConditionalEventDefinition conditionalEventDefinition = conditionalEventBehavior.getConditionalEventDefinition();
if (conditionalEventDefinition.tryEvaluate(execution)) {
((ExecutionEntity) execution).executeEventHandlerActivity(conditionalEventDefinition.getConditionalActivity());
return;
}
}
}
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class EventSubProcessStartConditionalEventActivityBehavior method leaveOnSatisfiedCondition.
@Override
public void leaveOnSatisfiedCondition(final EventSubscriptionEntity eventSubscription, final VariableEvent variableEvent) {
PvmExecutionImpl execution = eventSubscription.getExecution();
if (execution != null && !execution.isEnded() && execution.isScope() && conditionalEvent.tryEvaluate(variableEvent, execution)) {
ActivityImpl activity = eventSubscription.getActivity();
activity = (ActivityImpl) activity.getFlowScope();
execution.executeEventHandlerActivity(activity);
}
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class EventSubscriptionDeclaration method createSubscriptionForExecution.
/**
* Creates and inserts a subscription entity depending on the message type of this declaration.
*/
public EventSubscriptionEntity createSubscriptionForExecution(ExecutionEntity execution) {
EventSubscriptionEntity eventSubscriptionEntity = new EventSubscriptionEntity(execution, eventType);
String eventName = resolveExpressionOfEventName(execution);
eventSubscriptionEntity.setEventName(eventName);
if (activityId != null) {
ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId);
eventSubscriptionEntity.setActivity(activity);
}
eventSubscriptionEntity.insert();
LegacyBehavior.removeLegacySubscriptionOnParent(execution, eventSubscriptionEntity);
return eventSubscriptionEntity;
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class DefaultFailedJobParseListener method parseActivity.
protected void parseActivity(Element element, ActivityImpl activity) {
if (isMultiInstance(activity)) {
// in case of multi-instance, the extension elements is set according to the async attributes
// the extension for multi-instance body is set on the element of the activity
ActivityImpl miBody = activity.getParentFlowScopeActivity();
if (isAsync(miBody)) {
setFailedJobRetryTimeCycleValue(element, miBody);
}
// the extension for inner activity is set on the multiInstanceLoopCharacteristics element
if (isAsync(activity)) {
Element multiInstanceLoopCharacteristics = element.element(MULTI_INSTANCE_LOOP_CHARACTERISTICS);
setFailedJobRetryTimeCycleValue(multiInstanceLoopCharacteristics, activity);
}
} else if (isAsync(activity)) {
setFailedJobRetryTimeCycleValue(element, activity);
}
}
Aggregations