Thursday, September 30, 2010

Re-generation of facts fail when Java facts originating from same Schema exits

Re-generation of facts in a dictionary in Oracle Business Rules 11g is a simple step. One needs to just update the schema and reload the facts from the options available in the Fact tab of the dictionary. Unfortunately, I had been struggling for more than two weeks on this simple step and any change in schema, be it addition/deletion of an element or change in an element's type, the facts in the dictionary were so glued to the dictionary that, they refused to update !

I pondered over a lot of options and tried a lot of workarounds/suggestions:

  • Re-created the schema and imported the schema again into Jdeveloper
  • Cleaned the temporary files in windows which Jdeveloper creates, stores and uses, available under an user's profile
  • Reloaded the facts in the dictionary in a different package (not the default). This updated the facts but all the existing reference in the dictionary had errors in them
  • I even re-designed the schema based on one of my earlier posts
 All my efforts were futile and we had in the meanwhile a SR open with Oracle and we were getting some directions from them. Finally, Oracle found that we had been using a java fact created from the same schema  and imported via a jar, which was the issue!

Since the jaxb objects were the same, they was issue in refreshing the xml facts when a java fact belonging to same schema existed in the same dictionary. Below are the steps to be followed when a xml fact has to be refreshed (as in the case mentioned above):

  1. Exit Jdeveloper
  2. Remove the jar referenced to import the java fact (from hard disk)
  3. Start Jdeveloper, remove the jar from project reference
  4. Update the schema (preferably, open the schema and update contents instead of a replace of .xsd file)
  5. Save all artifacts and run a clean up (not necessary, just a feel good factor) from Build>CleanAll
  6. Reload facts from updated Schema and check for the same (in case not refreshed, close Jdeveloper and try cleaning workspace)
  7. Update the jar with the update schema and reference it in the project properties
Good to move on now !!

Peace!

Cheers,
-AR

No comments:

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License