The previous article in [1] explains what are the statistics that are going to monitor in WSO2 Business Process Server (BPS). WSO2 BPS generates two kinds of events for both BPEL and Human Task events.
So I wrote two event listeners in order to capture those generated events. BPEL event listener captures BPEL related process information as well as process instance information. Human task event listener captures the human task related process information. The source code can be found in [2].
Then the captured events are published to WSO2 Business Activity Monitor (BAM) which stores those events in Cassandra database. To publish events to WSO2 BAM, its credentials and thrift port url are needed. So those details are taken from an XML. The jar file which includes two event listeners and the publisher can be found in [3]. To activate both event listeners in WSO2 BPS, the jar file is needed to add to the dropins folder in <BPS_Home> /repository /components directory. ***
Using a hive script, the data in the Cassandra database is retrieved and stores again in H2 database which is a in-built relational database in WSO2 BAM. The hive script is set to run in every 10 minutes and tables in the H2 database get updated.
In order to display the statistics of WSO2 BPS, I wrote a jaggery application. So the jaggery application queries data from the internal H2 database in BAM to show in BAM Dashboard. Using toolbox concept in WSO2 BAM, both hive script and jaggery application can be added to BAM. The toolbox can be found in [3].
*** Next article includes how to add the event listeners to WSO2 BPS and configure both WSO2 BPS and BAM.