예제 #1
0
        private async Task AddWorkflowToStore(string workflowName, string workflowId, WorkflowEventSubscription[] subscriptions)
        {
            Workflow workflow = TestWorkflowFactory.Get(workflowName);

            workflow.WorkflowEventSubscriptions = subscriptions;
            workflow.Id = workflowId;

            ITenantedWorkflowStoreFactory storeFactory = this.serviceProvider.GetRequiredService <ITenantedWorkflowStoreFactory>();
            IWorkflowStore store = await storeFactory.GetWorkflowStoreForTenantAsync(
                this.transientTenantManager.PrimaryTransientClient).ConfigureAwait(false);

            try
            {
                await store.UpsertWorkflowAsync(workflow).ConfigureAwait(false);
            }
            catch (WorkflowConflictException)
            {
                // The workflow already exists. Move on.
            }

            // Get the workflow so we have the correct etag.
            workflow = await store.GetWorkflowAsync(workflow.Id).ConfigureAwait(false);

            this.scenarioContext.Set(workflow, workflowName);
        }
예제 #2
0
        public void GivenIHaveAnInstanceOfTheWorkflowWithId(string workflowName, string workflowId)
        {
            Workflow workflow = TestWorkflowFactory.Get(workflowName);

            workflow.Id = workflowId;

            this.scenarioContext.Set(workflow, workflowName);
        }