Пример #1
0
        private static CaseEltInstance BuildStage(string id, tStage stage, string casePlanInstanceId)
        {
            var planItems = BuildPlanItems(stage, casePlanInstanceId);
            var result    = new CaseEltInstance
            {
                Id    = CaseEltInstance.BuildId(casePlanInstanceId, stage.id, 0),
                Name  = stage.name,
                EltId = id,
                Type  = CasePlanElementInstanceTypes.STAGE
            };

            foreach (var planItem in planItems)
            {
                result.AddChild(planItem);
            }

            if (!result.ExitCriterions.Any() && stage.exitCriterion != null)
            {
                foreach (var exitCriteria in stage.exitCriterion)
                {
                    var sEntry = stage.sentry.First(s => s.id == exitCriteria.sentryRef);
                    result.AddExitCriteria(new Criteria(exitCriteria.name)
                    {
                        SEntry = BuildSEntry(sEntry)
                    });
                }
            }

            return(result);
        }
        protected override CaseEltInstance InternalBuild()
        {
            var result = new CaseEltInstance
            {
                Type = CasePlanElementInstanceTypes.STAGE
            };

            foreach (var builder in Builders)
            {
                result.AddChild(builder.Build());
            }

            return(result);
        }