Exemple #1
0
        public static StepTaskEntityBase CreateStepModelChain(IList <ISequenceStep> steps, SlaveContext context,
                                                              int sequenceIndex)
        {
            StepTaskEntityBase root = null;

            if (steps.Count == 0)
            {
                context.LogSession.Print(LogLevel.Debug, context.SessionId,
                                         $"Empty steps created for sequence {sequenceIndex}");
                return(StepTaskEntityBase.GetEmptyStepModel(context, sequenceIndex));
            }

            root          = StepTaskEntityBase.GetStepModel(steps[0], context, sequenceIndex);
            root.NextStep = null;
            StepTaskEntityBase lastNode    = root;
            StepTaskEntityBase currentNode = null;

            for (int i = 1; i < steps.Count; i++)
            {
                currentNode          = StepTaskEntityBase.GetStepModel(steps[i], context, sequenceIndex);
                lastNode.NextStep    = currentNode;
                lastNode             = currentNode;
                currentNode.NextStep = null;
            }
            return(root);
        }
Exemple #2
0
        public static StepTaskEntityBase CreateSubStepModelChain(IList <ISequenceStep> steps, SlaveContext context, int sequenceIndex)
        {
            StepTaskEntityBase root = null;

            if (steps.Count == 0)
            {
                return(root);
            }

            root          = StepTaskEntityBase.GetStepModel(steps[0], context, sequenceIndex);
            root.NextStep = null;
            StepTaskEntityBase lastNode    = root;
            StepTaskEntityBase currentNode = null;

            for (int i = 1; i < steps.Count; i++)
            {
                currentNode          = StepTaskEntityBase.GetStepModel(steps[i], context, sequenceIndex);
                lastNode.NextStep    = currentNode;
                lastNode             = currentNode;
                currentNode.NextStep = null;
            }
            return(root);
        }