Approve/Reject Buttons with Conditional Requiredness
See SAIL Recipes for information about how to work through recipes and adapt them to your application.
Present two buttons to the end user called "Approve" and "Reject" and only make the comments field required if the user clicks "Reject."
- This design pattern is not recommended for offline interfaces because the conditional requiredness of a field based on user interaction requires a connection to the server.
validationGroup can have any string that you define. See also: Using Validation Groups
Test it out
- Click "Reject" without entering any comments. Notice that the custom required message that we configured using the
requiredMessage parameter shows up rather than the generic product message.
- Click Approve without entering any comments.
To write your data to process
- Save your interface as sailRecipe
- Create interface inputs: comments (Text), hasApproved (Boolean)
- Remove the
- Delete local variables:
- In your expression, replace:
- In your process model, on the process start form or forms tab of an activity, enter the name of your interface in the search box and select it
- Click Yes when the process modeler asks, "Do you want to import the interface inputs?"
- On a task form, this will create create node inputs
- On a start form, this will create parameterized process variables