bool TryRouteEvent() { var hasRoute = _routesByEvent.TryGetValue(_event, out var route); if (!_givensByEvent.TryGetValue(_event, out var given)) { given = new FlowMethodSet <FlowGiven>(); } FlowObservation observation; if (!_flow.IsTopic) { observation = new FlowObservation(_flow, _event, route, given); } else { if (!_whensByEvent.TryGetValue(_event, out var when)) { when = new FlowMethodSet <TopicWhen>(); } observation = new TopicObservation(_flow, _event, route, given, when); } _flow.Observations.Declare(observation); _event.Observations.Write.Add(observation); return(hasRoute); }
bool TryGetObservation(EventType type, out TopicObservation observation) { observation = _topicKey.Type.Observations.TryGet(type, out var baseObservation) ? (TopicObservation)baseObservation : null; return(observation != null); }
public When( TimelinePoint point, TopicObservation observation, IServiceProvider services, CancellationToken cancellationToken) : base(point, observation) { Services = services; CancellationToken = cancellationToken; }