Login
Pass
Always remember me
Categories

Archive for the ‘Tutorial’ Category

How to add a category label to a process

There’s another new video tutorial now available in BonitaSoft documentation: How to add a category label to a process.

Category labels can be added during the process model phase by the process designer. After the process is deployed into production, the assigned label will show up on the case in the end user’s inbox each time a case is run.

It’s a neat way to add a category identifier, or a unique identifier to your various processes. And it can be changed or colored later, if need be, only by the process administrator even after the process is deployed into production.

Is there a video tutorial you’d like to see? Let us know via reply to this post.

How to multi-instantiate a task – now on video

There’s another new video tutorial now available in BonitaSoft documentation: How to Multi-Instantiate a Task.

It shows an example of a simple one-step approval, where 2 of 3 second-level managers must approve a reimbursement request for over 5K.

Three instances of the same “Approve request” task are created, one for each of the three identified managers – this is configured in the instantiator.

A join checker is configured to check the condition that determines whether this task is completed – that is, when the specified number of instances of this task have been completed by the end users. In this example, the task will complete when any 2 managers (from the instantiator  list) have approved the request.

After configuring the instantiator and join checker, the last step is to filter the actors list of 3 managers so that each manager sees only a single instantiation of the task as a step in his Bonita User Experience.

This video shows how this step is presented via a web form to each of the candidate managers, and shows that the third instance is cancelled once the step has been completed. (You can see the entire history of the case in the process administrator’s User Experience inbox, administration view.)

Is there a particular video tutorial you’d like to see us produce? Let us know via reply to this post.

Find a video tutorial for a Bonita Open Solution feature

There are some new videos now available in the BonitaSoft documentation system. Check out How to add a category label to a process, among others…

There are two ways to find a video in the documentation.

1) Go to any page in the system and use the search (for example, for “category label”):

Read the rest of this entry »

How to get faster Selenium test cases execution

Recently, I went to China to work with the BonitaSoft Quality Assurance (QA) team. We spent some time to improve Selenium execution speed. I will share the QA team knowledge on this, and give two tips. Just by using these two tips, we improved Selenium speed – 5 times fast on IE8 (from 8 hours to 1h30min) and 3 times faster on Firefox3 (from 3 hours to 1 hour). Check it graphically: OK, so here are the tips:

Tip 1: Use the Cybozu library to execute tests on IE

Selenium provides this library. You can find the reference in the documentation:

You need to add few more lines of code. Here is a java snippet:

Selenium selenium = getSelenium(); if(selenium.getEval("navigator.userAgent").contains("IE")){ selenium.useXpathLibrary("javascript-xpath"); }

And why IE but not on Firefox? Simply because Firefox  provides a great XPath parser natively.

Tip 2: Use setSpeed carefully

setSpeed allows you to configure a wait time between each execution of a Selenium request. See for yourself in the javadoc: I recommend using waitPageForCondition or waitPageForLoad instead. This way, the Selenium code executes as soon as the page is loaded instead of waiting.  So, instead of waiting a pre-defined time, during which the application is doing nothing and the developer just hopes that the required element has loaded completely, the test continues.

Ok, sometimes we found it necessary to use setSpeed. In this case, we changed setSpeed for a (little) part of the code,  If you do this, don’t forget to set it back to its default value 0.

We also found that using a higher setSpeed value when debugging might let the developer to see easily what is happening – you  might try this.  I personally love setSpeed for debug mode.

Do you want more?

So do we. We still have some avenues to explore:

  • Evaluate Selenium Grid (and perhaps also Saucelabs).
  • Move to Selenium 2 and use the new WebDriver API.
  • Open all tests in the same browser (without exceeding its memory) in order to not lose time launching new browsers.

And you? Which tricks are you using? Do you have some suggestions for us? Some feedback from your own tests?

We will be happy to learn from your experience.

How to use the Bonita HTTP API

Looking for a quick way to learn how to use the Bonita HTTP API? This blog post will guide you on how to configure your HTTP server using the BOS-Tomcat bundle (BOS-5.5.1-Tomcat-6.0.32) with different types of clients.

This kind of installation is intended for deployments in which Bonita Open Solution will be deployed on a dedicated web application server, allowing different applications to reach BOS remotely via standard HTTP.

This blog post has two main parts: server side and client side. The server side configuration is common for everyone, while the client side is specific to each client type. Read the rest of this entry »

Error management with BOS

How do you deal with connector errors during the execution of your BOS processes?

This article will present two different ways to deal with errors in your processes: error events and exceptions. We will provide an example for each, and we will give you their pros and cons so you can choose the one that best fits your needs.

Sending and Receiving error events

This method allows you to associate a error with a name to a connector.  If the connector fails, the process will catch that error with a boundary error event associated to that error name.

Error handling process diagram

Error handling with a boundary error event

This will provide an alternate path that is taken to deal with your error.

However, this method has some major drawbacks:

  • One can only associate a single named error to a connector, even if it can throw different types of errors. For example, for a database query connector, the server might be down or your query’s syntax might be incorrect, but the error raised by the failed connector will be the same.
  • Upon receiving the error signal, you will no longer have access to the name of the error that occurred.

Throwing and Catching Exceptions

Another solution which is more complex, but also more powerful, is to use Java exceptions for error handling.

In this case, if you are developing your own connectors and using the Bonita API to execute some tasks, you can catch the exceptions that are raised by your connector.

Here is an example of a process that executes a task via a subprocess:

Exception handling process diagram

Exception handling via a subprocess

In this example the parent process will execute a “Caller step.”

This caller step will launch the subprocess and execute the “Exception throwing step” with this method:

runtimeAPI.executeTask(activity.getUUID(), false);

This automated task will execute a connector that throws a Java Exception. This exception will be then be thrown by the execute task method and can be used to provide appropriate error handling.

You can log the error and even store the Exception object as a reference to the last error that occurred.

Errors happen – so it’s useful to deal with them in advance with boundary events or exception handling.

You may download the example processes from the contribution page here:
Error management sample processes for BOS 5.5.1