Beispiel #1
0
        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);
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
 public async Task CreateNew(string requestId, string workflowName, string sourceEmailAddress, int expiresInDays)
 {
     var workFlow = WorkflowFactory.CreateNewWorkflow(workflowName, sourceEmailAddress, requestId, expiresInDays);
     await _workflowDataService.SaveWorkflowAsync(workFlow);
 }