Creating a Data Type and Business Process in a Workspace

Note

Created artifacts are available only within the workspace in which they were created.

To create artifacts available across the entire system, you must have administrator rights (be a member of the ECOS Administrators group — ECOS_ADMINISTRATORS).

Let’s look at creating some artifacts using the example of the equipment procurement process.

../_images/ws_art_01.png

Before creating the business process itself, it is necessary to create a number of artifacts in the following order:

Data Types

Data type — the main source of metadata for working with an object.

In the Administration section, go to Data Types and click + → Create new type:

../_images/type_01.png

General

The tab contains the main data for the data type:

No.

Field

Value

1

id

equipment-request

2

Name

Equipment Purchase Request

3

Parent

Case

4

Form

Leave as default — the system will automatically generate a form based on the specified attributes. Automatically generated forms cannot be edited.

5

Journal

Leave as default — the system will automatically generate a journal based on the specified attributes. Automatically generated journals cannot be edited.

Final tab configuration:

../_images/type_02.png

Attributes

The tab describes the properties that will be used to interact with the object.

The following information is required to create a request:

  • what needs to be purchased;

  • how much it costs;

  • who is requesting it;

  • who will approve the purchase.

The corresponding attributes (object properties):

Id (1)

Name (2)

Type (3)

name

Equipment Name

Text

price

Cost

Number

requester

Initiator

Person

approver

Approver

Person

Final tab configuration:

../_images/type_03.png

Roles

The tab describes the roles involved in working with the object — in this case, with the request.

Based on the attributes, two roles are required: Initiator and Approver.

Note

The Attribute field is populated from the attributes added on the «Attributes» tab. Clicking the field displays the list of available attributes.

Id (1)

Name (2)

Attribute (3)

requestor

Initiator

Initiator

approver

Approver

Approver

Final tab configuration:

../_images/type_04.png

Statuses

The tab describes the statuses through which the object (request) will move during the business process.

Let’s consider a simple successful scenario: the initiator creates a request (status «Request Created»), sends it for approval (status «Pending Approval»), and the approver approves it (status «Approved»).

Id (1)

Name (2)

request-created

Request Created

approving

Pending Approval

approved

Approved

rejected

Rejected

Final tab configuration:

../_images/type_05.png

Click «Save». The basic data type for the request has been created.

Intermediate Summary

As a result of configuring the data type:

  • basic information has been specified: the data type id and name;

  • the form and journal were automatically generated by the system based on the entered data;

  • the request properties for further interaction have been described;

  • the roles of request participants have been added;

  • the request lifecycle statuses have been defined.

The «Equipment Purchase Request» journal has been automatically added to the menu.

BPMN Models

In the Administration section, go to BPMN Models and click + → Create BPMN model:

../_images/bp_01.png

In the opened modal window, fill in the fields:

No.

Field

Value

1

Identifier

equipment-request

2

Name

Equipment Purchase Request

3

Data Type

equipment-request

4

Enabled

True — marks the process as active

5

Automatic Process Start

Check the box so that the process starts automatically. For details, see process start

6

Automatic Process Deletion

When an object of the specified type is deleted, the process will be deleted automatically. Enabled by default.

Note

Be sure to check the Enabled (4) and Automatic Process Start (5) boxes.

Final business process configuration:

../_images/bp_02.png

Click «Create». The business process designer will open:

../_images/bp_03.png

We will describe the process diagram in the business process editor. The request route:

Create Request → Send for Approval → Approve / Reject Request

Step 1. Start Event

The process start element — Start Event — is automatically added to the diagram. It monitors the appearance of a new object with the required data type in the system.

Select Start Event — a context menu will open next to the element for adding new elements, configuring connections, or editing the current element.

../_images/start_event1.png

Step 2. Status Change — «Request Created»

Immediately after creation, the request must receive the «Request Created» status. In the context menu, click the Set Status element:

../_images/set_status1.png

In the settings panel on the right, specify:

  • Name — Status «Request Created»;

  • Status — Request Created.

../_images/set_status_prop1.png

