Enumerations
Last updated
Last updated
Enumerations can be used in models to limit the possible values a workflow designer can assign to a member of a model.
Consider for instance an API for 'orders' in a 'store'. We got the operations 'Add new order', 'Update order' and 'Delete order'. Let's look at the 'Order' model:
'status' is of type 'Enum':
And if we look at that enum you can see what possible values that member can have:
Members of the enum can be added and deleted as needed (circled area above). Let's look at an operation using the 'Order' model, 'Update order'
It uses 'PATCH' to only update certain members, accepting a body of model 'Order'. Let's look how this will look in Flow Studio:
When using 'Constant' as mapping to 'status' only the members of the enum are available. You can still mess it up by selecting 'Variable' as mapping and providing an invalid value in the passed variable. But with the usage of enums you can at least guide the person using the connector in Flow Studio in what kind of values are expected.