Пример #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);
        }
Пример #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);
        }
Пример #3
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);
        }
Пример #4
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);
        }