Step 3. User Task — Initiator’s Task

When the request is created, the initiator must review its contents and send it for approval. To do this, create a user task.

In the context menu, click the Task element:

../_images/User_task_11.png

The element type must be changed from «Task» to User Task. Click the wrench icon and select «User Task»:

../_images/User_task_21.png

In the settings panel, specify:

  • Name — For Approval;

  • Assignee — Initiator.

../_images/User_task_prop1.png

Note

A form for the task does not need to be created manually — the system will automatically generate a simple form with buttons configured in the Task Outcome field.

../_images/form_common1.png

The default Priority is Medium.

In the «Task Outcomes» list, specify:

  • Identifier — ToApprove;

  • Name — For Approval.

../_images/form_to_approve_51.png

Step 4. Status Change — «Pending Approval»

After sending for approval, change the task status. In the context menu, click the Set Status icon:

../_images/set_status_21.png

In the settings panel, specify:

  • Name — Status «Pending Approval»;

  • Status — Pending Approval.

../_images/set_status_2_prop1.png

Step 5. User Task — Approver’s Task

Create a similar task for the approver.

Add a Task element via the context menu:

../_images/User_task_31.png

Change the element type from Task to User Task:

../_images/User_task_41.png

In the settings panel, specify:

  • Name — Pending Approval by Approver;

  • Assignee — Approver.

../_images/User_task_2_prop1.png

The default Priority is Medium.

In the «Task Outcomes» list, specify two options:

  • Identifier — Approve, Name — Approve;

  • Identifier — Reject, Name — Reject.

../_images/request_approve_51.png

Note

A form for the task does not need to be created manually — the system will generate it automatically and display the verdicts from the Task Outcome field.

In this example, we will create a custom form to get acquainted with the form designer.

Forms for tasks usually contain comments and verdict buttons. In this case, the outcome buttons of the «Pending Approval» task are sufficient.

Steps to follow:

  1. On the settings panel of the User Task element, click «Select» under the «Task Form» field:

    ../_images/form_common_11.png
  2. At the top, click «Create» and select «Create form»:

    ../_images/form_common_21.png
  3. Fill in the fields:

    • Form identifier — equipment-request-approve-form;

    • Form name — Equipment Purchase Request Approval Form.

  4. Click «Edit Form»:

    ../_images/request_approve_11.png
  5. Delete the «Title» text element and the buttons:

    ../_images/form_outcome_11.png
  6. Go to «Advanced» and drag the Task Outcome element onto the form:

    ../_images/form_outcome_21.png
  7. In the «Property name» field, enter outcome and click «Save»:

    ../_images/form_outcome_31.png

    The Task Outcome element will automatically generate verdict buttons based on the Task Outcomes settings.

  8. Click «Save»:

    ../_images/form_outcome_41.png
  9. Select the created form.

Step 6. Gateway — Route Branching

After the approver completes their work, the process can take two paths: the request is approved or rejected. Add a branching element — Gateway.

Gateway controls the branching and merging of flows. Add it from the context menu or from the left panel:

../_images/gateway_11.png ../_images/gateway_21.png

Step 7. Status Change — «Approved» and «Rejected»

Add two status change elements after the Gateway.

For the «Approved» status: in the Gateway context menu, click the Set Status icon:

../_images/set_status_31.png

Specify:

  • Name — Status «Approved»;

  • Status — Approved.

../_images/set_status_3_prop1.png

For the «Rejected» status: similarly add a second Set Status from the Gateway context menu:

  • Name — Status «Rejected»;

  • Status — Rejected.

../_images/set_status_4_prop1.png

Step 8. Configuring Sequence Flows

The system determines the route based on conditions on the arrows (Sequence Flow) leaving the Gateway. Select the required arrow and configure the condition.

For the «Approved» flow:

../_images/Sequence_Flow_11.png
  • Name — Approved;

  • Condition type — Outgoing;

  • Outgoing — Pending Approval by Approver - Approve.

Note

Options in the «Outgoing» field are generated automatically from two parts: the task name (the Name field) and the task outcome name.

