Example: Associate a process with an app

This article explains how to use a business process to automate working with app items.

As an example, let's configure a contract approval process in the Contracts app. Along this route, an employee creates a contract and sends it for approval to the head of sales and then to a lawyer. If approval is denied at any stage, the contract is returned to the employee for revision. Upon successful approval, the contract is forwarded to the secretary for document categorization.

To set up this process, follow these steps:

  1. Create a business process and open it in the designer.
  2. Determine process participants by adding swimlanes to the diagram.
  3. Model the document route using special graphic activities and configure process branching conditions.
  4. Link the process to the app so that employees can send the document along the route.

Step 1. Create a process for the app

Let's build a business process for the Contracts app, which is described in Example: Create an app and set up its properties.

To do this:

  1. Click the gear icon next to the app name and select Business Process from the menu. A page displaying the list of the app's business processes will open.
  2. To create a new business process, click + Process.
  3. In the window that appears, fill in the fields:
  • Name*. Specify the name that will be displayed in the list of the app's business processes.
  • Code*. Used for API interactions. The field is filled in automatically, but you can change its value if necessary.
  • Parent category. Specify the folder where the business process will be located. To create a new folder, go to the business process list page and click + Folder.
  1. After filling in the fields, click Create.

HtAaAWaBP2

The process designer will open. The canvas is located in the center, and the panel containing the elements required to build the process—the contract approval route—is on the right.

Step 2. Determine process participants

Each employee performing a role in the process is indicated on the diagram using a swimlane. There will be three of them in the approval process:

  • Initiator. This swimlane is added to the diagram by default. It is called a dynamic swimlane because no specific assignee is specified here. In our example, any employee can start the process.
  • Approvers. Since there are multiple approvers in our process (the head of sales and a lawyer), for convenience, we will combine them into a single user group and use it to configure the swimlane. When assignees are known in advance by position or group, the swimlane is called static.
  • Secretary. A static swimlane for the employee who will register the approved document at the final stage.

To configure participants, follow these steps:

  1. Create an approver group. To do this, go to Administration > Groups and click + Group.

HtAaAWaBP4

Set the name Contract approvers and save the settings.

  1. Go to the process designer and add a swimlane for approvers. From the right toolbar, drag the Swimlane element onto the diagram and place it after the Initiator swimlane. In the settings window that opens, set the name, select the Static type, and specify the created Contract approvers group as the user group.

HtAaAWaBP5

  1. Drag another swimlane for the secretary registering the document onto the diagram. In the settings, select the static type and specify the Secretary position from the company's organizational chart.

Step 3. Model the route and configure activities

Now you need to add activities to the swimlanes and connect them with transitions.

To place an element on the diagram, drag it from the right panel and place it in the desired swimlane. Then connect the elements with transitions to set the process direction.

Elements can be copied within a single process. To do this, press and hold the Shift key on the keyboard and drag the element to another location on the diagram.

In our process, we will provide for two approval stages, returning the contract for revision in case of refusal, and registering the document if approved.

This will require the following activities: Task, Notification, Approval, and End Approval. Also, the process must use a start event and an end event.

The process diagram after all configurations will look as follows:

HtAaAWaBP3

Start event

Any process diagram begins with a start event. You can configure a form for it that will open after the process is started.

In our example, when an employee adds a new contract and clicks the Approve button in its page, a form will appear where they can specify a comment, approval deadlines, etc.

To configure the form:

  1. Double-click the start event added to the diagram by default. In the settings window, open the Form tab.
  2. The Context column on the left lists process variables, including the Contract field, which stores the document itself. Drag the fields that users need to fill out when sending the contract for approval onto the form.

how_to_bind_app_to_proccess-7

  1. If there are not enough variables in the context, create them. Click + Add, and specify the name and data type of the new variable. For example, create an Approval due date field and select the Date/time data type for it.

To learn more about configuring the start event form, see Events.

Approval activity

To set up two-stage approval:

  1. Place the Approval activity in the approvers' swimlane. Double-click it to open settings.
  2. On the Main tab, select the document you are sending for approval from the drop-down list. In our example, this is Contract.
  3. Select the approval type. In our example, select Parallel—the task will be sent to the assignees simultaneously, and the contract will proceed along the route once both approvers have made a decision. With sequential approval, tasks are assigned to users one after another.
    associatated_process_05
  1. On the Deadline tab, set the deadline allocated for completing the approval task.
  2. The Connectors tab configures the conditions for further document progression. There will be two outgoing connectors for transtions from the Approval activity: Deny and Approve. Next to the Deny branch, select the Default option—this transition will be selected if the conditions for the Approve transition are not met, for example, if one of the approvers makes a negative decision.

