private static RunContext CreateContextForEvaluateArgument() { var factory = new WorkflowFactory <RunContext>(null, null) { Serializer = new PartialJsonWorkflowSerializer() }; var ev = new IncomingEvent() { Name = "evnt1", Uuid = Guid.NewGuid(), ExternalId = Guid.NewGuid().ToString(), EventDate = WorkflowClock.Now(), CreationDate = WorkflowClock.Now(), }; var wrk = factory.CreateNewWorkflow( "Test", 1, ev.ExternalId, new DynObject() ); RunContext ctx = new RunContext().Set(wrk, ev, factory); return(ctx); }
public async Task <IActionResult> Post([FromBody] CreateWorkflow createWorkflow) { try { var workFlow = WorkflowFactory.CreateNewWorkflow(createWorkflow.WorkflowName, createWorkflow.SourceEmailAddress, createWorkflow.RequestId, 30); await _workflowDataService.SaveWorkflowAsync(workFlow); return(Ok(createWorkflow)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task CreateNew(string requestId, string workflowName, string sourceEmailAddress, int expiresInDays) { var workFlow = WorkflowFactory.CreateNewWorkflow(workflowName, sourceEmailAddress, requestId, expiresInDays); await _workflowDataService.SaveWorkflowAsync(workFlow); }