Exemplo n.º 1
0
        public static WorkflowTriggerInfo createForError(IEnumerable <string> errors)
        {
            var info = new WorkflowTriggerInfo();

            info.Errors = errors;

            return(info);
        }
Exemplo n.º 2
0
        public static WorkflowTriggerInfo createForSuccess(IEnumerable <string> triggers)
        {
            var info = new WorkflowTriggerInfo();

            info.Triggers = triggers;

            return(info);
        }
Exemplo n.º 3
0
        public static async Task <WorkflowTriggerInfo> ToWorkflowTriggerInfo(
            this IWorkflowEngineService workflowEngine,
            IWorkflow instance,
            TriggerResult result = null)
        {
            WorkflowTriggerInfo info;

            if (result == null || !result.HasErrors)
            {
                IEnumerable <TriggerResult> triggerResults = await workflowEngine.GetTriggersAsync(instance);

                var triggers = triggerResults.Select(x => x.TriggerName);
                info = WorkflowTriggerInfo.createForSuccess(triggers);
            }
            else
            {
                info = WorkflowTriggerInfo.createForError(result.Errors);
            }

            return(info);
        }
Exemplo n.º 4
0
 public WorkflowResult(WorkflowTriggerInfo info, TEntity entity, TViewModel viewModel)
 {
     TriggerInfo = info;
     Entity      = entity;
     ViewModel   = viewModel;
 }