../_images/Sequence_Flow_21.png

For the «Rejected» flow:

../_images/Sequence_Flow_31.png
  • Name — Rejected;

  • Condition type — Outgoing;

  • Outgoing — Pending Approval by Approver - Reject.

../_images/Sequence_Flow_41.png

Step 9. End Event — Process Completion

Add a process end element End Event after each status change element — «Status «Approved» and «Status «Rejected».

../_images/end_event_11.png

Save and publish the process:

../_images/publish1.png

See also

Decision-making on a request can be automated using a decision table. See details.

Launching and Testing the Process

After creating the data type, journal, form, and business process, you can test the workflow.

In the left menu, select «Equipment Purchase Request» — an empty journal will open. Click «+» to create a new request:

../_images/new_request_11.png

Fill in the fields, for example:

  • Equipment name — HDMI cable;

  • Cost — 500;

  • Initiator — select an employee from the org structure;

  • Approver — select an employee from the org structure (only workspace members are displayed on the All Users tab).

../_images/org.png

Click «Save». The request will transition to the «Request Created» status and its card will open.

In the «My Tasks» widget, click the «For Approval» button:

../_images/new_request_31.png

The request will transition to the «Pending Approval» status, and a task will be assigned to the approver.

Log in as the approver, open the personal workspace, go to Current Tasks, and open the task:

../_images/new_request_41.png

In the «My Tasks» widget, click «Approve»:

../_images/new_request_51.png

The request will transition to the «Approved» status — the process has been successfully completed.

DMN Models

Automatic Approval/Denial Decision

Let’s extend the created process: we will add a decision table for automatic approval or denial for certain types of equipment.

In the Administration section, go to DMN Models and click + → Create DMN model:

../_images/dmn_01.png

Fill in the fields:

../_images/dmn_02.png

No.

Field

Value

1

Identifier

equipment-decision

2

Name

Decision on Equipment Purchase Request

Click «Create». The decision editor will open:

../_images/dmn_03.png

See also

Further steps are described in the article.

Using a DMN Dynamic Role in a Business Process

A dynamic role can be added to the process for automatic selection of an approver depending on conditions. The role rules are defined in a DMN table, and the role itself is configured in the data type.

See also

The procedure is described in the article.

ECOS Artifacts

«ECOS Artifacts» is designed to manage the created local artifacts. This journal includes all artifacts that have reached the ecos-apps microservice.

Available Actions

1. Download Artifact History

  • When clicking the action, you can select the date from which to export the artifact history.

  • A zip archive is downloaded containing all artifact versions from the specified date.

  • If the last artifact was uploaded before the selected date, only that version will be exported (i.e., there will always be at least 1 artifact).

2. Download Artifact

A zip archive with the selected artifact is always downloaded.

3. Redeploy Artifact Manually

Sends the artifact from ecos-apps to the microservice. Can be useful during development or after a failure in the target microservice’s database, i.e., ecos-apps does not pass the artifact if it was previously successfully deployed.

4. Reset User Version of Artifact

The reset reverts to the version installed from the application (APPLICATION or ECOS_APP). Only artifacts with USER in the Source Type column can be reset.

See also

For details about artifacts and their sources, see the article.

Packaging an Application for Artifact Transfer

In the workspace, go to the Administration section, select ECOS Applications, and click + — Create Application:

../_images/ws_app_01.png

Fill in the fields in the form that opens:

  1. Id — application identifier.

  2. Name — application name.

  3. Select all created data types for the “Equipment Purchase Request” process.

  4. Click «Load Artifacts for Selected Types» — the artifact list will be populated automatically.

../_images/ws_app_02.png

If necessary, add items to the list manually by clicking +.

../_images/ws_app_03.png

Click Save.

Downloading the Application

To download the application archive, click the download button next to the required application:

../_images/ws_app_04.png

Uploading to Another Environment

To upload the application to another workspace, click + — Upload Application:

../_images/ws_app_05.png

See also

For details about applications, see the article.