public async Task <string> Get() { var workflow = await workflowRegistry.FindAsync(f => f.Name == "TestWorkFlow"); var instance = await workflowFactory.InstantiateAsync(workflow); await workflowInstanceStore.AddAsync(instance); await workflowInvoker.RunWorkflowAsync(workflow, instance); await workflowInstanceDispatcher.DispatchAsync(new ExecuteWorkflowInstanceRequest(instance.Id, "activity-start")); return(instance.Id); }
public async Task AddAsync(WorkflowInstance entity, CancellationToken cancellationToken = default) { await _store.AddAsync(entity, cancellationToken); await _mediator.Publish(new WorkflowInstanceSaved(entity), cancellationToken); }