In multiple scenarios it is useful to query WorkflowInstances from the database based on whether or not their state is in one of the defined terminal states of the state machine definition.
As this is used in multiple places, and it is always possible that the state machine definition could have another terminal state added in the future, a const object was created that can be used in the where clause of a query against the WorkflowInstances table. Any future additions of a terminal state can add to the object, rather than having to manually go through and change every query against the WorkflowInstances table.
In multiple scenarios it is useful to query
WorkflowInstances
from the database based on whether or not their state is in one of the defined terminal states of the state machine definition.As this is used in multiple places, and it is always possible that the state machine definition could have another terminal state added in the future, a
const
object was created that can be used in thewhere
clause of a query against theWorkflowInstances
table. Any future additions of a terminal state can add to the object, rather than having to manually go through and change every query against theWorkflowInstances
table.