Decision Management (ODM,ADS)

 View Only
  • 1.  IBM ODM 8.12 Rule Logging

    Posted Wed January 17, 2024 06:51 PM

    I'm new to ODM 8.12, would like to know how I can do the rule logging in ODM 8.12. For using EngineObserver, do I need to create engine? Can I not access the existing one and get the rule instances to do some logging for rule execution start , end etc.Thanks!



    ------------------------------
    Anishia Casmir Thomas
    ------------------------------


  • 2.  RE: IBM ODM 8.12 Rule Logging
    Best Answer

    Posted Thu January 18, 2024 08:21 AM

    Hi,

    You do not need to create the engine you can use a reference in a b2x code:

    if (com.ibm.rules.engine.runtime.RunningEngineWithWorkingMemory.this instanceof com.ibm.rules.engine.ruleflow.runtime.RunningRuleflowEngine) {
        com.ibm.rules.engine.ruleflow.runtime.RunningRuleflowEngine engine = (com.ibm.rules.engine.ruleflow.runtime.RunningRuleflowEngine)com.ibm.rules.engine.runtime.RunningEngineWithWorkingMemory.this;
        engine.addObserver(myobserver);

    You will find a full sample of integration  in the Decisions Developer repository on github: https://github.com/DecisionsDev/decision-engine-observer-sample



    ------------------------------
    Alain Robert
    ------------------------------