Supporting alternative branches in business processes

1. Overview

Alternative branches in business processes allow an officer to revert to the previous form of a process and modify the entered data, or cancel information entered in the form and return to the service menu. This is possible if the business process comprises two or more consequent tasks assigned to an officer, or when the process is modelled with a start form.

alternative branches 1

There are 2 scenarios for using this functionality
  • An officer can revert to the previous task in the Portal, in accordance with the navigation in the modelled branch of a business process (Step back).

  • An officer can cancel the data entered in the form in the Portal, terminate the process through the alternative branch and return to the service menu (Cancel).

Both scenarios are implemented by means of the navigation in the Button component in the form for signing data using QES.

The buttons modelled using the Button component are located on the data signature form, under the QES widget, and are visually separated from the widget.

Every transition via an alternative branch = an individual Button key with navigation on the forms.

2. Modelling and configuring the buttons for alternative branches on the business process forms

Using the navigation function and the _action_code attribute in the Button component, it is possible to set up returning to the previous forms in a business process, and cancelling the information entered in a form and returning to the service menu.

Clicking a button with modelled Navigation results in either returning to one of the previous forms or termination of the task and returning to the service menu. In this case, the _action_code field in the form data takes the value of the Action code parameter.

The buttons modelled using the Button component are located in the data signature form, under the QES widget, and are visually separated from the widget.

2.1. Configuring the Button component to return to the 1st form

  1. Log in to Regulations administrator portal and press Log on service.

    admin portal form modeling step 1

  2. Go to the UI form modelling service for business processes.

    ui forms 1

  3. Create a new form for data signature using QES, or open one of the previously modelled forms.

    forms alternative branches step back 1

    For details about modelling UI forms for business processes, see:

  4. Find the Components section in the forms for data signature modelling menu.

  5. Select the Button component, drag it and drop into the modelling central panel.

    forms alternative branches step back 2

    The page with the Button component settings opens.

  6. Go to the Display tab:

    • Enter the component (button) name into the Label field. For example, Return to form 1.

    • In the Action field, select the Navigation type from the dropdown menu. This means that the button will be used for navigation.

    • In the Action code field, enter the navigation destination. For example, enter the return_to_first value for returning to the first form.

    • In the Theme field, select the theme for the component from the dropdown menu. For example, select Secondary.

      forms alternative branches step back 3

  7. Go to the API tab. In the Property name field, enter the API endpoint name. For example, returnToFirst.

  8. Click Save to save the changes made to the form component.

    forms alternative branches step back 4

2.2. Configuring the Button component to return to the 2nd form

Configuring the Button component to return to any form using the navigation function is identical, except the Action code value, and Property name for the API endpoint (see details in Configuring the Button component to return to the 1st form).
  1. Open the Button component settings.

  2. Go to the Display tab.

    • Enter the component (button) name in the Label field. For example, Return to form 2.

    • In the Action field, select the Navigation type from the dropdown list. This means that the button will be used for navigation.

    • In the Action code field, enter the navigation destination. For example, enter the return_to_second value for returning to the second form.

    • In the Theme field, select the theme for the component from the dropdown menu. For example, select Secondary.

      forms alternative branches step back 5

  3. Go to the API tab. In the Property name field, enter the API endpoint name. For example, returnToSecond.

  4. Click Save to save the changes made to the form component.

    forms alternative branches step back 6

2.3. Configuring the Button component to cancel the data entered in the form and terminate the process

Configuring the Button component to cancel the data entered in the form, terminate the business process and return to the service menu is identical to returning to the previous forms using the navigation function, except the Action code value, and Property name for the API endpoint (see details in Configuring the Button component to return to the 1st form).
  1. Open the Button component settings.

  2. Go to the Display tab.

    • Enter the component (button) name in the Label field. For example, Cancel.

    • In the Action field, select the Navigation type from the dropdown list. This means that the button will be used for navigation.

    • In the Action code field, enter the navigation action. For example, enter the cancel value for cancelling the data entered in a form and returning a user to the main menu.

    • In the Theme field, select the theme for the component from the dropdown menu. For example, select Secondary.

      forms alternative branches step back 7

  3. Go to the API tab. In the Property name field, enter the API endpoint name. For example, cancel.

  4. Click Save to save the changes made to the form component.

    forms alternative branches step back 8

