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); }
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); }
public static V1WorkflowInstanceCollectionState OnAddV1WorkflowInstance(V1WorkflowInstanceCollectionState state, AddV1WorkflowInstance action) { state.Add(action.WorkflowInstance); return(state); }
public static V1WorkflowInstanceCollectionState OnGetWorkflowsFromApiSucceeded(V1WorkflowInstanceCollectionState state, SetV1WorkflowInstanceCollection action) { return(new(action.WorkflowInstances)); }
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); }
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); }