Decision Management (ODM,ADS)

Decision Management (ODM, ADS)

Connect with experts and peers to elevate technical expertise, solve problems and share insights

 View Only
  • 1.  Call Java Code in the IBM ODM Rules

    Posted Mon April 14, 2025 09:56 AM
     
    We have some of rule are very complicated for example we need to comprate two dates or we compare array list with another array list.  I mean that some of rules are very complicated we cant create ODM rules.  
     
    We think that, We would like to develop java codes and call the java codes from IBM ODM rules .  is it possible? 
     
    If your response is yes could you guide me about complex rules. How can i call the java codes in the IBM ODM rules?  Could you share a few links in the knowledge center in IBM ODM. I couldn't find it. 
     
    If your response is no  I mean that IBM ODM doesn't have capability which is calling java class call the from the rules. could you guide me about complex rules. Could you share a few links in the knowledge center .
     
    Best regards


    ------------------------------
    Erkan Sezer
    ------------------------------


  • 2.  RE: Call Java Code in the IBM ODM Rules

    Posted Tue April 15, 2025 04:03 AM
    Edited by Jan Andersson Tue April 15, 2025 04:06 AM

    Terms and phrases you use in rules are based on code - either of PL/1, Cobol, XSD or Java. The last one is likely the most widely used. ODM was originally called JRules. You can probably guess what the J stands for.

    So, based on that you ask if Java could be called from rules, I assume you are not using Java as base for your rules. Correct? If so, what are you using? 

    In ODM, you refer to this base as the eXecutable Object Model - the XOM. Check out your XOM(s) in your rule project. What kind are they?



    ------------------------------
    Jan Andersson
    ------------------------------



  • 3.  RE: Call Java Code in the IBM ODM Rules

    Posted Tue April 15, 2025 04:35 AM
    Edited by Andy Macdonald Tue April 15, 2025 04:37 AM

    Hi Erkan,
    This is a very common requirement in ODM and it is a good idea to hide this complex code from the business rule authors. If it is complex and code like and it is never going to change then it does not need to be visible in the rules. ODM provides a number of ways to achieve this.

    1) The best approach is to add the code to a Java model (XOM) and then import that model into the rule project as a Business Object Model (BOM). This process is covered in Step 3 of the getting started tutorial here - https://www.ibm.com/docs/en/odm/9.0.0?topic=gsbr-task-1-designing-main-rule-project-in-decision-service

    2) If you only have one or two such functions then you could add the code into a ruleset function instead. These have the benefit that they can also be edited in the Decision Center. Note that these are written in IRL which is "java like" and not full Java. This is documented here - https://www.ibm.com/docs/en/odm/9.0.0?topic=functions-

    3) A third option is to create a virtual BOM entry (one not mapped to any Java classes). In this you can create a virtual Helpers class and add many helper methods. You can put your IRL code directly in the Bom to XOM Mapping box at the bottom of the BOM Editor and verbalise the method how you like.



    ------------------------------
    Andy Macdonald
    ------------------------------