sillsdev / appbuilder-portal

Portal for Scriptoria -- App Publishing Service
MIT License
25 stars 5 forks source link

Create object to filter WorkflowInstances by terminal states #1031

Closed FyreByrd closed 4 weeks ago

FyreByrd commented 4 weeks ago

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.