Esempio n. 1
0
        public static V1WorkflowInstanceCollectionState OnRemoveV1WorkflowInstance(V1WorkflowInstanceCollectionState state, RemoveV1WorkflowInstance action)
        {
            var instance = state.FirstOrDefault(i => i.Id == action.Id);

            if (instance != null)
            {
                state.Remove(instance);
            }
            return(state);
        }
Esempio n. 2
0
        public static V1WorkflowInstanceCollectionState OnMarkV1WorkflowInstanceAsSuspended(V1WorkflowInstanceCollectionState state, MarkV1WorkflowInstanceAsSuspended action)
        {
            var instance = state.FirstOrDefault(i => i.Id == action.Id);

            if (instance != null)
            {
                instance.LastModified = action.SuspendedAt;
                instance.Status       = V1WorkflowInstanceStatus.Suspended;
            }
            return(state);
        }
Esempio n. 3
0
 public static V1WorkflowInstanceCollectionState OnAddV1WorkflowInstance(V1WorkflowInstanceCollectionState state, AddV1WorkflowInstance action)
 {
     state.Add(action.WorkflowInstance);
     return(state);
 }
Esempio n. 4
0
 public static V1WorkflowInstanceCollectionState OnGetWorkflowsFromApiSucceeded(V1WorkflowInstanceCollectionState state, SetV1WorkflowInstanceCollection action)
 {
     return(new(action.WorkflowInstances));
 }
Esempio n. 5
0
        public static V1WorkflowInstanceCollectionState OnMarkV1WorkflowInstanceAsCompleted(V1WorkflowInstanceCollectionState state, MarkV1WorkflowAsCompleted action)
        {
            var instance = state.FirstOrDefault(i => i.Id == action.Id);

            if (instance != null)
            {
                instance.LastModified = action.CompletedAt;
                instance.ExecutedAt   = action.CompletedAt;
                instance.Status       = V1WorkflowInstanceStatus.Completed;
                instance.Output       = action.Output;
            }
            return(state);
        }
Esempio n. 6
0
        public static V1WorkflowInstanceCollectionState OnMarkV1WorkflowInstanceAsCancelling(V1WorkflowInstanceCollectionState state, MarkV1WorkflowInstanceAsCancelling action)
        {
            var instance = state.FirstOrDefault(i => i.Id == action.Id);

            if (instance != null)
            {
                instance.LastModified = action.CancellingAt;
                instance.Status       = V1WorkflowInstanceStatus.Cancelling;
            }
            return(state);
        }