コード例 #1
0
        private async Task VisitFlowNode(TFlowNode flowNode)
        {
            switch (flowNode)
            {
            case TStartEvent startEvent:
                await VisitStartEvent(startEvent);

                break;

            case TEndEvent endEvent:
                await VisitEndEvent(endEvent);

                break;

            case TParallelGateway parallelGateway:
                await VisitParallelGateway(parallelGateway);

                break;

            case TExclusiveGateway exclusiveGateway:
                await VisitExclusiveGateway(exclusiveGateway);

                break;

            case TInclusiveGateway inclusiveGateway:
                await VisitInclusiveGateway(inclusiveGateway);

                break;

            case TComplexGateway complexGateway:
                await VisitComplexGateway(complexGateway);

                break;

            case TEventBasedGateway eventBasedGateway:
                await VisitEventBasedGateway(eventBasedGateway);

                break;

            case TIntermediateThrowEvent intermediateThrowEvent:
                await VisitIntermediateThrowEvent(intermediateThrowEvent);

                break;

            case TIntermediateCatchEvent intermediateCatchEvent:
                await VisitIntermediateCatchEvent(intermediateCatchEvent);

                break;

            case TServiceTask serviceTask:
                await VisitServiceTask(serviceTask);

                break;

            case TScriptTask scriptTask:
                await VisitScriptTask(scriptTask);

                break;
            }
        }
コード例 #2
0
 private TBoundaryEvent[] GetBoundaryEvents <T>(TFlowNode flowNode)
 {
     return(FindElements <TBoundaryEvent>()
            .Where(x => x.AttachedToRef.Name == flowNode.Id)
            .Where(x => x.EventDefinition.OfType <T>().Any())
            .ToArray());
 }
コード例 #3
0
        private TFlowNode[] GetParallelOutgoingNodes(TFlowNode flowNode)
        {
            var sequences = FindByIds <TSequenceFlow>(flowNode.Outgoing.Select(x => x.Name))
                            .Where(EvaluateSequence)
                            .ToArray();

            return(FindByIds <TFlowNode>(sequences.Select(s => s.TargetRef)));
        }
コード例 #4
0
        private TFlowNode GetExclusiveOutgoingNode(TFlowNode flowNode)
        {
            var sequence = FindByIds <TSequenceFlow>(flowNode.Outgoing.Select(x => x.Name))
                           .Where(x => x.ConditionExpression != null)
                           .FirstOrDefault(EvaluateSequence);

            if (sequence != null)
            {
                return(FindById <TFlowNode>(sequence.TargetRef));
            }

            var defaultSequence = FindByIds <TSequenceFlow>(flowNode.Outgoing.Select(x => x.Name))
                                  .FirstOrDefault(x => x.ConditionExpression == null);

            if (defaultSequence == null)
            {
                throw new Exception("No applicable exclusive outgoing node");
            }

            return(FindById <TFlowNode>(defaultSequence.TargetRef));
        }
コード例 #5
0
        private TFlowNode[] GetInclusiveOutgoingNodes(TFlowNode flowNode)
        {
            var sequences = FindByIds <TSequenceFlow>(flowNode.Outgoing.Select(x => x.Name))
                            .Where(x => x.ConditionExpression != null)
                            .Where(EvaluateSequence)
                            .ToArray();

            if (sequences.Length > 0)
            {
                return(FindByIds <TFlowNode>(sequences.Select(s => s.TargetRef)));
            }

            var defaultSequence = FindByIds <TSequenceFlow>(flowNode.Outgoing.Select(x => x.Name))
                                  .FirstOrDefault(x => x.ConditionExpression == null);

            if (defaultSequence == null)
            {
                throw new Exception("No applicable invlusive outgoing node");
            }

            return(new TFlowNode[] {
                FindById <TFlowNode>(defaultSequence.TargetRef)
            });
        }
コード例 #6
0
 private int Hit(TFlowNode flowNode)
 {
     return(_nodeHits.AddOrUpdate(flowNode.Id, 1, (k, v) => v + 1));
 }