Published: March 2, 2019

Generally, one Bonita tenant could be running several processes. It is the responsibility of an administrator to regularly monitor the health status of Bonita engine for any failures. This blog presents an approach for monitoring the Bonita engine without logging in to the portal.

To address this, we have created a separate process called ‘Health Monitoring’ which keeps listening to the Bonita engine for failed cases and sends out an email with appropriate information if it finds any failed tasks for running processes. We have created a scheduler that is running continuously in the Bonita engine to find failed cases. The process is fairly simple to understand and setup.

Bonita Health Monitoring

The process has four elements:

  • Start Timer Event
  • Retrieve all Failed Tasks List Task
  • Empty Check Gateway
  • Email Notifications for Stakeholders Task

Custom Page Integration with Bonita Process Blog

1. Start Timer Event

The start timer is used to launch the process on a repeating schedule (cycle) at a fixed date and time or after a specific delay (duration). To set the schedule, select the start timer event, go to the Details Panel > General Tab > General Pane and click on the ‘Edit’ option.

Start Timer Event - Bonita Health Monitoring

Clicking on ‘Edit’ opens a new window, which allows us to specify the condition (refer illustration).

Edit Timer Condition

For this process, we have selected a cycle and set up a condition to run the process every weekday at 6 AM. The value for the parameter healthMonitorTimer shown in the above screen should be changed to 0 0 6? * MON, TUE, WED, THU, FRI *

Timer Condition Based

This means the Bonita engine creates an instance (case) for the health monitoring process at 6 AM every weekday.

2. Retrieve all Failed Tasks List Task

Retrieving all failed tasks is the heart of this process. This task communicates with the Bonita engine and retrieves information about all failed tasks (if any). Here is a sample code, which provides a HashMap of all failed tasks.

Retrieve All Failed Tasks - Monitor BPM Health

[java]Map<ProcessInstance, List<ActivityInstance>> failedProcessDetailsMap = new HashMap<ProcessInstance,
List<ActivityInstance>>();
SearchOptions searchOptions = new SearchOptionsBuilder(0, Integer.MAX_VALUE);
SearchResult searchResults = apiAccessor.getProcessAPI().searchFailedProcessInstances(searchOptions);
List processInstances = searchResults.result;
for (ProcessInstance processInstance : processInstances) {
List<ActivityInstance> activityList = apiAccessor.getProcessAPI().getActivities(processInstance.rootProcessInstanceId, 0,
Integer.MAX_VALUE);
failedProcessDetailsMap.put(processInstance, activityList);
}[/java]

 

3. Empty Check Gateway

The empty check gateway decides whether to send an email or not. The gateway directly routes the case to closure if it doesn’t find any failed cases. If it finds any, then the control will be forwarded to the subsequent step i.e. email notification to the stakeholders.

Empty Check Gateway

4. Email Notifications for Stakeholders Task

This is the final step and is responsible for sending actual emails. This task holds an email connector and primarily we have used parameters for all required fields such as To email, From email, SMTP Port, SMTP Host, etc., for setting dynamic values through Bonita Portal.

Email Notifications

Here is a screenshot of sample code from the actual message content.

Code

The email received appears as shown in the screenshot below.

Received Emails - BPM Health Monitoring

In the above table, there is a column called ‘Action Link’, which holds the link to the task. If Open Task link is clicked in any of the rows, the corresponding tasks page will be opened. This enables administrators to route the error task directly to take instant action.

This blog post contains useful information on monitoring the health of your Bonita Platform. It is ideally recommended to monitor your system routinely to avoid any performance variation or deterioration. You can follow these checks to identify any potential problems by comparing the performance.

Evoke’s BPM Solutions

At Evoke Technologies, we bring over 15 years of experience as one of the industry’s best IT services companies. Our dedicated teams of highly trained BPM experts will come to know your business almost as well as you do, trusting your expertise in what you do to inspire us as we design and deploy customized BPM solutions to help you do it even better.

Further, with core technical competencies in the latest business process design standards (BPMN 2.0) and programming languages (like Java), premier partner status with Bonitasoft (the world’s fastest-growing provider of BPM services), and our customer-centric approach to planning and implementing business process strategy, Evoke can support you to develop and deploy right BPM solutions for your business needs. To learn more about our BPM solutions, contact us online or call us at +1 (937) 202-4161 (select Option 2 for Sales).

Author

  Vineeth Kumar Vyasabhattu is a Technical Lead at Evoke Technologies. He is part of a key BPM project for a leading North American conglomerate. Vineeth is technically adept on Java/J2EE based technologies and keen to explore Hadoop and NoSQL databases. He is currently pursuing his part-time Ph.D. in Web Services and Semantic Web from JNTU Hyderabad.
Please follow and share

Leave a comment