Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6368

Trace constraint evaluation in Alpha Nodes

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • core engine
    • None
    • Undefined
    • NEW
    • NEW

    Description

      See https://stackoverflow.com/questions/67624815/how-to-validate-which-condition-in-the-drools-rule-is-failing/67667819?noredirect=1#comment119606560_67667819

      Users want to trace the constraint evaluation when the condition is not matched, as the current DebugAgendaEventListener won't cover when the predicate is false

      Beware of the performance risks as this is an hot path

      To get the original rute associated to the alpha node, ReteDumper.dumpAssociatedRulesRete(kbase) give the information.

      [JoinNode(8) - [ClassObjectType class=com.sample.Person]] : [Hello2]
      [LeftInputAdapterNode(7)] : [Hello2]
      [ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] : []
      [ObjectTypeNode(3)::EntryPoint::DEFAULT objectType=[ClassObjectType class=com.sample.Person] expiration=-1ms ] : [Hello1, Hello2]
      [AlphaTerminalNode(5)] : [Hello1]
      [RuleTerminalNode(9): rule=Hello2] : [Hello2]
      [AlphaNode(4) constraint=age > 20] : [Hello1]
      [RuleTerminalNode(6): rule=Hello1] : [Hello1]
      [EntryPointNode(1) EntryPoint::DEFAULT ] : []
      

      Attachments

        Activity

          People

            lmolteni@redhat.com Luca Molteni
            lmolteni@redhat.com Luca Molteni
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: