/// <summary> /// Sets the event stream mediator to handle actions against this data /// </summary> /// <remarks> /// Normally you'd use the constructor to specify this, but in situations where the mediator isn't know at object /// creation, this method can be used to set it at a later point. /// This isn't a property to avoid it from being serialized to TDDS. /// </remarks> /// <param name="eventStreamMediator">BAM Mediator</param> public virtual void SetEventStreamMediator(IEventStreamMediator eventStreamMediator) { if (eventStreamMediator == null) { throw new ArgumentNullException("eventStreamMediator"); } this._eventStream = eventStreamMediator; }
/// <summary> /// Creates a new instance of your activity with the provided event stream underpinning it. One of the other methods might be more useful. /// </summary> /// <remarks> /// Due to the complex dependencies for the OrchestrationEventStream, there isn't a factory method for that, but you can pass a /// <see cref="Ox.BizTalk.BAM.OrchestrationEventStreamWrapper"/> into this method. /// </remarks> /// <typeparam name="TActivity">Your activity</typeparam> /// <param name="eventStreamMediator">Desired event stream mediator</param> /// <param name="activityId"></param> /// <returns>New instance of your activity with id and event stream setup</returns> public static TActivity NewActivity <TActivity>(IEventStreamMediator eventStreamMediator, string activityId = null) where TActivity : ActivityBase, new() { CheckActivityId(ref activityId); TActivity activity = new TActivity(); InitialiseActivity(activity, eventStreamMediator, activityId); return(activity); }
/// <summary> /// Creates a new instance of your activity with the provided event stream underpinning it. One of the other methods might be more useful. /// </summary> /// <remarks> /// Due to the complex dependencies for the OrchestrationEventStream, there isn't a factory method for that, but you can pass a /// <see cref="Ox.BizTalk.BAM.OrchestrationEventStreamWrapper"/> into this method. /// </remarks> /// <param name="activityType">Your activity</typeparam> /// <param name="eventStreamMediator">Desired event stream mediator</param> /// <param name="activityId"></param> /// <returns>New instance of your activity with id and event stream setup</returns> public static object NewActivity(Type activityType, IEventStreamMediator eventStreamMediator, string activityId = null) { if (!typeof(ActivityBase).IsAssignableFrom(activityType)) { throw new ArgumentException("Supplied type must be derived from ActivityBase."); } CheckActivityId(ref activityId); ActivityBase activity = (ActivityBase)Activator.CreateInstance(activityType); InitialiseActivity(activity, eventStreamMediator, activityId); return(activity); }
public TestActivity(IEventStreamMediator mediator, string activityId) : base(mediator, activityId) { }
public TestActivity(IEventStreamMediator mediator) : base(mediator) { }
public ActivityBase(IEventStreamMediator eventStreamMediator, string activityId) : this(activityId) { this.SetEventStreamMediator(eventStreamMediator); }
public ActivityBase(IEventStreamMediator eventStreamMediator) : this(eventStreamMediator, Guid.NewGuid().ToString()) { }
private static void InitialiseActivity(ActivityBase activity, IEventStreamMediator eventStreamMediator, string activityId) { activity.ActivityId = activityId; activity.SetEventStreamMediator(eventStreamMediator); }