/// <summary> /// Setup a generic host. /// </summary> /// <param name="setupConfigurator">The setup configurator.</param> /// <param name="config">The configuration.</param> public static void GenericHost(this ISetupContext setupConfigurator, Action <IGenericHostConfigurator> config) { var spec = new GenericHostSpecification(); config?.Invoke(spec); setupConfigurator.AddHostSpecification(spec); }
private RespondDecisionTaskCompletedRequest GetNextRequest(ISetupContext nextStep, WorkflowDecisionContext context, string nextInput) { // If we don't have anymore steps, complete the workflow if (nextStep == null) { return(CompleteWorkflow(context.Result)); } // Found another step if (nextStep.IsActivity()) { // Next step is an activity, set up a schedule activity decision var activity = ((WorkflowActivitySetupContext)nextStep).Clone(); activity.Input = nextInput; return(ScheduleActivityTask(activity)); } if (nextStep.IsTimer()) { // Next step is a timer, set up a start timer decision var timer = ((WorkflowTimerSetupContext)nextStep).Clone(); return(StartTimer(timer)); } // Next step is not an activity, set up a child workflow decision Debug.Assert(nextStep.IsWorkflow(), "Steps can only be activities, timers, or workflows."); var workflow = ((WorkflowSetupContext)nextStep).Clone(); workflow.Input = nextInput; return(StartChildWorkflowExecution(workflow)); }
/// <summary> /// Performs the setup. /// </summary> /// <param name="action">The action.</param> /// <param name="context">The context.</param> public void PerformSetup(Action <ISetupContext> action, ISetupContext context) { if (action != null) { _log.Information(string.Empty); _log.Information("----------------------------------------"); _log.Information("Setup"); _log.Information("----------------------------------------"); _log.Verbose("Executing custom setup action..."); action(context); } }
public CustomerOrderWorkflow() { WorkflowSteps = new ISetupContext[] { // An activity new WorkflowActivitySetupContext { ActivityName = "VerifyOrder", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" }, // Followed by a child workflow new WorkflowSetupContext { TagList = new List<string>(), WorkflowName = "VerifyCustomerWorkflow", WorkflowVersion = "1.0", WorkflowId = Guid.NewGuid().ToString(), Control = "", Input = "", ExecutionStartToCloseTimeout = "600", TaskList = "DeciderTaskList-Default", TaskStartToCloseTimeout = "60", ChildPolicy = "TERMINATE", }, // Followed by another activity new WorkflowActivitySetupContext { ActivityName = "ShipOrder", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" } }; }
public CustomerOrderWorkflow() { WorkflowSteps = new ISetupContext[] { // An activity new WorkflowActivitySetupContext { ActivityName = "VerifyOrder", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" }, // Followed by a child workflow new WorkflowSetupContext { TagList = new List <string>(), WorkflowName = "VerifyCustomerWorkflow", WorkflowVersion = "1.0", WorkflowId = Guid.NewGuid().ToString(), Control = "", Input = "", ExecutionStartToCloseTimeout = "600", TaskList = "DeciderTaskList-Default", TaskStartToCloseTimeout = "60", ChildPolicy = "TERMINATE", }, // Followed by another activity new WorkflowActivitySetupContext { ActivityName = "ShipOrder", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" } }; }
public VerifyCustomerWorkflow() { WorkflowSteps = new ISetupContext[] { new WorkflowActivitySetupContext { ActivityName = "VerifyCustomerAddress", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" }, new WorkflowActivitySetupContext { ActivityName = "CheckFraudDB", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" }, new WorkflowActivitySetupContext { ActivityName = "ChargeCreditCard", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" } }; }
public VerifyCustomerWorkflow() { WorkflowSteps = new ISetupContext[] { new WorkflowActivitySetupContext { ActivityName = "VerifyCustomerAddress", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" }, new WorkflowActivitySetupContext { ActivityName = "CheckFraudDB", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" }, new WorkflowActivitySetupContext { ActivityName = "ChargeCreditCard", ActivityVersion = "1.0", ActivityId = Guid.NewGuid().ToString(), Control = "", Input = "", ScheduleToCloseTimeout = "60", TaskList = "ActivityTaskList-Default", ScheduleToStartTimeout = "60", StartToCloseTimeout = "60", HeartbeatTimeout = "NONE" } }; }
/// <summary> /// Adds OAuth bearer token to wcf rest client requests. /// </summary> /// <param name="context"></param> /// <returns></returns> public static ISetupContext MakeWcfOAuthAware(this ISetupContext context) { ((IClaimsSetupContext)context).MakeOAuthAwareService(); return(context); }
public void PerformSetup(Action <ISetupContext> action, ISetupContext context) { action(context); }
/// <summary> /// Performs the setup. /// </summary> /// <param name="action">The action.</param> /// <param name="context">The setup context.</param> public void PerformSetup(Action <ISetupContext> action, ISetupContext context) { _default.PerformSetup(action, context); }
public virtual void Application_Start() { configContext = this.LoadBindingConfiguration <T>(); ConfigureAuth(); }
private RespondDecisionTaskCompletedRequest GetNextRequest(ISetupContext nextStep, WorkflowDecisionContext context, string nextInput) { // If we don't have anymore steps, complete the workflow if (nextStep == null) { return CompleteWorkflow(context.Result); } // Found another step if (nextStep.IsActivity()) { // Next step is an activity, set up a schedule activity decision var activity = ((WorkflowActivitySetupContext) nextStep).Clone(); activity.Input = nextInput; return ScheduleActivityTask(activity); } if (nextStep.IsTimer()) { // Next step is a timer, set up a start timer decision var timer = ((WorkflowTimerSetupContext) nextStep).Clone(); return StartTimer(timer); } // Next step is not an activity, set up a child workflow decision Debug.Assert(nextStep.IsWorkflow(), "Steps can only be activities, timers, or workflows."); var workflow = ((WorkflowSetupContext) nextStep).Clone(); workflow.Input = nextInput; return StartChildWorkflowExecution(workflow); }