Is it possible to create a BDM directly in Java?

1
0
-1

Hi,

A long time ago, we could create create data objects pretty easy outside the Bonita Studio and import them into the Bonita Studio. With the new BDM feature this does not work anymore.

In my usecase I have an existing datamodel, created outside of the Bonita Studio, in Java. I would like to import that model classes in the Bonita Studio as a jar that creates Business Objects, on which I can add new Business Objects using the Studio. There is one big reason I want to do this:
DRY - Don't repeat yourself! I do not want to create the datamodel two times, and worse, manage all changes in two places.

I tried creating a class implementing the bdm Entity interface, but that does not seem to get recognized as a Business Object in the Studio:

import javax.persistence.Id;
import javax.persistence.Version;
import org.bonitasoft.engine.bdm.Entity;
@SuppressWarnings("serial")
public class Customer implements Entity {
private static final long serialVersionUID = 1L;
@Id
private Long persistenceId;
@Version
private Long persistenceVersion;
private String name;
@Override
public Long getPersistenceId() {
return persistenceId;
}
public void setPersistenceId(Long persistenceId) {
this.persistenceId = persistenceId;
}
@Override
public Long getPersistenceVersion() {
return persistenceVersion;
}
public void setPersistenceVersion(Long persistenceVersion) {
this.persistenceVersion = persistenceVersion;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

Note: I am currently using Bonita BPM Community 7.3.0

1 answer

1
0
-1
This one is the BEST answer!

Answer Part 1

Bonitasoft knows that the implementation of BDM is dreadful and have agreed to change it, but when is anyone's guess. I would hope it will be as early as 7.4 (but that might be wishful thinking). I know the next question, when is 7.4? Based on previous releases I have no idea.

Or could it indeed be 8.0 Which could come next spring...maybe.

Bonitasoft as with all other organizations will not tell us when things will change.

Answer Part 2

We have a central BDM.zip which we then update accordingly and release to developers once in a while. It ensured everyone is on the same page. Because we're small we do this manually, but carefully. Larger organizations could use automated tools to do this automatically.

regards
Seán

PS: While I understand this may not be the answer you are looking for, it's as close as you'll get at the moment I think. It does answer your question, please mark as resolved by ticking the tick mark on the left of this reply so others now it is closed.

Comments

Submitted by martijnburger on Fri, 09/16/2016 - 09:54

Hi Seán,

Thanks for your answer. I guess I will have to write my own parser then to generate the BDM.zip from the JPA annotations. I hope I'll get to that somewhere in the future. I will share it with the community and update the post when I get to it.

Submitted by Lionel Palacin on Fri, 09/16/2016 - 22:54

Hi Martjin,

Yes you're right, a parser to generate the XML contained in the bdm.zip should solve your import issue. Regarding your concern about the need to manage all the changes in two places, I'm trying to understand the use case where you'll need to keep in sync two data models that will be used in different platforms and deployed in separate DBs. Could you please share more information about it?

Also, we don't plan to implement an import of existing data model soon I guess. These kind of features might be really complex to implement with little to no benefits since it's nearly impossible to anticipate what will be the format of data model to import, and therefore an effort to adapt the structure will still be required.

Cheers

Notifications