コード例 #1
0
        private void Handle(OnPartEvtConsumedEvent evt)
        {
            var source = GetChild(evt.SourceElementId);
            var target = GetCasePlanItem(evt.ElementId);

            Consume(source.EltId, target.EntryCriterions, evt);
            Consume(source.EltId, target.ExitCriterions, evt);
        }
コード例 #2
0
        private void Consume(string sourceEltId, ICollection <Criteria> criterias, OnPartEvtConsumedEvent evt)
        {
            var parts = GetOnParts(sourceEltId, criterias, evt.Transitions);

            foreach (var part in parts)
            {
                var transition = evt.Transitions.FirstOrDefault(tr => tr.Transition == part.StandardEvent);
                part.Consume(transition.IncomingTokens);
            }
        }
コード例 #3
0
        public void ConsumeTransitionEvts(BaseCaseEltInstance node, string sourceElementId, ICollection <IncomingTransition> transitions)
        {
            var source  = GetChild(sourceElementId);
            var target  = GetCasePlanItem(node.Id);
            var onParts = new List <IOnPart>();

            onParts.AddRange(GetOnParts(source.EltId, target.EntryCriterions, transitions));
            onParts.AddRange(GetOnParts(source.EltId, target.ExitCriterions, transitions));
            if (!onParts.Any())
            {
                return;
            }

            var evt = new OnPartEvtConsumedEvent(Guid.NewGuid().ToString(), AggregateId, Version + 1, node.Id, sourceElementId, transitions);

            Handle(evt);
            DomainEvents.Add(evt);
        }