示例#1
0
		public IEnumerable<TransitionDefinition> GetTimerTransitionForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = 0)
		{
			return this.Transitions.Where<TransitionDefinition>((TransitionDefinition t) => {
				if (t.From != activity || t.Trigger.Type != TriggerType.Timer)
				{
					return false;
				}
				return ProcessDefinition.ForkFilter(forkTransitionSearch, t);
			});
		}
示例#2
0
		public IEnumerable<TransitionDefinition> GetCommandTransitionForActivity(ActivityDefinition activity, string commandName, ForkTransitionSearchType forkTransitionSearch = 0)
		{
			return this.Transitions.Where<TransitionDefinition>((TransitionDefinition t) => {
				if (t.From != activity || t.Trigger.Type != TriggerType.Command || !(t.Trigger.Command.Name == commandName))
				{
					return false;
				}
				return ProcessDefinition.ForkFilter(forkTransitionSearch, t);
			});
		}
示例#3
0
		public IEnumerable<TransitionDefinition> GetPossibleTransitionsForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = 0)
		{
			return this.Transitions.Where<TransitionDefinition>((TransitionDefinition t) => {
				if (t.From != activity)
				{
					return false;
				}
				return ProcessDefinition.ForkFilter(forkTransitionSearch, t);
			});
		}
示例#4
0
		private static bool ForkFilter(ForkTransitionSearchType forkTransitionSearch, TransitionDefinition t)
		{
			if (forkTransitionSearch == ForkTransitionSearchType.Both || t.IsFork && forkTransitionSearch == ForkTransitionSearchType.Fork)
			{
				return true;
			}
			if (t.IsFork)
			{
				return false;
			}
			return forkTransitionSearch == ForkTransitionSearchType.NotFork;
		}