Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-1566

[SCESIM Editor] DMN Type with nested objects doesn’t works correctly

XMLWordPrintable

    • 5
    • 2020 Week 13-15 (from Mar 23), 2020 Week 16-18 (from Apr 13)

      How to reproduce it: Create a new SCESIM file in KOGITO passing "urgent.dmn" as DMN file
      Issue: An exception is thrown

      ErraiConsoleLogHandler.java:91 Error caused by: IllegalStateException: Item: Insured By refers to typeRef: tInsuranceCompany which can't be found. The item can be missing or required items sort is wrong
          at IllegalStateException_2_g$.createError_0_g$ [as createError_2_g$] (Throwable.java:120)
          at IllegalStateException_2_g$.initializeBackingError_0_g$ [as initializeBackingError_1_g$] (Throwable.java:112)
          at IllegalStateException_2_g$.Throwable_3_g$ (Throwable.java:66)
          at IllegalStateException_2_g$.Exception_3_g$ (Exception.java:29)
          at IllegalStateException_2_g$.RuntimeException_3_g$ (RuntimeException.java:29)
          at new IllegalStateException_2_g$ (IllegalStateException.java:28)
          at KogitoDMNServiceTestingImpl_1_g$.getDMNType_0_g$ [as getDMNType_2_g$] (AbstractKogitoDMNService.java:172)
          at KogitoDMNServiceTestingImpl_1_g$.getDMNType_0_g$ [as getDMNType_2_g$] (AbstractKogitoDMNService.java:184)
          at KogitoDMNServiceTestingImpl_1_g$.getDMNTypesMap_0_g$ [as getDMNTypesMap_2_g$] (AbstractKogitoDMNService.java:115)
          at KogitoDMNServiceTestingImpl_1_g$.getFactModelTuple_1_g$ [as getFactModelTuple_4_g$] (AbstractKogitoDMNService.java:64)
      

      Details: Point to start is here: AbstractKogitoDMNService.java:112
      Here_ ItemDefinitions_ are sorted following this logic: if a item refer to another itemdefition, the second one must be put before the first. An example:

      <itemDefinition name="tExample" typeRef = "tAnotherType">
      
      

      In this case tAnotherType is put before tExample.
      This is required because the method getDMNType():115 converts the an ItemDefinition in a ClientDMNType objects, and needs to have referred type into toReturn list.
      This approach works well in most cases. But unfortunately, it doesn't work in the case of itemDefinitions with nested attributes of Complex type, becaues the sort don't consider the case.
      To resolve the issue, an approach could be to don't use anymore the "sorting" approach, but passing the original itemDefinition list an process them in a "lazy" way

            dadossan Daniel José dos Santos (Inactive)
            dadossan Daniel José dos Santos (Inactive)
            Anna Dupliak Anna Dupliak
            Anna Dupliak Anna Dupliak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: