How to know which button was selected by the end user

Hi All,

Here is a question about interfaces with multiple submit buttons.  I have an approval interface with three submit buttons - Cancel, Re-work, and Proceed.

The user can select any of the buttons to close the form and proceed with the process.  However, I need a way to update a process variable based on which button the user clicked.  Secondly, I would like to make the comment text field required if the user clicks the Cancel or Re-work buttons.

I thought I would add an a!save function in the buttonWidget definitions but it seems SAIL doesn't like that.

How should I do this?

Thanks.

  Discussion posts and replies are publicly visible

Parents
  • To update a process variable, the interface needs to have rule inputs. Use this rule input into the saveInto attribute in a!buttonWidget.
    eg:
    a!buttonWidget(
    label: "Cancel",
    value: "Cancel",
    saveInto:ri!buttonClicked,
    submit: true
    ),
    a!buttonWidget(
    label: "Proceed",
    value: "Proceed",
    saveInto:ri!buttonClicked,
    submit: true
    )

    This will mean if Cancel is clicked ri!buttonClicked will have value as "Cancel", if proceed button is clicked it will have value as "Proceed".
    Then map this to a process variable in the Data -> Inputs tab in a User Input Task activity in which your SAIL interface is called. The rule inputs of the interface will be the activity class parameters (Data Inputs) and these can be mapped to a process variable.

    For your second query you can use validation groups. Refer to this SAIL recipe - docs.appian.com/.../recipe_configure_buttons_with_conditional_requiredness.html
Reply
  • To update a process variable, the interface needs to have rule inputs. Use this rule input into the saveInto attribute in a!buttonWidget.
    eg:
    a!buttonWidget(
    label: "Cancel",
    value: "Cancel",
    saveInto:ri!buttonClicked,
    submit: true
    ),
    a!buttonWidget(
    label: "Proceed",
    value: "Proceed",
    saveInto:ri!buttonClicked,
    submit: true
    )

    This will mean if Cancel is clicked ri!buttonClicked will have value as "Cancel", if proceed button is clicked it will have value as "Proceed".
    Then map this to a process variable in the Data -> Inputs tab in a User Input Task activity in which your SAIL interface is called. The rule inputs of the interface will be the activity class parameters (Data Inputs) and these can be mapped to a process variable.

    For your second query you can use validation groups. Refer to this SAIL recipe - docs.appian.com/.../recipe_configure_buttons_with_conditional_requiredness.html
Children
No Data