Skip to content

Json Schemas for Data Input and Output

No due date 0% complete

Imagine having the ability to select a call activity process, then complete a form to specify what input to send to it. For instance, a call activity that handles "API calls to Slack". When you add it to the diagram, and click "configure" you get dropdown list of "Send" or "Read" and when you select send, you can select the channel you want to send to fro…

Imagine having the ability to select a call activity process, then complete a form to specify what input to send to it. For instance, a call activity that handles "API calls to Slack". When you add it to the diagram, and click "configure" you get dropdown list of "Send" or "Read" and when you select send, you can select the channel you want to send to from a known list.

We can do this by specifying a Json Schema on a Data Input object. Json Schemas on Workflow Data (data inputs, outputs, objects, stores) has the following benefits:

  • The json schema can be used to generate a form when adding a Call Activity to a process.
  • It can perform run-time validation so we get detailed errors back when the data supplied to a call activity is invalid
  • Testing Call Activities independently becomes far easier because we can just submit several different values into the form.

Example:

Alex writes: regarding the example for 'schemas on data inputs and outputs #1179', the example I showed during the meeting can be found here: https://dev.app.spiff.status.im/process-models/misc:service-tests:iplicit:maintain. As I briefly mentioned that current example allows you to select which Iplicit action, GET, DELETE, PATCH, etc., you are intending to use and for the Call Activities each would be a separate json schema for each Iplicit Category, i.e., Catalog, ContactAccount, Department, etc., instead of all being in one schema as they currently are found. This is part of the additional work that I mentioned at the beginning of the meeting and received Sasha and Marius' approval to work on as time allows. I have already start this work by breaking out the json schema for GET, which can be found here (https://dev.app.spiff.status.im/process-groups/misc:service-tests:iplicit:methods:contactaccount).

Loading