@Test public void testWBFromDMN() { final org.kie.dmn.model.api.Invocation dmn = new TInvocation(); final org.kie.dmn.model.api.LiteralExpression literalExpression = new TLiteralExpression(); literalExpression.setId(EXPRESSION_UUID); dmn.setId(INVOCATION_UUID); dmn.setDescription(INVOCATION_DESCRIPTION); dmn.setTypeRef(new QName(INVOCATION_QNAME_LOCALPART)); dmn.setExpression(literalExpression); final Invocation wb = InvocationPropertyConverter.wbFromDMN(dmn, hasComponentWidthsConsumer); assertThat(wb).isNotNull(); assertThat(wb.getId()).isNotNull(); assertThat(wb.getId().getValue()).isEqualTo(INVOCATION_UUID); assertThat(wb.getDescription()).isNotNull(); assertThat(wb.getDescription().getValue()).isEqualTo(INVOCATION_DESCRIPTION); assertThat(wb.getTypeRef()).isNotNull(); assertThat(wb.getTypeRef().getLocalPart()).isEqualTo(INVOCATION_QNAME_LOCALPART); assertThat(wb.getExpression()).isNotNull(); assertThat(wb.getExpression().getId().getValue()).isEqualTo(EXPRESSION_UUID); verify(hasComponentWidthsConsumer).accept(eq(EXPRESSION_UUID), hasComponentWidthsCaptor.capture()); final HasComponentWidths hasComponentWidths = hasComponentWidthsCaptor.getValue(); assertThat(hasComponentWidths).isNotNull(); assertThat(hasComponentWidths).isEqualTo(wb.getExpression()); }
public static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { if (dmn == null) { return null; } final Id id = new Id(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn); final Invocation result = new Invocation(); result.setId(id); result.setDescription(description); result.setTypeRef(typeRef); final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); result.setExpression(convertedExpression); if (convertedExpression != null) { convertedExpression.setParent(result); } for (org.kie.dmn.model.api.Binding b : dmn.getBinding()) { final Binding bConverted = BindingPropertyConverter.wbFromDMN(b, hasComponentWidthsConsumer); if (bConverted != null) { bConverted.setParent(result); } result.getBinding().add(bConverted); } return result; }
InvocationPropertyConverter { public static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { if (dmn == null) { return null; } final Id id = new Id(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn); final Invocation result = new Invocation(); result.setId(id); result.setDescription(description); result.setTypeRef(typeRef); final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); result.setExpression(convertedExpression); if (convertedExpression != null) { convertedExpression.setParent(result); } for (org.kie.dmn.model.api.Binding b : dmn.getBinding()) { final Binding bConverted = BindingPropertyConverter.wbFromDMN(b, hasComponentWidthsConsumer); if (bConverted != null) { bConverted.setParent(result); } result.getBinding().add(bConverted); } return result; } }
InvocationPropertyConverter { public static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { if (dmn == null) { return null; } final Id id = new Id(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn); final Invocation result = new Invocation(); result.setId(id); result.setDescription(description); result.setTypeRef(typeRef); final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); result.setExpression(convertedExpression); if (convertedExpression != null) { convertedExpression.setParent(result); } for (org.kie.dmn.model.api.Binding b : dmn.getBinding()) { final Binding bConverted = BindingPropertyConverter.wbFromDMN(b, hasComponentWidthsConsumer); if (bConverted != null) { bConverted.setParent(result); } result.getBinding().add(bConverted); } return result; }  }
InvocationPropertyConverter { public static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { if (dmn == null) { return null; } final Id id = new Id(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn); final Invocation result = new Invocation(); result.setId(id); result.setDescription(description); result.setTypeRef(typeRef); final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); result.setExpression(convertedExpression); if (convertedExpression != null) { convertedExpression.setParent(result); } for (org.kie.dmn.model.api.Binding b : dmn.getBinding()) { final Binding bConverted = BindingPropertyConverter.wbFromDMN(b, hasComponentWidthsConsumer); if (bConverted != null) { bConverted.setParent(result); } result.getBinding().add(bConverted); } return result; }  static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn,
                                       final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer); static org.kie.dmn.model.api.Invocation dmnFromWB(final Invocation wb,
                                                             final Consumer<ComponentWidths> componentWidthsConsumer); }
InvocationPropertyConverter { public static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { if (dmn == null) { return null; } final Id id = new Id(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn); final Invocation result = new Invocation(); result.setId(id); result.setDescription(description); result.setTypeRef(typeRef); final Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); result.setExpression(convertedExpression); if (convertedExpression != null) { convertedExpression.setParent(result); } for (org.kie.dmn.model.api.Binding b : dmn.getBinding()) { final Binding bConverted = BindingPropertyConverter.wbFromDMN(b, hasComponentWidthsConsumer); if (bConverted != null) { bConverted.setParent(result); } result.getBinding().add(bConverted); } return result; }  static Invocation wbFromDMN(final org.kie.dmn.model.api.Invocation dmn,
                                       final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer); static org.kie.dmn.model.api.Invocation dmnFromWB(final Invocation wb,
                                                             final Consumer<ComponentWidths> componentWidthsConsumer);  }