예제 #1
0
        /// <summary>
        /// Collect all compensate event subscriptions for scope of given execution.
        /// </summary>
        public static IList <EventSubscriptionEntity> collectCompensateEventSubscriptionsForScope(ActivityExecution execution)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Map<org.camunda.bpm.engine.impl.pvm.process.ScopeImpl, org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl> scopeExecutionMapping = execution.createActivityExecutionMapping();
            IDictionary <ScopeImpl, PvmExecutionImpl> scopeExecutionMapping = execution.createActivityExecutionMapping();
            ScopeImpl activity = (ScopeImpl)execution.Activity;

            // <LEGACY>: different flow scopes may have the same scope execution =>
            // collect subscriptions in a set
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Set<org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity> subscriptions = new java.util.HashSet<org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity>();
            ISet <EventSubscriptionEntity> subscriptions = new HashSet <EventSubscriptionEntity>();
            TreeVisitor <ScopeImpl>        eventSubscriptionCollector = new TreeVisitorAnonymousInnerClass(execution, scopeExecutionMapping, subscriptions);

            (new FlowScopeWalker(activity)).addPostVisitor(eventSubscriptionCollector).walkUntil(new WalkConditionAnonymousInnerClass());

            return(new List <EventSubscriptionEntity>(subscriptions));
        }
예제 #2
0
        /// <summary>
        /// This method </summary>
        /// <param name="scopeExecution">
        /// @return </param>
        protected internal static bool isLegacyBehaviorRequired(ActivityExecution 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:
            IDictionary <ScopeImpl, PvmExecutionImpl> 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
            PvmScope activity = scopeExecution.Activity;

            if (!activity.Scope)
            {
                activity = activity.FlowScope;
            }
            return(activityExecutionMapping[activity] == activityExecutionMapping[activity.FlowScope]);
        }
예제 #3
0
 public ActivityExecutionHierarchyWalker(ActivityExecution execution) : base(createTupel(execution))
 {
     activityExecutionMapping = execution.createActivityExecutionMapping();
 }