Closed end2endzone closed 2 years ago
Another alternative solution would be to implement a <fail />
action.
The action could have multiple different attributes to fail the action based on different criteria.
To get a confirmation message before proceeding, one could do something like :
<prompt type="yesno" name="proceed" title="Are you sure you want to proceed with the operation?"
valueyes="true" valueno="false" />
<fail iffalse="${proceed}" />
<exec path="..." />
The above example would fail since the property proceed
is set to false
when one answer "no" the to prompt message.
If the user select yes
, the property proceed
is set to true
which does not fail the <fail/>
action and the execution continue to the next action.
Other possible attributes includes :
ifset
, fails the action if the given property name is set.ifunset
, fails the action of the given property name is unset.ifempty
, fails the action of the given value is empty.ifnotempty
, fails the action of the given value is not empty.iftrue
, fails the action if the given value evaluates to true
. For example 1, true, t, yes or y (case insensitive).iffalse
, fails the action if the given value evaluates to false
. For example 0, false, f, no or n (case insensitive).inverse
, same as exprtk
, fails the action of the given exprtk expression evaluates to true.The xml element should be named <stop>
instead of <fail>
to indicate that it is a command and not a fatality.
Is your feature request related to a problem? Please describe. I would like to create confirmation prompts that ask the user if he really wants to proceed with an operation. The prompt would display a custom message with an
OK
andCancel
buttons.Describe the solution you'd like For example:
If the user has selected
OK
, the propertyproceed
should be set to value/continue
. If the user has selectedCancel
, the propertyproceed
should be set to value/abort
. If the attributefailoncancel
is set totrue
, the action should fail if the user has clicked onCancel
button.Describe alternatives you've considered There does not seems to exists an action that can cancel the operation.
Additional context N/A