@Test public void testWBFromDMN() { final org.kie.dmn.model.api.ContextEntry dmn = new TContextEntry(); final org.kie.dmn.model.api.InformationItem informationItem = new TInformationItem(); dmn.setVariable(informationItem); final org.kie.dmn.model.api.LiteralExpression literalExpression = new TLiteralExpression(); literalExpression.setId(EXPRESSION_UUID); dmn.setExpression(literalExpression); final ContextEntry wb = ContextEntryPropertyConverter.wbFromDMN(dmn, hasComponentWidthsConsumer); assertThat(wb).isNotNull(); assertThat(wb.getVariable()).isNotNull(); 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 ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable()); final Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); final ContextEntry result = new ContextEntry(); if (Objects.nonNull(variable)) { variable.setParent(result); } result.setVariable(variable); if (Objects.nonNull(expression)) { expression.setParent(result); } result.setExpression(expression); return result; }
ContextEntryPropertyConverter { public static ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable()); final Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); final ContextEntry result = new ContextEntry(); if (Objects.nonNull(variable)) { variable.setParent(result); } result.setVariable(variable); if (Objects.nonNull(expression)) { expression.setParent(result); } result.setExpression(expression); return result; } }
ContextEntryPropertyConverter { public static ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable()); final Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); final ContextEntry result = new ContextEntry(); if (Objects.nonNull(variable)) { variable.setParent(result); } result.setVariable(variable); if (Objects.nonNull(expression)) { expression.setParent(result); } result.setExpression(expression); return result; }  }
ContextEntryPropertyConverter { public static ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable()); final Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); final ContextEntry result = new ContextEntry(); if (Objects.nonNull(variable)) { variable.setParent(result); } result.setVariable(variable); if (Objects.nonNull(expression)) { expression.setParent(result); } result.setExpression(expression); return result; }  static ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn,
                                         final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer); static org.kie.dmn.model.api.ContextEntry dmnFromWB(final ContextEntry wb,
                                                               final Consumer<ComponentWidths> componentWidthsConsumer); }
ContextEntryPropertyConverter { public static ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable()); final Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression(), hasComponentWidthsConsumer); final ContextEntry result = new ContextEntry(); if (Objects.nonNull(variable)) { variable.setParent(result); } result.setVariable(variable); if (Objects.nonNull(expression)) { expression.setParent(result); } result.setExpression(expression); return result; }  static ContextEntry wbFromDMN(final org.kie.dmn.model.api.ContextEntry dmn,
                                         final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer); static org.kie.dmn.model.api.ContextEntry dmnFromWB(final ContextEntry wb,
                                                               final Consumer<ComponentWidths> componentWidthsConsumer);  }