@Test public void testCompositeItemDefinition() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0008-LX-arithmetic.dmn", this.getClass() ); final DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/kie-dmn", "0008-LX-arithmetic" ); assertThat( dmnModel, notNullValue() ); final ItemDefNode itemDef = dmnModel.getItemDefinitionByName("tLoan" ); assertThat( itemDef.getName(), is( "tLoan" ) ); assertThat( itemDef.getId(), is( "tLoan" ) ); final DMNType type = itemDef.getType(); assertThat( type, is( notNullValue() ) ); assertThat( type.getName(), is( "tLoan" ) ); assertThat( type.getId(), is( "tLoan" ) ); assertThat( type, is( instanceOf( CompositeTypeImpl.class ) ) ); final CompositeTypeImpl compType = (CompositeTypeImpl) type; assertThat( compType.getFields().size(), is( 3 ) ); final DMNType principal = compType.getFields().get("principal" ); assertThat( principal, is( notNullValue() ) ); assertThat( principal.getName(), is( "number" ) ); assertThat( ((SimpleTypeImpl)principal).getFeelType(), is( BuiltInType.NUMBER ) ); final DMNType rate = compType.getFields().get("rate" ); assertThat( rate, is( notNullValue() ) ); assertThat( rate.getName(), is( "number" ) ); assertThat( ((SimpleTypeImpl)rate).getFeelType(), is( BuiltInType.NUMBER ) ); final DMNType termMonths = compType.getFields().get("termMonths" ); assertThat( termMonths, is( notNullValue() ) ); assertThat( termMonths.getName(), is( "number" ) ); assertThat( ((SimpleTypeImpl)termMonths).getFeelType(), is( BuiltInType.NUMBER ) ); }