Portlet for starting processes

ELMA provider standard interfaces for starting processes, which automatically take into account the process hierarchy in the Designer and the access permissions. However, sometimes the standard interface may not be sufficient:

  • the work in the system is in several activity areas;
  • there are branch offices and different access to starting processes (some processes are not available to all the employees with the same job positions in different branch offices);
  • debugging of processes only for certain users is required;
  • visually dividing processes into categories is required;

In this case, you can create a customizable portlet for starting processes.

Fig. 1. Start Process portlet

This article describes the main principles of correct architecture and implementation of this portlet.

Most portlets in ELMA have special settings that allow configuring not only the appearance but also the displayed data. As for the portlet in this example, which must display processes conveniently, these settings may not be sufficient, especially if it is necessary to specify a unique display, start time, category, etc. for each process.

Create a special object, e.g. Portlet_ProcessStart, and add the following fields to it:

Name

Type

Purpose

Comment

Name (Name)

String

For grouping processes

 

Color (Color)

Color

For adding colors to process groups

 

Process Header (ProcessHeader)

Process header

For specifying a process in the object and assigning it to a group

Process header is a system object

Available for starting (IsActive)

Yes/No

To partially disable the possibility to start a process in the user interface.

Applies only to the portlet

If necessary, you can add other fields.

Also, on the Additional tab of the object, check the Hierarchical box.

The hierarchical structure of the object will allow grouping elements easily.

Fig. 2. Portlet_ProcessStart object, Additional tab

The object may have the following instances:

Accounting group, color #D1E3B4

  • Cash Request process, Available for starting = Yes
  • Leave Allowance process, Available for starting = Yes

Document Management group, color #FFEB9A

  • Get Contract Templates process, Available for starting = Yes
  • Approve Incoming Invoice _ Draft process, Available for starting = No

CRM group, color #D7C6D7

  • Incoming Lead process, Available for starting = Yes
  • Quick Sale process, Available for starting = Yes

Add all the necessary processes like this.

The Color field allows picking colors in a visual selector, which also displays the color in RGB.

The portlet itself can be implemented using a global module or a Code portlet. In any way, the portlet markup code logic will be the same and look like this:

1) JavaScript description of the function for calling the standard pop-up for starting a process.

2) Loading to the list variable all the processes, which can be started by the current user, and load the list of all the instances of the Portlet_ProcessStart object.

3) A cycle, that generates the list Group-Processes, available for starting, based on intersections of the set of processes, available to a user for starting and the set of processes from the object.

4) A cycle, in which the display of groups as collapsible panels of the specified color and with the process names inside is generated. When generating the process name define a JavaScript on-click function, which will call the standard pop-up for starting a process. 

 Fig. 3. Start Process portlet

Important

If processes are started often and do not have a regulated procedure for putting them into operation, then select Yes in the Available for starting field in the object.

In this case, it must be decided to which category the processes should pertain, if they are already available. In the portlet code, implement that processes without a category (in the object) were checked and displayed in a separate panel, e.g. Other.