Exemplo n.º 1
0
        protected internal virtual IList <EventSubscriptionEntity> CollectEventSubscriptions(IActivityExecution execution)
        {
            var activityRef = CompensateEventDefinition.ActivityRef;

            if (!ReferenceEquals(activityRef, null))
            {
                return(CompensationUtil.CollectCompensateEventSubscriptionsForActivity(execution, activityRef));
            }
            return(CompensationUtil.CollectCompensateEventSubscriptionsForScope(execution));
        }
Exemplo n.º 2
0
        public override void Execute(IActivityExecution execution)
        {
            EnsureUtil.EnsureNotNull("Could not find cancel boundary event for cancel end event " + execution.Activity,
                                     "cancelBoundaryEvent", cancelBoundaryEvent);

            var compensateEventSubscriptions = CompensationUtil.CollectCompensateEventSubscriptionsForScope(execution);

            if (compensateEventSubscriptions.Count == 0)
            {
                Leave(execution);
            }
            else
            {
                CompensationUtil.ThrowCompensationEvent(compensateEventSubscriptions, execution, false);
            }
        }