How to use Java Objects with UI Designer


I have a very simple Java class with two Integer variables and their getters and setters.
Nothing special. My goal is a Set Data task to take two numbers for a and b (from the form) and the next task Get Data to print in the form, using class functions. I want this through setters and getters. I just cannot find an example with newer Bonita versions (in the previous versions was too easy to do something like that) about Java objects and UI Designer.

In the end, I just desperately need a tutorial about java objects + ui designer and there isn't one for newer version.

This is what I've done so far
Click for images

1 answer

This one is the BEST answer!


Since Bonita 7 you have to use contracts and operations to get and set values in the UI :

So what you need to do, is :

  • Create a process variable based on your java Class
  • Add a contract in your step containing the values you need to set
  • Add operations that will take the values submitted, and record them in your Java object

You can find examples in the Community projects, like :