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); }); }
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); }); }
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); }); }
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; }