JBoss.orgCommunity Documentation

Chapter 16. Business Activity Monitoring

16.1. Overview
16.2. Business Dashboards
16.3. Process Dashboard

Imagine you are developing a BPM solution which mixes process with business data. Imagine also you need some forms to be used within processes in order to let the users enter data. Moreover, you'll likely want to have some kind of dashboards to display metrics and key performance indicators in order to quickly assess how your processes are doing. So far so good.

jBPM brings you all the ingredients you need to develop end-to-end business process solutions. The jBPM's BAM module (also known as Dashboard Builder or just Dashbuilder) allows for composing custom business dashboards mixing data coming from heterogeneous sources of information. The module is now fully integrated into KIE workbench. A new specific section for dealing with dashboards has been added and it can be accessed either from the home page or from the menu bar, as shown in the next figure.


In the figure, within the highlighted sections, there exists two options:

  • Business Dashboards: This option is intended to give users access to the generic dashboard tooling either to compose new dashboards or just to consume existing ones.

  • Process & Task Dashboard: It opens up the Process Dashboard perspective which contains several performance indicators related to the jBPM execution engine.

BPM solutions are not only made up with processes, rules or forms but also with data belonging to the customer business domain. Such data is handled in the forms, the rules and, of course, the dashboards that are part of the solution. Usually, dashboards feed with data coming from several sources of information, from business domain entities persisted into relational databases to data hold in legacy systems. In order to cope with this kind of scenarios a generic highly customizable dashboard tooling is needed.

It's obviously expected that a customer building a BPM solution want to track how its processes are performing. To do so the customer need a monitoring and reporting tool. This is the main reason why the Dashbuilder project has been included as a core module of the jBPM ecosystem. Notice also that Dashbuilder, as an independent project, is not only used by jBPM but also by many other projects like, for example, JBoss Teiid a data virtualization system that allows applications to use data from multiple, heterogeneous data stores.

An example of dashboard is the Sales Dashboard which comes built-in any installation of Dashbuilder. Two screenshots below:



The jBPM Process Dashboard is an specific use case of a dashboard feed from data coming from a relational database via SQL queries. In this case, the database tables consumed are: processinstancelog and bamtasksummary both belonging to the jBPM engine.

From the data provider perspective there exists 14 data providers in charge of retrieving the data needed by all the key performance indicators of the jBPM Process Dashboard. These data provides are all defined in the Dashbuilder tooling data provider management screen.