associatated_process_06

 
Note that by default, the connecotr name is the name of the element it leads to. You can change these names on the Connectors tab.On the Deadline tab, set the deadline allocated for completing this task if you want to limit the approval time.

  1. Click Save in the activity settings, as no other parameters need to be specified for our process.

To learn more about the activity and its settings, see Approval.

Approve transition

Now configure the Approve transition itself to determine the conditions under which the contract will be considered approved.

  1. Double-click the Approve connector on the process map.
  2. In the settings, go to the Conditions tab and set the approval percentage to 100.
    HtAaAWaBP10

This means that the contract will be approved only if all approvers make a positive decision. After that, the process will proceed further.

Notification activity

After the approvers have made a decision, you need to inform the initiator of the resolution—whether the contract has been approved or rejected. To do this:

  1. Add two Notification activities.
  2. Connect the Approve transition to one, and the Reject transition to the other.
  3. In the settings of each notification on the Main tab, write its subject and text.

HtAaAWaBP11

  1. On the Recipients tab, specify exactly who should receive the notification. To do this, click Add and select the Initiator context variable.
  2. Save the settings for each activity.

To learn more about all activity settings, see Notification.

End Approval activity

This activity is used as a helper for the Approval activity. It is placed on the segment where you need to complete document approval and issue a resolution without waiting for the business process to finish.

  1. Place the End Approval activity immediately after the notification stating that the contract has been approved.
  2. In the settings, select the Approval activity added earlier and set the toggle switch to Approved.

HtAaAWaBP12

  1. Save the activity settings.

Now, when the process reaches this point, the resolution will appear in the contract page, and the approved document will proceed along the route.

To learn more about all activity settings, see End Approval.

"Make changes to the contract" and "Register contract" tasks

Add additional tasks to the process.

  1. If the approvers rejected the contract, you need to return it to the initiator for revision. To do this, drag a Task activity into the initiator's swimlane and name the task Make changes to the contract.
  2. So that the initiator can resend the document for approval after making edits, add a transition from the Make changes to the contract task to the Approval activity.
  3. After approval, the contract is forwarded to the secretary. Place another activity in the secretary's swimlane and name the task Register contract. Limit the task by time. Add the Contract variable to the form so that the secretary can navigate from the task to the document card and register it.
    HtAaAWaBP13

To learn more about activity settings, see Task.

End event

Now add an end event where the process should complete:

HtAaAWaBP14

  • After the Register contract task when the contract has gone through all route stages.
  • After the Make changes task in case the necessary edits cannot be made.

The completed process must be saved, debugged, and published—buttons for this are provided in the top menu. After that, the process will become available to users.

Step 4. Link the route to the app

Once the route is configured and published, you need to link it to the Contracts app. This can be done in several ways, depending on when and how you want to start the process:

  • To automatically start the process after creating a contract, go to the page with the app's process list, click the three-dot icon next to the process name, and select Link to app. The process will start when the user clicks Save on the item create form. To learn more, see App-associated business processes.
  • To start the process manually at any stage of working with an item, add a process start button to the app page or directly to the item page.

Let's look at how to configure the start button in the contract page:

  1. Go to the Contracts app and open any item page.
  2. At the bottom of the form, next to the Edit button, click the gear icon and then the plus icon.
  3. In the menu, select Add process start button and configure the button:
  • Enter the button name—Send for Approval—and select its color.
  • Determine which users will have access to the button—everyone or only those with edit or delete access to the contract.
  • In the process selection field, select the Contract approval process created in the previous steps.

The Send for Approval button will now appear in the contract page.

What's next

The process is configured and linked to a button in the contract page. By clicking it, an employee will start the route: the contract will be sent to approvers, corresponding tasks will be assigned to them, and then the contract will be sent for registration.

For registration, fields are provided on the document side panel where the secretary specifies the registration office and folder, and enters the contract registration number. This is available only for Document-type apps if document categorization is configured and registration is enabled in the company.

начало примечание

Useful articles:

конец примечание