コード例 #1
0
 public Transition(EventDescription transitionEvent, CommandDescription sourceCommand, CommandDescription targetCommand, string conditionForTransition)
 {
     TransitionEvent        = transitionEvent;
     SourceCommand          = sourceCommand;
     TargetCommand          = targetCommand;
     ConditionForTransition = conditionForTransition;
 }
コード例 #2
0
        public List <Transition> GetActivityDiagram(FlatFlow flatFlow, bool everyEventHasAnIssuer)
        {
            List <Transition>  allTransitions = new List <Transition>();
            CommandDescription initialCommand = new CommandDescription(null, "Start of flow");

            var initialEvent = flatFlow.EventToCommands.First(e => e.Key.FlowEvent == typeof(OnStart)).Key;

            allTransitions.AddRange(GetTransitions(flatFlow, new SourceOfEvent(initialCommand, null), initialEvent));

            var restOfTheEvents = flatFlow.EventToCommands
                                  .Where(eventToCommand => eventToCommand.Key != initialEvent)
                                  .Select(eventToCommand => eventToCommand.Key)
                                  .Distinct();

            foreach (var flowEvent in restOfTheEvents)
            {
                IEnumerable <SourceOfEvent> sourcesOfEvents;

                sourcesOfEvents = GetSourceOfEvents(flatFlow, flowEvent, everyEventHasAnIssuer);

                foreach (var sourceOfEvent in sourcesOfEvents)
                {
                    allTransitions.AddRange(GetTransitions(flatFlow, sourceOfEvent, flowEvent));
                }
            }

            return(allTransitions);
        }
コード例 #3
0
        public SourceOfEvent(CommandDescription command, MayRaiseAttribute mayRaiseAttribute)
        {
            Command = command;

            if (mayRaiseAttribute != null)
            {
                ConditionOfRaise = mayRaiseAttribute.Condition;
                ExtraMessage     = mayRaiseAttribute.ExtraMessage;
            }
        }