/// <summary> /// Initializes a new instance of the <see cref="EngineService"/> class. /// </summary> /// <param name="workflowEngineFactory">The workflow engine factory.</param> /// <param name="workflowStoreFactory">The workflow store factory.</param> /// <param name="marainServicesTenancy">The tenancy services.</param> public EngineService( ITenantedWorkflowEngineFactory workflowEngineFactory, ITenantedWorkflowStoreFactory workflowStoreFactory, IMarainServicesTenancy marainServicesTenancy) { this.workflowEngineFactory = workflowEngineFactory; this.marainServicesTenancy = marainServicesTenancy; this.workflowStoreFactory = workflowStoreFactory; }
/// <summary> /// Initializes a new instance of the <see cref="GetWorkflowInstanceCountActivity"/> class. /// </summary> /// <param name="workflowEngineFactory">The factory class for the workflow engine.</param> /// <param name="serializerSettingsProvider">The serialization settings provider.</param> /// <param name="client">The client for the workflow engine.</param> public ProcessTriggerActivity( ITenantedWorkflowEngineFactory workflowEngineFactory, IJsonSerializerSettingsProvider serializerSettingsProvider, IMarainWorkflowEngine client) { this.workflowEngineFactory = workflowEngineFactory; this.client = client; this.serializerSettingsProvider = serializerSettingsProvider; }
public async Task WhenICreateANewInstanceCalledOfTheWorkflowWithId( string instanceId, string workflowId, Table table) { var context = table.Rows.ToDictionary(x => x["Key"], x => x["Value"]); ITenantedWorkflowEngineFactory engineFactory = ContainerBindings.GetServiceProvider(this.featureContext).GetService <ITenantedWorkflowEngineFactory>(); ITenantProvider tenantProvider = ContainerBindings.GetServiceProvider(this.featureContext).GetService <ITenantProvider>(); IWorkflowEngine engine = await engineFactory.GetWorkflowEngineAsync(tenantProvider.Root).ConfigureAwait(false); await engine.StartWorkflowInstanceAsync(new StartWorkflowInstanceRequest { Context = context, WorkflowId = workflowId, WorkflowInstanceId = instanceId }).ConfigureAwait(false); }
/// <summary> /// Initializes a new instance of the <see cref="InMemoryWorkflowMessageQueue" /> class. /// </summary> /// <param name="workflowEngineFactory"> /// The workflow engine factory to create the engine to which to hand off the triggers. /// </param> /// <param name="workflowInstanceStoreFactory"> /// The workflow instance store factory to use to access underlying instance storage. /// </param> /// <param name="tenantProvider"> /// The tenant provider that will be used when accessing storage. /// </param> /// <param name="propertyBagFactory"> /// The <see cref="IPropertyBagFactory"/> that will be used when creating new /// <see cref="WorkflowMessageEnvelope"/> instances. /// </param> /// <param name="logger"> /// Logger to use to write diagnostic messages. /// </param> /// <remarks> /// <para> /// The queue will be created in the "Stopped" state. To begin processing, /// call the <see cref="StartProcessing" /> method. /// </para> /// </remarks> public InMemoryWorkflowMessageQueue( ITenantedWorkflowEngineFactory workflowEngineFactory, ITenantedWorkflowInstanceStoreFactory workflowInstanceStoreFactory, ITenantProvider tenantProvider, IPropertyBagFactory propertyBagFactory, ILogger <InMemoryWorkflowMessageQueue> logger) { this.logger = logger; this.tenantProvider = tenantProvider; this.workflowEngineFactory = workflowEngineFactory; this.queue = new ConcurrentQueue <WorkflowMessageEnvelope>(); this.workflowInstanceStoreFactory = workflowInstanceStoreFactory; this.propertyBagFactory = propertyBagFactory; }
public async Task GivenIHaveStartedAnInstanceOfTheWorkflowWithInstanceIdAndUsingContextObject(string workflowId, string instanceId, string contextInstanceName) { ITenantedWorkflowEngineFactory engineFactory = this.serviceProvider.GetRequiredService <ITenantedWorkflowEngineFactory>(); IWorkflowEngine engine = await engineFactory.GetWorkflowEngineAsync(this.transientTenantManager.PrimaryTransientClient).ConfigureAwait(false); IDictionary <string, string> context = this.scenarioContext.Get <IDictionary <string, string> >(contextInstanceName); var request = new StartWorkflowInstanceRequest { WorkflowId = workflowId, WorkflowInstanceId = instanceId, Context = context, }; await engine.StartWorkflowInstanceAsync(request).ConfigureAwait(false); }