use of org.camunda.bpm.engine.impl.bpmn.behavior.ReceiveTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class LegacyBehavior method removeLegacySubscriptionOnParent.
/**
* <p>Required for migrating active sequential MI receive tasks. These activities were formerly not scope,
* but are now. This has the following implications:
*
* <p>Before migration:
* <ul><li> the event subscription is attached to the miBody scope execution</ul>
*
* <p>After migration:
* <ul><li> a new subscription is created for every instance
* <li> the new subscription is attached to a dedicated scope execution as a child of the miBody scope
* execution</ul>
*
* <p>Thus, this method removes the subscription on the miBody scope
*/
public static void removeLegacySubscriptionOnParent(ExecutionEntity execution, EventSubscriptionEntity eventSubscription) {
ActivityImpl activity = execution.getActivity();
if (activity == null) {
return;
}
ActivityBehavior behavior = activity.getActivityBehavior();
ActivityBehavior parentBehavior = (ActivityBehavior) (activity.getFlowScope() != null ? activity.getFlowScope().getActivityBehavior() : null);
if (behavior instanceof ReceiveTaskActivityBehavior && parentBehavior instanceof MultiInstanceActivityBehavior) {
List<EventSubscriptionEntity> parentSubscriptions = execution.getParent().getEventSubscriptions();
for (EventSubscriptionEntity subscription : parentSubscriptions) {
// distinguish a boundary event on the mi body with the same message name from the receive task subscription
if (areEqualEventSubscriptions(subscription, eventSubscription)) {
subscription.delete();
}
}
}
}
use of org.camunda.bpm.engine.impl.bpmn.behavior.ReceiveTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class LegacyBehavior method wasNoScope72.
protected static boolean wasNoScope72(ActivityImpl activity) {
ActivityBehavior activityBehavior = activity.getActivityBehavior();
ActivityBehavior parentActivityBehavior = (ActivityBehavior) (activity.getFlowScope() != null ? activity.getFlowScope().getActivityBehavior() : null);
return (activityBehavior instanceof EventSubProcessActivityBehavior) || (activityBehavior instanceof SubProcessActivityBehavior && parentActivityBehavior instanceof SequentialMultiInstanceActivityBehavior) || (activityBehavior instanceof ReceiveTaskActivityBehavior && parentActivityBehavior instanceof MultiInstanceActivityBehavior);
}
Aggregations