I keep turning up the error, “The business data ‘employeeRecords’ with the class name ‘com.company.model.employeeRecords’, is not managed by the current version of BDM” whenever I run my diagram.
In the Help - Bonita Engine Log, the repeating error appears as:
"[date/time] -0700 ERROR: org.hibernate.internal.SessionFactoryImpl HHH000177: Error in named query: employeeRecords.topView
org.hibernate.QueryException: could not resolve property: CRDisclusure of: com.company.model.employeeRecords [SELECT e
FROM com.company.model.employeeRecords e "
I’m a Bonita newbie and have a pretty simple diagram so far (I tried to parallel the tutorial).
I tried changing my BDM attributes to get rid of the multiples I was testing out and fix a few preceding-capital issues, but, interestingly, the Help - Bonita Engine Log still shows the old attribute names being used (ex CRDisclosure instead of crDisclosure), and the Development - Browse Data (H2 Console) still shows the multiple attribute as such. Has my BDM database not been updating, in spite of me resetting it several times? Could this be causing my issue?
When you edit your business data model (BDM) it then needs to be redeployed. The update might be incompatible with the existing data model. So in development environment (i.e. Bonita Studio) it is recommended to “reset” the deployed BDM after doing some modifications. This reset will delete the data and the database tables. You have an option (checkbox) to reset the BDM when you click on the button to validate the BDM edition. You should be able to confirm that reset was successful by checking the tables and columns names using the H2 console.
Editing the BDM definition can also impact your process definition. That’s because process definition includes references to the BDM in business variables declaration. You also have reference to the BDM in the business variables default value, in task operations…
Usually the update of the BDM is automatically propagated to your process definition. But some limitations might exists. You can search (using the tree view) in your process for the old object or attributes name in order to locate them and rename them to match the BDM definition.
If you need help with that you might share (using Google Drive, Dropbox…) your process (export from Studio as a .bos file).
Thanks for your response. I have tried redeploying/resetting the BDM several times, but the attribute names in the H2 console haven’t been updating to match. I tried exiting out of Bonita and reopening it, but it hasn’t seemed to make a difference.
What else can I try?
You might want to try to go in Studio preferences, in “database” section, check this option to clean business database on Studio exit and restart the Studio.
Also you can share with me as I mentioned your .bos file and I can try to reproduce your issue.
Cleaning the database didn’t change the results either…
My data.
I managed to reproduce the issue. It was actually related to an inconsistency in the in your BDM definition. Some attributes names were not the same between the declaration and usage in generate JPQL queries. Here is the list of changes that need to be applied:
CRDisclusure → crDisclosure
CRConsent → crConsent
OHS → ohs
DD → dd
TravelCard → travelCard
Did you edit the bom.xml file manually outside Bonita Studio or did you do all the modification using the Studio interface?
Note that it in order to guaranty consistency it is recommended to use Studio interface to edit BDM.
Also your business object as 86 attributes. For performance of forms display it might be a good idea to create several objects and use composition with lazy loading.
I’m not sure why those changes haven’t been applied; I haven’t touched the bom.xml file (only the Studio interface) and, like I mentioned, I’ve reset the database several times.
How do I apply them now?
You can manually edit the bom.xml file and do a search and replace with your favorite text editor then do a right click on the bom.xml file in Bonita Studio and choose to clean and redeploy.
How do I get the edited .xml file back into Bonita Studio so I can redeploy it? It won’t recognize it as a BDM right now so I can’t import it that way.
Actually you can edit the “bom.xml” that is used by Bonita Studio (the one located in your current workspace and project, no need to export it and import it back):
- In Bonita Studio project explorer, in “Business Data Model”, select the “bom.xml” file, do a right click and select “Show in system explorer”. This should open a file explorer in the folder where the “bom.xml” file is located (e.g. "C:\BonitaStudioCommunity-7.9.0\workspace\My project\bdm").
- Open the “bom.xml” and apply the modifications suggest in my previous comment.
- Save changes and close the file.
- In Bonita Studio project explorer, select the “My project” (i.e. the root folder), do a right click and select “Refresh”.
- Again select the “bom.xml” file, do a right click and select “Clean deploy”
That is much more convenient, thank you.
Alright, I got those changes deployed, but when I try to run my program I still get the same error. Are there other changes I should make to the file? (I want to wait until this can run before I tidy things up and split my attributes into different objects)
You mean that you still get the message “Business data model not managed by the current BDM”?
Do you still have an error message “could not resolve property” in the Bonita Engine log?
If you still have this kind of issue can you share the latest version of your bom.xml?
If it’s another kind of issue can you export your project (including BDM, diagrams…) from the Studio as a .bos file?
Actually, I just checked an found I had made a typo. After fixing it and redeploying, I am now able to run it without the “Business data model not managed by the current BDM” error! Mission accomplished!
Thank you so much for your help!
As a final question, do you know why my BDM didn’t update those fields automatically and how I might be able to make it do so to avoid this kind of problem in the future?
Currently I have no clue about how this partial update of the BDM happen. What I recommend is that before doing your update your create a backup of your project by exporting it as a bos file. Then try to edit the BDM and if the issue happen again we will have a scenario to reproduce the issue and we can ask developers to take a look at it in order to identify what might be wrong in the code.