Exemple #1
0
        private StepRelation CreateDependencyAsStepRelation(ProjectItem projectItem,
                                                            ActivityModel formerModel)
        {
            var data = new StepRelationDataHolder();

            data.Accessibility = "Private";
            data.DrivenMode    = "Manual";
            data.DueOnRule     = ConvertDueOnRule(formerModel);

            if (EmpiriaString.IsBoolean(formerModel.DueOnRuleAppliesForAllContracts) &&
                !EmpiriaString.ToBoolean(formerModel.DueOnRuleAppliesForAllContracts))
            {
                data.ExecutionContext = ConvertExecutionContext(projectItem);
            }

            data.ExtensionData = ConvertRelationExtensionData(formerModel);

            data.FlowControl      = "Sequence";
            data.RelationKind     = "Dependency";
            data.SourceId         = projectItem.Id;
            data.TargetId         = formerModel.DueOnControllerId;
            data.WorkSequenceKind = "FinishToFinish";

            data.Save();

            return(StepRelation.Parse(data.UID));
        }
        static internal void WriteStepRelationData(StepRelationDataHolder o)
        {
            var op = DataOperation.Parse("writeSTPStepRelation", o.Id, o.UID, o.StepRelationType.Id,
                                         o.RelationKind, o.RelationName, o.Keywords, o.ExtensionData.ToString(),
                                         o.Constraints, o.ExecutionContext, o.DataModels, o.DueOnRule.ToString(),
                                         o.Accessibility, o.DrivenMode, o.FlowControl, o.WorkSequenceKind, o.RelationRole,
                                         o.SourceId, o.TargetId, o.RelationIndex, o.RelationInstanceId, o.DerivedFromRelationId,
                                         o.OwnerId, (char)o.Status, o.FromDate, o.ToDate);

            DataWriter.Execute(op);
        }