CrumpetDev / crumpet

GNU Affero General Public License v3.0
18 stars 1 forks source link

Define conditional transitions using JSON #64

Open tomtitherington opened 4 months ago

tomtitherington commented 4 months ago

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 the TransitionSchema.condition field and then this serialization can be taken care of by the ModelViewSet.

Acceptance Criteria*

Dependencies

Blockers:

*required field.