KPI (Key Performance Indicator) configuration
Discover how to create KPIs through the Bonita Studio feature and through a database connector to integrate them in your business processes.
For Subscription editions only. |
Create a KPI using the Bonita Studio KPI feature
This implementation option is preferred if you do not wish to manipulate database connection settings and SQL queries manually when writing your KPI data. The Bonita Studio assists you in setting your connection and automatically generates the SQL insertion queries for you.
Keep in mind that this implementation option has some drawbacks:
-
You can only insert one row at a time. There is no dynamic multi-row insert.
-
You do not benefit from pooled database connections. This has an impact on performance.
In order to use the KPI feature, you need to:
-
Create a KPI definition
-
Attach the KPI definition to a task or to a pool
-
Configure the JDBC driver as a process dependency
Create a KPI definition
When creating a KPI definition, you must specify its database connection settings and its structure.
-
In Bonita Studio, on a process diagram pool or activity, go to the Execution tab, select the KPI menu and select *_Create KPI_*.
-
Fill in the database JDBC connection settings:
-
Choose the Driver template that matches your reporting database type:
-
-
Click on the Apply template button. This pre-fills the Driver class name and JDBC URL fields.
-
Update the configuration with your database name, user name, and password:
-
Click on Test connection to validate your settings.
-
Click on Next.
-
Fill in the KPI definition page
-
Provide a name for the KPI definition. This is used as a reference for the Bonita Studio developers.
-
Click on the Fetch tables button to select the table to which you wish to attach this KPI. This pre-fills the KPI fields based on your database structure. Alternatively, you can type the name of the database table.
-
Optionally, specify a description (for documentation purpose only).
-
Add/remove or update your KPI fields by specifying:
-
the name (database column name)
-
the SQL type as defined in the database
-
whether the values should be surrounded with quotes in the SQL insertion query
-
-
-
Click on Create.
Attach a KPI definition to a task or a pool
Once you have specified a KPI definition, you may to attach it multiple times and at different levels:
-
Pool level - This generates KPI data either at process start or end
-
Task level - This generates KPI data either at task start or end
Follow these instructions to attach a KPI:
-
In Bonita Studio, either select a task or a process pool.
-
In the Details panel, Execution tab, KPIs pane, click on the Add button.
-
Select your KPI Definition from the list
-
Click on Next.
-
Review your database connection settings and test your connection (these are imported from your KPI definition so they should be correct).
-
Click on Next.
-
Fill in the Advanced configuration page
-
Make sure the Database table name is correct (this field is preloaded from your KPI Definition so it should be correct).
-
Select the Error behavior if KPI generation fails: you can either put the process into an error state, or ignore the failure.
-
Pick a KPI insertion event relative to the object to which you are attaching the KPI (task or pool).
-
Select an Edition mode for the insertion query. Graphical mode benefits from the mapping that you have provided in the KPI definition, Manual mode will let you write an SQL query.
-
-
Assuming that you have chosen the Graphical mode and clicked on Next, then configure the KPI field mapping.
-
Add as many rows as there are KPI fields in your Definition. For each row:
-
Expand the drop-down menu and choose a KPI field from your Definition.
-
Specify its value with an expression (a constant, a parameter, or a variable).
-
-
Click on Finish.
Configure the JDBC driver as a process dependency
When your KPIs are attached to your process, add a JDBC driver dependency to your process.
-
In Bonita Studio, select your process pool and click on Configure in the coolbar.
-
Select Process dependencies from the list on the left.
-
Check the .jar file of the JDBC driver that matches your reporting database.
-
Click on Finish.
Your process is now ready to be deployed. Reporting data will be generated in the reporting database each time the KPIs are triggered.
Create a KPI using a database connector
This implementation option is better for performance and flexibility reasons:
-
It enables dynamic multi-row insertions, because you can use Groovy scripts to transform data and generate complex queries.
-
It benefits from pooled database connections for improved performances.
The disadvantage with this implementation option is that it requires basic SQL knowledge because you have to write insertion queries manually.
To configure this option, use a database connector to insert a row in the reporting database.
Use the datasource database connector with connection pooling for improved performance.