Skip to content

Adding stages to an application

It is often desirable to have an application, or form, transition through a set of phases or stages. At each stage the form might be used by different people in different roles. The form also might be presented in a slightly different manner in each stage, such as having some items or pages hidden, or in a read-only state.

Each form in a Leap application can have multiple stages. By default, a newly created form has two stages:

  • Start – The initial state of every form. Once the form transitions away from the Start stage it cannot return.
  • Submitted – A submitted form is stored in this stage. Forms in this stage may be updated by users with permission.

Additional stages can be added and configured by clicking the plus (+) icon that appears when hovering over a Stage box or by clicking the Add Stage button in the Properties panel; however, the Start stage is always required and is unique.

Actions

Each stage can have multiple stage actions. Each stage action presents itself as a button in the form's footer area and therefore the terms “stage action”, and “stage button” are used interchangeably. There are three types of stage actions:

  • Submit – Submits the form data, and transitions the form to the next stage. A single stage can have multiple Submit buttons. Each Submit button may have different settings, and may transition the form to a different next stage. A stage that does not have any Submit buttons will be depicted as an "End" stage with a red square icon, however stage buttons may be added at any time.
  • Save Draft – Temporarily stores the form's data so the user can return later to complete the rest of the form. A single stage can have multiple Save Draft buttons. Each button may have different settings, such as a unique message for the user. A stage is not required to have a Save Draft button. For more information, see Saving work as Draft.
  • Cancel – Returns the form to its original state before the end-user started making modifications. The form remains within the same stage. A single stage can have only one Cancel button. A stage is not required to have a Cancel button.

Every newly created stage, including the Start stage, is given by default a single Submit button and Cancel button as a starting point.

Activities

During the transition from one stage to the next, there are several activities that can take place: Send an Email, Call a Service, and Assign Users.

The Call a Service activity can invoke an external service or another Leap application. It can be executed either before or after the form data is saved. If configured to trigger before save, return values can be mapped to fields in the form. If configured to trigger after save, return values are not saved in the form, regardless of any output mappings defined in the service configuration.

Refer to Incorporating web services into your applications for more details.

Controlling item visibility by stage

The Visibility tab also allows the application designer to disable or hide individual form items or entire pages within a specific stage of a form. Leap provides control over which users can access or modify form data at each stage. Permissions can be configured by selecting a stage and navigating to Permissions, or by using the Visibility tab. For more information, see Application and Security overview.

Branching

Each stage action may define one (or more) conditional branch by clicking on the diamond icon below the stage object in the workflow diagram, or with the action selected by clicking on + Add conditional branch. A branch defines an alternate path the form takes when submitted. A branch must define a condition that determines when it will be followed. Branch conditions may be based on a user in/not in a role or the value of an item on the form. Each branch may have its own distinct activities that are executed when followed.

Designating a Primary Assignee

Designating a primary assignee adds the record to their task list, meaning they are solely responsible for advancing it to the next stage. The user will be granted view and edit permissions.

To designate a primary assignee, select a stage on the Workflow tab, click the Permissions tab, and then toggle Designate Primary Assignee.

You can define the assignee by a user lookup (defined at design time) or a field value (evaluated at run time).

When User Lookup is selected the author can use the search field to identify the primary assignee. The field is connected to the configured user repository and will only return valid users.

Note

Groups many not be designated as the primary assignee.

When Value in Form is selected the author can select a form field that will contain the user-identifying value to assign as the primary assignee. The value of the field must match the login id attribute (the default is uid) of the configured user repository.

My Tasks

The My Tasks page is accessible from the main page. This page shows records that are assigned to the logged in user as tasks in the list, if designated as the primary assignee. The user is intended to take action on each task. Tasks are removed from the list when the record is moved to the next stage.

Additional Topics

The following topics describe scenarios related to stages and workflow in your HCL Leap application.

Parent topic: Adding dynamic behavior