Users should be able to define conditional transitions that will be evaluated before the transitions are called/executed. This means that users can create if statements/branches within their flows.
Goal*
We want to allow users to apply conditional logic and branching statements to their flows.
Implementation Details*
We need to first agree on the JSON schema/format for defining these conditions. I think we can use the SQL/JSON Path Language from Postgres. Here's a basic idea of how it could work.
Probably just best to create a custom JSONField for the TransitionSchema.condition field and then this serialization can be taken care of by the ModelViewSet.
Acceptance Criteria*
Post the agreed JSON schema as a comment here. (We'll use this in the documentation)
A REST API endpoint where a user can provide this definition for an associated TransitionSchema. This is okay if it's just on the ModelViewSet of the existing TransitionSchema view.
This endpoint will create a new instance or update an existing one if necessary.
Dependencies
Blockers:
An endpoint/view to update/create a TransitionSchema needs to exist before this work can be started.
Background & Context*
Users should be able to define conditional transitions that will be evaluated before the transitions are called/executed. This means that users can create if statements/branches within their flows.
Goal*
We want to allow users to apply conditional logic and branching statements to their flows.
Implementation Details*
We need to first agree on the JSON schema/format for defining these conditions. I think we can use the SQL/JSON Path Language from Postgres. Here's a basic idea of how it could work.
Probably just best to create a custom
JSONField
for theTransitionSchema.condition
field and then this serialization can be taken care of by theModelViewSet
.Acceptance Criteria*
TransitionSchema
. This is okay if it's just on theModelViewSet
of the existingTransitionSchema
view.Dependencies
Blockers:
TransitionSchema
needs to exist before this work can be started.*required field.