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

Handle unordered typeRef with different default namespaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 7.63.0.Final
    • dmn engine
    • None
    • 2021 Week 49-51 (from Dec 6th)
    • 2
    • NEW
    • NEW

      In https://github.com/dmn-tck/tck/pull/390 , unordered typeRef is defined.

      <definitions namespace="http://www.montera.com.au/spec/DMN/0070-feel-instance-of" name="0070-feel-instance-of" id="_i9fboPUUEeesLuP4RHs4vA" xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      
          ...
          <itemDefinition name="tListOfFunctions" isCollection="true">
              <!-- note - the typeRef here has not yet been declared in the XML. This
              is on purpose to catch the assumption that item definitions are declared
              in a 'nice' order -->
              <typeRef>tStringFunctionWithSimpleTypedParams</typeRef>
          </itemDefinition>
      
          <itemDefinition name="tContextWithFunction">
              <itemComponent name="prop1">
                  <!-- note - the typeRef here has not yet been declared in the XML. This
                  is on purpose to catch the assumption that item definitions are declared
                  in a 'nice' order -->
                  <typeRef>tStringFunctionWithSimpleTypedParams</typeRef>
              </itemComponent>
          </itemDefinition>
      
          <itemDefinition name="tStringFunctionWithSimpleTypedParams">
              <functionItem outputTypeRef="string">
                  <parameters name="p1" typeRef="string"></parameters>
                  <parameters name="p2" typeRef="number"></parameters>
              </functionItem>
          </itemDefinition>
      

      Currently, drools fails with

      java.lang.RuntimeException: [Message [id=1, kieBase=defaultKieBase, level=ERROR, path=/home/tkobayas/usr/work/dmn-tck/390/tck/TestCases/compliance-level-3/0070-feel-instance-of/0070-feel-instance-of.dmn, line=51, column=-1
         text=DMN: Unable to resolve type reference '{https://www.omg.org/spec/DMN/20191111/MODEL/}tStringFunctionWithSimpleTypedParams' on node 'tListOfFunctions' (resource: /home/tkobayas/usr/work/dmn-tck/390/tck/TestCases/compliance-level-3/0070-feel-instance-of/0070-feel-instance-of.dmn, The listed type definition was not found) ], Message [id=2, kieBase=defaultKieBase, level=ERROR, path=/home/tkobayas/usr/work/dmn-tck/390/tck/TestCases/compliance-level-3/0070-feel-instance-of/0070-feel-instance-of.dmn, line=59, column=-1
      
         text=DMN: Unable to resolve type reference '{https://www.omg.org/spec/DMN/20191111/MODEL/}tStringFunctionWithSimpleTypedParams' on node 'tContextWithFunction' (resource: /home/tkobayas/usr/work/dmn-tck/390/tck/TestCases/compliance-level-3/0070-feel-instance-of/0070-feel-instance-of.dmn, The listed type definition was not found) ]]
      
      	at org.kie.internal.utils.KieHelper.getKieContainer(KieHelper.java:106)
      

      Note that namespace and xmlns attributes have different values, which doesn't happen with drools DMN Editor.

            rhn-support-tkobayas Toshiya Kobayashi
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: