Example #1
0
 public static TransitionDefinition Create(string name, string clasifier, ActivityDefinition from, ActivityDefinition to, TriggerDefinition trigger, ConditionDefinition condition)
 {
     TransitionClassifier parsedClassifier;
     Enum.TryParse(clasifier, true, out parsedClassifier);
     return new TransitionDefinition()
                {
                    Name = name,
                    To = to,
                    From = from,
                    Classifier = parsedClassifier,
                    Condition = condition ?? ConditionDefinition.Always,
                    Trigger = trigger ?? TriggerDefinition.Auto,
                    RestrictionsList = new List<RestrictionDefinition>(),
                    OnErrorsList = new List<OnErrorDefinition>()
                };
 }
Example #2
0
		public static TransitionDefinition Create(string name, string clasifier, string allowRestrictionsConcatenationType, string denyRestrictionsConcatenationType, string conditionsConcatenationType, string isFork, string mergeViaSetState, string disableParentStateControl, ActivityDefinition from, ActivityDefinition to, TriggerDefinition trigger, List<ConditionDefinition> conditions)
		{
			TransitionClassifier transitionClassifier;
			Enum.TryParse<TransitionClassifier>(clasifier, true, out transitionClassifier);
			TransitionDefinition transitionDefinition = new TransitionDefinition()
			{
				Name = name,
				To = to,
				From = from,
				Classifier = transitionClassifier,
				Conditions = conditions ?? new List<ConditionDefinition>()
				{
					ConditionDefinition.Always
				},
				Trigger = trigger ?? TriggerDefinition.Auto,
				Restrictions = new List<RestrictionDefinition>(),
				IsFork = (string.IsNullOrEmpty(isFork) ? false : bool.Parse(isFork)),
				MergeViaSetState = (string.IsNullOrEmpty(mergeViaSetState) ? false : bool.Parse(mergeViaSetState)),
				DisableParentStateControl = (string.IsNullOrEmpty(disableParentStateControl) ? false : bool.Parse(disableParentStateControl)),
				AllowConcatenationType = (string.IsNullOrEmpty(allowRestrictionsConcatenationType) ? ConcatenationType.And : (ConcatenationType)Enum.Parse(typeof(ConcatenationType), allowRestrictionsConcatenationType, true)),
				RestrictConcatenationType = (string.IsNullOrEmpty(denyRestrictionsConcatenationType) ? ConcatenationType.And : (ConcatenationType)Enum.Parse(typeof(ConcatenationType), denyRestrictionsConcatenationType, true)),
				ConditionsConcatenationType = (string.IsNullOrEmpty(conditionsConcatenationType) ? ConcatenationType.And : (ConcatenationType)Enum.Parse(typeof(ConcatenationType), conditionsConcatenationType, true))
			};
			return transitionDefinition;
		}
Example #3
0
        public static TransitionDefinition Create(string name, string clasifier, ActivityDefinition from, ActivityDefinition to, TriggerDefinition trigger, ConditionDefinition condition)
        {
            TransitionClassifier parsedClassifier;

            Enum.TryParse(clasifier, true, out parsedClassifier);
            return(new TransitionDefinition()
            {
                Name = name,
                To = to,
                From = from,
                Classifier = parsedClassifier,
                Condition = condition ?? ConditionDefinition.Always,
                Trigger = trigger ?? TriggerDefinition.Auto,
                RestrictionsList = new List <RestrictionDefinition>(),
                OnErrorsList = new List <OnErrorDefinition>()
            });
        }