Make workflow statuses more resilient (#12263)
Workflow statuses are often broken. I did not figured out why yet. But I see two causes that can be fixed: - statuses calculation are really complicated today, just to spare a call to the database - job is not indempotent, it is using the combination of the previous statuses + the update to calculate the new statuses. Which means that once broken, next updates will be broken as well Instead, we now: - fetch workflow versions - get the statuses from these. It simplifies the code and make the job indempotent.
This commit is contained in:
-19
@@ -1,19 +0,0 @@
|
||||
import { WorkflowStatus } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
|
||||
export const ACTIVE_AND_DRAFT_STATUSES = [
|
||||
WorkflowStatus.ACTIVE,
|
||||
WorkflowStatus.DRAFT,
|
||||
];
|
||||
|
||||
export const DEACTIVATED_AND_DRAFT_STATUSES = [
|
||||
WorkflowStatus.DEACTIVATED,
|
||||
WorkflowStatus.DRAFT,
|
||||
];
|
||||
|
||||
export const ACTIVE_STATUSES = [WorkflowStatus.ACTIVE];
|
||||
|
||||
export const DEACTIVATED_STATUSES = [WorkflowStatus.DEACTIVATED];
|
||||
|
||||
export const DRAFT_STATUSES = [WorkflowStatus.DRAFT];
|
||||
|
||||
export const NO_STATUSES = [];
|
||||
Reference in New Issue
Block a user