public ActionResult Post(string workflowTypeName, [FromBody] WorkflowTypeFromBody value)
        {
            ActionResult result = null;

            try
            {
                JObject messageBodyJson      = null;
                JObject customPropertiesJson = null;

                if (value != null)
                {
                    messageBodyJson      = value.MessageBody;
                    customPropertiesJson = value.CustomProperties;
                }

                _orchestration.PublishWorkflowStep(workflowTypeName, Guid.NewGuid(), messageBodyJson, customPropertiesJson, null, true, false, 0, true,
                                                   null, "0");

                result = NoContent();
            }
            catch (Exception ex)
            {
                result = StatusCode(500, new { Error = ex.Message });
            }

            return(result);
        }
예제 #2
0
 private void PublishToQueue(Models.Queue currentQueue, QueueMetadata currentMetadata, QueueMetadata result, string runTask, bool workflowCompleted,
                             bool active)
 {
     if (result == null)
     {
         _orchestration.PublishWorkflowStep(currentQueue.Type.Name, currentQueue.WorkflowID, null, null,
                                            runTask, true, workflowCompleted, 0, active, runTask, null);
     }
     else
     {
         if (result.Success)
         {
             _orchestration.PublishWorkflowStep(currentQueue.Type.Name, currentQueue.WorkflowID, result.MessageBodyJson, result.CustomPropertiesJson,
                                                runTask, true, workflowCompleted, 0, active, runTask, result.SplitID);
         }
         else
         {
             _orchestration.PublishWorkflowStep(currentQueue.Type.Name, currentQueue.WorkflowID, currentMetadata.MessageBodyJson, result.CustomPropertiesJson,
                                                currentMetadata.StepIdentifier, false, workflowCompleted, currentMetadata.Retries + 1, active, runTask, currentMetadata.SplitID);
         }
     }
 }