To BDM or not to BDM?

Hi All,

I am currently evaluating Bonita v7.2.3, trying to decide on a BPM workflow engine + development methodology to go with.

In my experiments, I have tried to create a use-case where a user can manage a list of objects. This includes creating object instances (successful) and deletion of selected objects (unsuccessful). I have postponed trying to update objects and handling Pagination for now.

From what I can see, using BDM for such a concept is complex at best and unproductive in trying to remove objects from the BDM (both memory and from the H2 DB).

If I try to DELETE objects from the H2DB, it breaks the BDM and trying to manipulate the BDM through the Business Variable results in not being able to delete objects either with “Is Delete” or various remove methods.

At the moment, my H2DB contains records that are not loaded into the in-memory BDM when I use the REST api to load the BDM into a form.

I would like to think all of this is due to my lack of understanding and that managing data entities can be easily accomplished without relying on Connectors and non-BDM SQL queries… but at the moment I’m completely lost.

Have any of you managed to work with BDM, or do you just ignore it and work out your own way of CRUD’ing entities? Is BDM a feature that works well out-of-the-box only for Subscription editions?

Thanks.

2 Likes

H2DB is **NOT **recommended for production, you might want to use other DB like mysql or postgres.

1 Like

Regarding Sean’s comment - H2DB is NOT recommended for production - this is correct. However that does not mean it cannot be used in evaluation of the methods to develop and or build processes. In fact it is encouraged as Studio cannot be ported to any other database.

But Sean’s answer didn’t actually answer the question which is about BDM, and it’s use at all.

I have my own view on much of this which is BDM to me is not yet proven in the real world.

With 99.9999999999% of real world data outside of Bonita in databases of X, Y or Z flavor I believe Bonita have slipped up here and there is no real justification for it.

Here is a bug report I wrote recently regarding the implementation, or lack of, use of external data. You will also note Bonita’s reply.

https://bonita.atlassian.net/browse/BBPMC-383

If you want to add any opinion then please feel free.

I’ve not responded to Bonita yet as I’ve had the packers in for the last four days (I’m emigrating) which has put a lot of pressure on my time. Now they’ve finished (packing) I can get round to responding.

You will see that basically Bonita’s view is that any integration with the outside world (SQL etc.) is the purpose of the REST API Extensions. In my view this is oversimplifying the requirement of External Data.

My view is that Bonita should provide full and complete service to External Data that is fully usable in process, forms and pages without resorting to home grown extensions. This used to be very easy in 5 and 6, but in 7 it is very difficult as you have found.

Now as to the question of to BDM or not to BDM; I’ll be honest it doesn’t work for me. I understand the why of it, but when having to use data from external systems it does not work, What we need is BDM for purely Bonita related processes and a real methodology to access real world data and use them in processes.

One thing I would like to see for example is a method of creating an EXTERNAL BDM that links directly to a table, or a view, which does not have to use the internal database (for storage or anything) else.

I’m pleased that Bonita have seem the basic argument that there is something missing and it needs resolving but,how long before they actually fix this issue I don’t know. Will it be 7.3.0, 7.4.0 or even 8.0.0?

Will we actually see a full and proper explanation and development of a fully working CRUD solution without having to resort to non-standard REST API Extensions. again I don’t know.

The simple fact is Bonita are noticing the comments being made and I hope they will fix this issue correctly so everyone can get on with developing processes that work easily, rather than having to resort to low level programming functions that are not part of the basic system.

regards
Seán

PS: If this reply answers your question, please mark as resolved.

This doesn’t even address my question. The sole reason I’m using H2DB is to evaluate the system as it is out-of-the-box. I’d be unpleasantly surprised if the BDM doesn’t work with H2DB, but does work with another DB.

H2Db cannot be the problem, I have the same interrogations about the BDM … Two problems for me : first the generate business layer is linked with Bonita framework and cannot be easily shared with other IS components. Second i cannot conceive to not acces to BDM persistence manager … What the conclusion of your evaluation ? And for the use of BDM ?

Hello Seán,

I hope your move went well, and I thank you for your time and effort in this matter.
In my opinion, the whole idea of BDM is to offer a simple, transparent and automatic persistence model for business data. If the model is too complex, not transparent and doesn’t automatically invoke CRUD automatically-generated statements out-of-the-box, then I may as well implement my own BDM layer or move to another tool that offers it out-of-the-box.

Thanks,
Doron

Hi Doron,

depends on what you want but BDM does work, but you have to work at it, definitely.

regards

OK, so let’s say I want to manage a list of items that I’ve created with the BDM wizard. I set my Contract to include the BDM item objects and set it to Multiple. Then I let Bonita create the Process Instantiation and Task forms and execute the Process.

Filling the form with data leads to new item records appearing in the BDM items table. Using REST api let me display a list of available items from the BDM items table. It’s only when I tried to provide a mechanism for the user to select an item for deletion that I found the BDM confusing to work with.

I’ve tried using the remove(…), “Is Delete”, and even removeAll(…) and nothing worked. Then I tried to call a direct DELETE statement on the BDM table and that lead to the BDM in-memory objects to become detached from the BDM items table.

So… I’m definitely willing to conclude I simply don’t understand how to work with the tool(s) to accomplish what I want, but I’d think a simple CRUD example like this is a quintessential use-case and I’d be able to find countless articles demonstrating it all over the net.

Am I missing something? Is there a simple way to remove BDM-managed entities without messing things up?

Regards

AH the infamous delete item in BDM problem, BDM is all about persistence so the data will always be there. And in a way I like the approach for auditing purposes only though.

What you have to do in this case is:

  1. return the list of to be deleted items,
  2. instantiate a new BDM
  3. copy the previous BDM to the new BDM excluding the items in the list of to be deleted items

once the script is finished you will now have the new BDM as the current BDM and everything will be in sync with what you want.

regards

Does this mean that if I have 1000 items in my BDM, and I want to remove one, I need to load every item into a new BDM, excluding the single item I’m deleting and replace the old BDM with the new one?

On reading that it seems silly…doesn’t it?

Let’s define a BDM first: It’s a model of a record (in all reality). The Model contains the necessary SQL statements to work on the defined Business Data Objects (though not all are possible), not tried them.

My BDM has fields:

F1, F2, F3 etc.

When I create an instance of a BDM I create a BDO which is based on the BDM.

So record 1 is BDO1, record 2 is BDO2 etc.

This is not clear in any documentation Bonitasoft has provided. The data records are BDOs.

doing a search I found this:

http://www.objectdb.com/java/jpa/persistence/delete

also have a look here:

http://www.tutorialspoint.com/jpa/jpa_jpql.htm

and here:

http://howtodoinjava.com/jpa/jpa-remove-delete-entity-example/

regards
Seán

I assume however that when we’re talking about using a Persistence Manager to remove BDO’s, we actually mean the Persistence Manager living withing the Bonita Engine?

If so, I also assume access to this Persistence Manager is not available through **normal **BDM Operations like the ones available in Tasks?