XML Schema (XSD) as database and /or Business object

1
0
-1

Hello;
I have XML Schema (XSD) files and i want to used them as Business object to create database and facilitate the creation of user interface by (UI Designer).
how can I do it?

1 answer

1
0
-1

In Bonita, the business object are defined in the Business Data Model (BDM) XML file named bom.xml. You can see such file in the project explorer if you create a basic business data model.

As XML Schema is also an XML file itself you might be able to create an XSLT stylesheet that convert your XML Schema into a valid Bonita Business Data Model XML file.

In Bonita, once you have defined your BDM you can then declare business variables in the process. Based on business variables you can generate "contracts" that define the data expected from the user to start a process or perform a task. And based on the contracts you can generate user interfaces (i.e. web forms) with Bonita UI Designer.

Comments

Submitted by maouachria on Tue, 05/07/2019 - 10:37

Thanks sir antoine for your answer, I will try to create an XSLT stylesheet but:

Indeed, I have messages, each of them in the form of an XML schemas, the latter are based on another XML schemas (Segment) which is, in turn, based on another XML schemas (Field).

I did not know how to create this kind of XSLT stylesheet file?
or i must create XSLT stylesheet for each XML schemas?.

thanks

Submitted by antoine.mottier on Tue, 05/07/2019 - 18:09

Honestly I'm not an expert in XML schema and XSLT but I think you might be able to manage all that with a single XSLT file.

An alternative would be to write a small program that would read the schema and extra useful information and build the BDM XML file.

Submitted by maouachria on Tue, 05/07/2019 - 18:47

ok sir, i will try both solutions.
thanks again

Submitted by maouachria on Thu, 05/09/2019 - 15:43

Hello Sir antoine;
you proposed me to create a program, can I know where I should create it in bonita or with eclipse?

Submitted by antoine.mottier on Thu, 05/09/2019 - 15:51

You need to create a custom software to convert your own format for business object definition to the format used by Bonita. Such development is not really in the scope of the Bonita Studio IDE. So I would recommend to use another IDE such as Eclipse to create this kind of software.

Submitted by maouachria on Thu, 05/09/2019 - 15:54

ok sir i will try.
have a good day

Submitted by maouachria on Thu, 05/09/2019 - 16:36

I tried to import a Business Data Model (BDM), for that, I compressed the file named bom.xml; but i still get an invalid format error message !!!

Submitted by antoine.mottier on Thu, 05/09/2019 - 19:59

Can you share the bom.xml you create?

Also did you try to create a BDM definition using the Studio, export it as a .bos file, open the bos file and replace the bom.xml with your own one?

Also please add a comment on this thread instead of posting a new answer. That will make the thread more easier to read.

Submitted by maouachria on Sun, 05/12/2019 - 11:34

1- Yes, i create it in Studio but I make some rectification in bom.xml with Note pad++ and i saved it in other computer !!!
2- I would like to know, if I can create it off studio, for example; Pad ++ note with my data (XML schema), then move it to the Bdm directory?
below a bom.xml file extract:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
// <businessObjectModel modelVersion="1.0" productVersion="7.2.0.beta-02">
<businessObjects>
<businessObject qualifiedName="com.company.model.Activity">
<fields>
<field type="INTEGER" length="255" name="IDActivity" nullable="true" collection="false"/>
<field type="LOCALDATETIME" length="255" name="StartTime" nullable="true" collection="false"/>
<field type="LOCALDATETIME" length="255" name="EndTime" nullable="true" collection="false"/>
<relationField type="AGGREGATION" reference="com.company.model.Message" fetchType="LAZY" name="SendMessages" nullable="true" collection="true"/>
<relationField type="AGGREGATION" reference="com.company.model.Message" fetchType="LAZY" name="ReceiveMessages" nullable="true" collection="true"/>
<relationField type="AGGREGATION" reference="com.company.model.Ressource" fetchType="LAZY" name="ReleasedRessouces" nullable="true" collection="true"/>
<relationField type="AGGREGATION" reference="com.company.model.Ressource" fetchType="LAZY" name="RequieredRessources" nullable="true" collection="true"/>
</fields>
<uniqueConstraints/>
<queries/>
<indexes/>
</businessObject>
</businessObjects>
</businessObjectModel>//

Submitted by antoine.mottier on Mon, 05/13/2019 - 17:56

Your example of bom.xml file includes the definition of a single business object named com.company.model.Activity. The issue is that this business object has some references to other data types such as com.company.model.Message that are not defined. Note that all business objects should be defined in a single bom.xml file.

In order to import the bom.xml file that you customized in Bonita Studio you can, as I mention in my previous comment do the following: create a BDM definition using the Studio, export it as a .bos file, open the bos file and replace the bom.xml with your own one and then import the updated bos file back in your Studio.

An alternative would be to: close the Studio, go in <studio installation folder>/workspace/<your repository>/bdm and edit the bom.xml directly from there, restart the Studio and rebuild and redeploy the BDM (easiest way to ensure that is to do a minor edit using Bonita Studio interface to define BDM.

Submitted by maouachria on Mon, 05/13/2019 - 18:30

ok sir, thanks
I have to create it out of the studio so that I can use XMl schemas.

Notifications