3. Modelling and configuring alternative branches in a business process

Preconditions

A modelled synthetic business process allowing to set up corresponding alternative branches:

  • Green branch: To return to a form with the form 1 name.

  • Blue branch: To return to a form with the form 2 name.

  • Violet branch: To cancel the entered data, termination of the business process and returning the service menu.

3.1. Modelling returning to form 1

  1. Select a branch navigating to the form you want to return to. In our case that is the green branch.

  2. Enter the branch name in the Name field. For example, Return to form 1.

  3. In the Condition Type field, select the Expression type.

  4. In the Expression field, model navigation to form 1 using the submission() JUEL expression.

    You can find the detailed description of the available JUEL functions in:

    Example 1. Modelling returning to form 1 using the submission() JUEL function
    ${submission('SignForm').formData.hasProp('_action_code') && submission('SignForm').formData.prop('_action_code').value().equals('return_to_first')}
    Explanation
    • In the first part, before &&, the expression checks whether '_action_code' exists in the form:

      {submission('SignForm').formData.hasProp('_action_code')
    • In the second part, after &&, the expression checks what does the '_action_code' value equal to. In our case, action code equals to 'return_to_first':

      submission('SignForm').formData.prop('_action_code').value().equals('return_to_first')
    • 'return_to_first' is the value of the Action code field when configuring a form in the form modelling service (configuration of a button navigating to the 1st form).

    See Configuring the Button component to return to the 1st form for details about setting the form configuration.

    alternative branches 2

3.2. Modelling returning to form 2

Modelling returning to any forms through alternative branches is almost identical. Only the action_code parameter value changes that is identified when modelling a form for a business process. You have to pass this value to the submission() function.

  1. Select a branch navigating to the form you want to return to. In our case that is the blue branch.

  2. Enter the branch name in the Name field. For example, Return to form 2.

  3. In the Condition Type field, select the Expression type.

  4. In the Expression field, model navigation to form 2 using the submission() JUEL expression.

    You can find the detailed description of the available JUEL functions in:

    Example 2. Modelling returning to form 2 using the submission() JUEL function
    ${submission('SignForm').formData.hasProp('_action_code') && submission('SignForm').formData.prop('_action_code').value().equals('return_to_second')}
    Explanation
    • In the first part, before &&, the expression checks whether '_action_code' exists in the form for data signing:

      {submission('SignForm').formData.hasProp('_action_code')
    • In the second part, after &&, the expression checks what does the '_action_code' value equal to. In our case, action code equals to 'return_to_second':

      submission('SignForm').formData.prop('_action_code').value().equals('return_to_first')
    • 'return_to_second' is the value of the Action code field when configuring a form in the form modelling service (configuration of a button navigating to the 2nd form).

    See Configuring the Button component to return to the 2nd form for details about setting the form configuration.

    alternative branches 3

3.3. Modeling cancellation of data entered in the form and returning to the main menu

Modeling cancellation of data entered in the form and returning to the main menu through alternative branches is almost identical to the previous forms for data correction. Only the _action_code parameter value changes that is identified when modelling a form for a business process. You have to pass this value to the submission() function.

  1. Select the XOR gateway having a branch to cancellation.

    • Enter the Cancel data entering name into the Name field.

      alternative branches 4

Select a branch navigating to cancellation of entered data and termination of the business process. In our case that is the violet branch.

  • In the Name field, enter the branch name. For example, Yes.

    1. In the Condition Type field, select the Expression type.

    2. In the Expression field, model the cancellation of entered data and returning to the service menu using the submission() JUEL expression.

      You can find the detailed description of the available JUEL functions in:

      Example 3. Modelling cancellation of entered data and returning to the service menu using the submission() JUEL expression
      ${submission('Firsttask').formData.hasProp('_action_code') && submission('SignForm').formData.prop('_action_code').value().equals('cancel')}
      Explanation
      • In the first part, before &&, the expression checks whether form 1 has '_action_code':

        {submission('Firsttask').formData.hasProp('_action_code')
      • In the second part, after &&, the expression checks what does the '_action_code' value equal to. In our case, action code equals to 'cancel':

        submission('Firsttask').formData.prop('_action_code').value().equals('cancel')

        'cancel' is the value of the Action code field when configuring a form in the form modelling service (configuration of cancelling the entered data and returning to the service menu).

      alternative branches 5