Java Code Examples for org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity#getExecution()

The following examples show how to use org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity#getExecution() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompensationInstanceHandler.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Override
public void handle(MigratingInstanceParseContext parseContext, EventSubscriptionEntity element) {

  MigratingProcessElementInstance migratingInstance;
  if (element.getConfiguration() != null) {
    migratingInstance = createMigratingEventScopeInstance(parseContext, element);
  }
  else {
    migratingInstance = createMigratingEventSubscriptionInstance(parseContext, element);
  }


  ExecutionEntity owningExecution = element.getExecution();
  MigratingScopeInstance parentInstance = null;
  if (owningExecution.isEventScope()) {
    parentInstance = parseContext.getMigratingCompensationInstanceByExecutionId(owningExecution.getId());
  }
  else {
    parentInstance = parseContext.getMigratingActivityInstanceById(owningExecution.getParentActivityInstanceId());
  }
  migratingInstance.setParent(parentInstance);
}
 
Example 2
Source File: IntermediateConditionalEventBehavior.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Override
public void leaveOnSatisfiedCondition(final EventSubscriptionEntity eventSubscription, final VariableEvent variableEvent) {
  PvmExecutionImpl execution = eventSubscription.getExecution();

  if (execution != null && !execution.isEnded()
    && variableEvent != null
    && conditionalEvent.tryEvaluate(variableEvent, execution)
    && execution.isActive() && execution.isScope()) {
    if (isAfterEventBasedGateway) {
      final ActivityImpl activity = eventSubscription.getActivity();
      execution.executeEventHandlerActivity(activity);
    } else {
      leave(execution);
    }
  }
}
 
Example 3
Source File: BoundaryConditionalEventActivityBehavior.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Override
public void leaveOnSatisfiedCondition(final EventSubscriptionEntity eventSubscription, final VariableEvent variableEvent) {
  final PvmExecutionImpl execution = eventSubscription.getExecution();

  if (execution != null && !execution.isEnded() && execution.isScope()
      && conditionalEvent.tryEvaluate(variableEvent, execution)) {
    execution.executeEventHandlerActivity(eventSubscription.getActivity());
  }
}
 
Example 4
Source File: EventSubscriptionJobDeclaration.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected ExecutionEntity resolveExecution(EventSubscriptionEntity context) {
  return context.getExecution();
}
 
Example 5
Source File: SignalEventReceivedCmd.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
private boolean isActiveEventSubscription(EventSubscriptionEntity signalEventSubscriptionEntity) {
  ExecutionEntity execution = signalEventSubscriptionEntity.getExecution();
  return !execution.isEnded() && !execution.isCanceled();
}
 
Example 6
Source File: ThrowSignalEventActivityBehavior.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected boolean isActiveIntermediateEventSubscription(EventSubscriptionEntity signalEventSubscriptionEntity) {
  ExecutionEntity execution = signalEventSubscriptionEntity.getExecution();
  return execution != null && !execution.isEnded() && !execution.isCanceled();
}