Search code examples
ibm-cloudbusiness-rules

Input parameters and Business Rules service on Bluemix


My rules (that were executing correctly on ODM) are not executing correctly when deployed on the Business Rules service on Bluemix. I added tracing and found that the input parameters were not correctly initialized. How do I fix this?


Solution

  • My ODM application used non-default contructors to instantiate the Java objects and initialize the fields. However, when using Bluemix, JAXB was used to instantiate the objects, which meant that the default constructors were invoked instead of the non-default ones.

    I created a function in my rules with the code in the non-default constructors. In the initial actions of my ruleflow, I called the function on the input parameters. This ensured that the input parameters were correctly initialized after the use of the default constructor, and the rules executed as expected.