Below are the details of all the data providers used in the jBPM dashboard.

  • jBPM Count Processes: Retrieves the total number of process instances per process and per process status.

    
            select processname,
              ifnull(instances,0) total,
              ifnull(instances_act,0) active,
              ifnull(instances_compl,0) completed,
              ifnull(instances_pend,0) pending,
              ifnull(instances_susp,0) suspended,
              ifnull(instances_abrt,0) aborted
            from
            (select processinstanceid, processname, count(*) as instances
            from processinstancelog
            where {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processinstanceid,processname) as total
            left outer join
            (select processinstanceid, count(*) as instances_act
            from processinstancelog
            where status=1
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processinstanceid) as active
            on (total.processinstanceid=active.processinstanceid)
            left outer join
            (select processinstanceid, count(*) as instances_compl
            from processinstancelog
            where status=2
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processinstanceid) as completed
            on (total.processinstanceid=completed.processinstanceid)
            left outer join
            (select processinstanceid, count(*) as instances_pend
            from processinstancelog
            where status=0
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processinstanceid) as pending
            on (total.processinstanceid=pending.processinstanceid)
            left outer join
            (select processinstanceid, count(*) as instances_susp
            from processinstancelog
            where status=4
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processinstanceid) as suspended
            on (total.processinstanceid=suspended.processinstanceid)
            left outer join
            (select processinstanceid, count(*) as instances_abrt
            from processinstancelog
            where status=3
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processinstanceid) as aborted
            on (total.processinstanceid=aborted.processinstanceid)
            order by processname
          
  • jBPM Process By Status: Retrieves the number of process instances grouped by status.

    
            select status, count(processinstanceid)
            from processinstancelog
            where status is not null and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by status
          
  • jBPM Process By Version: Retrieves the number of process instances grouped by version.

    
            select processVersion, count(processinstanceid)
            from processinstancelog
            where processVersion is not null
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processVersion
          
  • jBPM Process Completed By Date: Retrieves the number of process instances completed grouped by date.

    
            select end_date, count(processinstanceid)
            from processinstancelog
            where end_date is not null
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by end_date
            order by end_date asc
          
  • jBPM Process Duration: Retrieves the number of instances and duration stats per process.

    
            select processname, count(processinstanceid), min(duration), avg(duration), max(duration)
            from processinstancelog
            where {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processname
            order by processname asc
          
  • jBPM Process Instances: Retrieves the number of instances per process.

    
            select processname, count(processinstanceid)
            from processinstancelog
            where {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by processname
            order by processname asc
          
  • jBPM Process Instances By User: Retrieves the number of process instances grouped by the user who initiates.

    
            select user_identity userid, count(processinstanceid)
            from processinstancelog
            where user_identity is not null
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by user_identity
          
  • jBPM Process Started By Date: Retrieves the number of process instances started on given date periods.

    
            select start_date, count(processinstanceid)
            from processinstancelog
            where start_date is not null
              and {sql_condition, optional, processname, processname}
              and {sql_condition, optional, user_identity, userid}
              and {sql_condition, optional, status, status}
              and {sql_condition, optional, start_date, start_date}
              and {sql_condition, optional, end_date, end_date}
              and {sql_condition, optional, processversion, processversion}
            group by start_date
            order by start_date asc
          
  • jBPM Task Instances: Retrieves the number of task instances per process.

    
            select ts.taskname, count(ts.taskid) taskid
            from bamtasksummary ts left join processinstancelog ps on (ts.processinstanceid=ps.processinstanceid)
            where {sql_condition, optional, ps.processname, processname}
              and {sql_condition, optional, ps.status, status}
              and {sql_condition, optional, ps.start_date, start_date}
              and {sql_condition, optional, ps.end_date, end_date}
              and {sql_condition, optional, ps.processversion, processversion}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ts.taskname, taskname}
              and {sql_condition, optional, ts.createddate, createddate}
              and {sql_condition, optional, ts.enddate, enddate}
              and {sql_condition, optional, ts.status, status}
            group by ts.taskname
          
  • jBPM Tasks By Status: Retrieves the number of task instances grouped by status.

    
            select ts.status as taskstatus, count(ts.taskid)
            from bamtasksummary ts left join processinstancelog ps on (ts.processinstanceid=ps.processinstanceid)
            where {sql_condition, optional, ps.processname, processname}
              and {sql_condition, optional, ps.status, status}
              and {sql_condition, optional, ps.start_date, start_date}
              and {sql_condition, optional, ps.end_date, end_date}
              and {sql_condition, optional, ps.processversion, processversion}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ts.taskname, taskname}
              and {sql_condition, optional, ts.createddate, createddate}
              and {sql_condition, optional, ts.enddate, enddate}
              and {sql_condition, optional, ts.status, taskstatus}
            group by ts.status
          
  • jBPM Tasks By User: Retrieves the number of task instances grouped by the user who holds it.

    
            select ts.userid, count(ts.taskid)
            from bamtasksummary ts left join processinstancelog ps on (ts.processinstanceid=ps.processinstanceid)
            where ts.userid is not null
              and {sql_condition, optional, ps.processname, processname}
              and {sql_condition, optional, ps.status, status}
              and {sql_condition, optional, ps.start_date, start_date}
              and {sql_condition, optional, ps.end_date, end_date}
              and {sql_condition, optional, ps.processversion, processversion}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ts.taskname, taskname}
              and {sql_condition, optional, ts.createddate, createddate}
              and {sql_condition, optional, ts.enddate, enddate}
              and {sql_condition, optional, ts.status, taskstatus}
            group by ts.userid
          
  • jBPM Tasks Completed By Date: Retrieves the number of task instances completed grouped by date.

    
            select ts.enddate, count(ts.taskid)
            from bamtasksummary ts left join processinstancelog ps on (ts.processinstanceid=ps.processinstanceid)
            where ts.enddate is not null
              and {sql_condition, optional, ps.processname, processname}
              and {sql_condition, optional, ps.status, status}
              and {sql_condition, optional, ps.start_date, start_date}
              and {sql_condition, optional, ps.end_date, end_date}
              and {sql_condition, optional, ps.processversion, processversion}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ts.taskname, taskname}
              and {sql_condition, optional, ts.createddate, createddate}
              and {sql_condition, optional, ts.enddate, enddate}
              and {sql_condition, optional, ts.status, taskstatus}
            group by ts.enddate
            order by ts.enddate asc
          
  • jBPM Tasks Duration: Retrieves the number of instances and duration stats per task.

    
            select ts.taskname, count(ts.taskid), min(ts.duration), avg(ts.duration), max(ts.duration)
            from bamtasksummary ts left join processinstancelog ps on (ts.processinstanceid=ps.processinstanceid)
            where ts.duration is not null
              and {sql_condition, optional, ps.processname, processname}
              and {sql_condition, optional, ps.status, status}
              and {sql_condition, optional, ps.start_date, start_date}
              and {sql_condition, optional, ps.end_date, end_date}
              and {sql_condition, optional, ps.processversion, processversion}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ts.taskname, taskname}
              and {sql_condition, optional, ts.createddate, createddate}
              and {sql_condition, optional, ts.enddate, enddate}
              and {sql_condition, optional, ts.status, taskstatus}
            group by ts.taskname
            order by ts.taskname asc
          
  • jBPM Tasks Started By Date: Retrieves the number of task instances started on given date periods.

    
            select ts.createddate, count(ts.taskid)
            from bamtasksummary ts left join processinstancelog ps on (ts.processinstanceid=ps.processinstanceid)
            where ts.createddate is not null
              and {sql_condition, optional, ps.processname, processname}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ps.status, status}
              and {sql_condition, optional, ps.start_date, start_date}
              and {sql_condition, optional, ps.end_date, end_date}
              and {sql_condition, optional, ps.processversion, processversion}
              and {sql_condition, optional, ts.userid, userid}
              and {sql_condition, optional, ts.taskname, taskname}
              and {sql_condition, optional, ts.createddate, createddate}
              and {sql_condition, optional, ts.enddate, enddate}
              and {sql_condition, optional, ts.status, taskstatus}
            group by ts.createddate
            order by ts.createddate asc
          

As shown above, every SQL contains several {sql_condition} clauses. These are needed in order to support filtering on the data displayed by the dashboard. Every time the user issues a filter request, the data providers feeding the KPIs react by re-executing their SQL with the proper filter criteria. The {sql_condition} clauses not satisfied are just ignored.

From the end user perspective, the jBPM Process Dashboard has been designed to consume the data from the data providers defined above. It has been also designed has a panel fully integrated into the KIE Workbench environment as shown in the next figure:


The dashboard itself is composed by two views or pages: