Decision Management (ODM,ADS)

 View Only
  • 1.  ODM - How to get all rules fired and return them on response of decision service

    Posted Thu April 07, 2022 04:48 PM
    We are migrating from classic rule engine to decision engine. On CRE we have on response (Soap) of the services an section to list all executed rules. We are doing this for Audit and Troubleshooting.
    However for decision engine we haven't found equivalent APIs to do that on server side (Inside of decision service)

    Have somebody found an way to get all executed rules and return them on response of the Decision service ? Any code sample to do that ?

    Appreciate the help. Thanks.

    ------------------------------
    Sandro Nora
    ------------------------------


  • 2.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted Thu April 07, 2022 05:58 PM
    Hello,

    Are you executing rules with HTDS, in that case you can use the execution trace similarly to what is available for  the classic rule engine.
    https://www.ibm.com/docs/en/odm/8.10?topic=services-htds-decision-trace-filters
    If not what API are you using?

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



  • 3.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted Fri April 08, 2022 07:22 AM
    Hi Alian,

    Thanks for reply.
    We are executing rules with HTDS.
    Is there way to get execution traces at end of decision service execution ?

    Our customer is using IrlContext to get list of all rules from ruleset then they fill that information (Rule Name, ID, executed or not ...) on BOM Object that is part of response.

    The CRE API they are using is "context.getRuleset().ruleIterator;"

    ------------------------------
    Sandro Nora
    ------------------------------



  • 4.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted Fri April 08, 2022 04:54 PM
    Absolutely, enable decision trace in the request and you will get this information automatically nothing to implement in the Rules or the XOM

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



  • 5.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted 14 days ago

    Hi Alain ,

    In rest request what should i pass so that i only get the name of the rules which got executed . it is taking infoRulesFired in request but not rulesFired . can you provide me sample request.



    ------------------------------
    anubhav farkya
    ------------------------------



  • 6.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted 14 days ago

    if using json the name of the property is     infoRulesFired

    if using XML the name of the property is rulesFired

    You can see all the options from the RES Console if you do Retrieve HTDS Description File  and select the option Decision Trace Information

    The properties in JSON:

     "__TraceFilter__": {
        "infoRulesetProperties": false,
        "infoOutputString": false,
        "infoInputParameters": false,
        "infoOutputParameters": false,
        "none": false,
        "infoExecutionEventsAsked": false,
        "workingMemoryFilter": "string",
        "infoBoundObjectByRule": false,
        "infoExecutionDuration":false,
        "infoExecutionDate": false,
        "infoExecutionEvents": false,
        "infoInetAddress": false,
        "infoRules": false,
        "infoRulesNotFired": false,
        "infoSystemProperties": false,
        "infoTasks": false,
        "infoTasksNotExecuted": false,
        "infoTotalRulesFired": false,
        "infoTotalRulesNotFired": false,
        "infoTotalTasksExecuted": false,
        "infoTotalTasksNotExecuted": false,
        "infoWorkingMemory": false,
        "infoRulesFired": true,
        "infoTasksExecuted": false,
        "infoBoundObjectSerializationType": "ClassName"
      }

    in XML the properties are: (note that they are all optional you only need to define the one you want to be true)

      <trac:decisionTraceFilter>
        <trac:all>false</trac:all>
        <trac:none>true</trac:none>
        <trac:executionDuration>true</trac:executionDuration>
        <trac:executionDate>true</trac:executionDate>
        <trac:rulesetProperties>true</trac:rulesetProperties>
        <trac:systemProperties>true</trac:systemProperties>
        <trac:inetAddress>true</trac:inetAddress>
        <trac:totalRulesFired>false</trac:totalRulesFired>
        <trac:totalRulesNotFired>false</trac:totalRulesNotFired>
        <trac:rules>false</trac:rules>
        <trac:rulesFired>true</trac:rulesFired>
        <trac:rulesNotFired>true</trac:rulesNotFired>
        <trac:totalTasksExecuted>false</trac:totalTasksExecuted>
        <trac:totalTasksNotExecuted>true</trac:totalTasksNotExecuted>
        <trac:tasks>false</trac:tasks>
        <trac:tasksExecuted>false</trac:tasksExecuted>
        <trac:tasksNotExecuted>false</trac:tasksNotExecuted>
        <trac:outputString>false</trac:outputString>
        <trac:inputParameters>false</trac:inputParameters>
        <trac:outputParameters>true</trac:outputParameters>
        <trac:workingMemory>true</trac:workingMemory>
        <trac:workingMemoryFilter>string</trac:workingMemoryFilter>
        <trac:executionEvents>false</trac:executionEvents>
        <trac:boundObjects>true</trac:boundObjects>
        <trac:boundObjectsSerializationType>ClassName</trac:boundObjectsSerializationType>
      </trac:decisionTraceFilter>



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



  • 7.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted 13 days ago

    infoRulesFired will return rule properties as well which is making response clumsy , I just need the business name of all the rules in response.

    Also can i do some thing in end of the rule flow to get the trace and explicitly set the rule names in my response object via any API.



    ------------------------------
    anubhav farkya
    ------------------------------



  • 8.  RE: ODM - How to get all rules fired and return them on response of decision service

    Posted 7 days ago

    Hello, 

    in ODM 9.0.0.1 (Dec 2024), we added a parameter to remove the details on rule properties when requesting the trace with infoRulesFired:

    Extract from ODM 9.0 What's New doc :

    Setting the InfoRulesFiredPropertiesFilter parameter
    When running a ruleset, if the rulesFired option of the decisionTraceFilter is applied, the InfoRulesFiredPropertiesFilter parameter can be used to filter the properties of the ruleInformation for the run rules.  Learn more...



    ------------------------------
    Antony Viaud
    Product Manager, IBM Decision Automation
    ------------------------------