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

DMN ItemDefinition dependencies ordering

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.Final
    • 7.0.0.CR3
    • dmn engine
    • None
    • NEW
    • NEW

    Description

      Using Java-api Comparator is not easily suitable to address the problem of ordering the ItemDefinition by their dependencies.

      If the Comparator is used to check purely for dependencies, returning 0 for indipendent elements, assume the following:

      X
      Y -> Z
      

      where X is independent from Y, Z; and Y depends on Z.

      compare(X, Y) == 0 // by definition above
      
      compare(X, Z) == 0 // still, by definition above, X is independent also from Z
      compare(Y, Z) == 1 // because Y depends on Z, Y is bigger than Z.
      

      The above breaks the API contract in the Java-API Comparator where stating:

      Finally, the implementor must ensure that compare(x, y)==0 implies that sgn(compare(x, z))==sgn(compare(y, z)) for all z.

      Attachments

        Activity

          People

            mmortari@redhat.com Matteo Mortari
            mmortari@redhat.com Matteo Mortari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: