/// <summary> /// This method /// </summary> /// <param name="scopeExecution"> </param> /// <param name="isLegacyBehaviorTurnedOff"> /// @return /// </param> protected internal static bool IsLegacyBehaviorRequired(IActivityExecution scopeExecution) { // legacy behavior is turned off: the current activity was parsed as scope. // now we need to check whether a scope execution was correctly created for the // event subprocess. // first create the mapping: var activityExecutionMapping = scopeExecution.CreateActivityExecutionMapping(); // if the scope execution for the current activity is the same as for the parent scope // -> we need to perform legacy behavior IPvmScope activity = scopeExecution.Activity; if (!activity.IsScope) { activity = activity.FlowScope; } return(activityExecutionMapping[(ScopeImpl)activity] == activityExecutionMapping[activity.FlowScope]); }
/// <summary> /// Collect all compensate event subscriptions for scope of given execution. /// </summary> public static IList <EventSubscriptionEntity> CollectCompensateEventSubscriptionsForScope( IActivityExecution execution) { var scopeExecutionMapping = execution.CreateActivityExecutionMapping(); var activity = (ScopeImpl)execution.Activity; // <LEGACY>: different flow scopes may have the same scope execution => // collect subscriptions in a set ISet <EventSubscriptionEntity> subscriptions = new HashSet <EventSubscriptionEntity>(); ITreeVisitor <ScopeImpl> eventSubscriptionCollector = new TreeVisitorAnonymousInnerClass(execution, scopeExecutionMapping, subscriptions); new FlowScopeWalker(activity).AddPostVisitor(eventSubscriptionCollector) .WalkUntil(element => { bool?flag = (bool?)element.GetProperty(BpmnParse.PropertynameConsumesCompensation); return(flag == null || flag == true); }); return(new List <EventSubscriptionEntity>(subscriptions)); }
public ActivityExecutionHierarchyWalker(IActivityExecution execution) : base(CreateTupel(execution)) { _activityExecutionMapping = execution.CreateActivityExecutionMapping(); }