Canceling actions
Actions in GGCE can be scheduled/pending, started or completed. We need a mechanism that allows users to cancel an action regardless of its state (instead of deleting it from the database).
A canceled action is an action that was started, but could not be executed for some reason (recorded in action.note
). Or it was scheduled, never started and will never start for some other reason. Canceled actions are completed in the sense that they don't need to be performed.
The implementation for canceling an action is the same as the one for completing an action: the completedDate
is set but we need a way to express that the action was not "done". isDone
is a new property of AbstractAction
:
@Column(name = "is_done", nullable = true, length = 1)
@Pattern("^Y|N") // ?
protected String isDone;
-
isDone == null
means the action is still scheduled or in progress, -
isDone == 'Y'
means that the action was completed, while -
isDone == 'N'
means that the action was canceled.
Changes
Listing completed actions must exclude those where isDone == 'N'
. All completed actions that are already in the database must have their isDone
set to Y
in liquibase, since they are all completed.
We need a new API endpoint to list canceled actions where completedDate.isNotNull().and(isDone.eq("N"))
so that we can display them in the UI.
UI
- Add a new tab for Canceled actions.
- Include field in action forms.
- If we have "complete selected actions" button, then we should also have "cancel selected actions" button.