@Test public void testDmnFromWb() { final org.kie.workbench.common.dmn.api.definition.model.UnaryTests inputEntry = new org.kie.workbench.common.dmn.api.definition.model.UnaryTests(); final org.kie.workbench.common.dmn.api.definition.model.LiteralExpression outputEntry = new org.kie.workbench.common.dmn.api.definition.model.LiteralExpression(); final org.kie.workbench.common.dmn.api.definition.model.DecisionRule wb = new org.kie.workbench.common.dmn.api.definition.model.DecisionRule(); wb.getId().setValue(ID); wb.getDescription().setValue(DESCRIPTION); wb.getInputEntry().add(inputEntry); wb.getOutputEntry().add(outputEntry); final org.kie.dmn.model.api.DecisionRule dmn = DecisionRulePropertyConverter.dmnFromWB(wb); assertEquals(ID, dmn.getId()); assertEquals(DESCRIPTION, dmn.getDescription()); assertEquals(dmn, dmn.getInputEntry().get(0).getParent()); assertEquals(dmn, dmn.getOutputEntry().get(0).getParent()); }
public static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb) { final org.kie.dmn.model.api.DecisionRule result = new org.kie.dmn.model.v1_2.TDecisionRule(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); for (final RuleAnnotationClauseText ruleAnnotationClauseText : wb.getAnnotationEntry()) { final org.kie.dmn.model.api.RuleAnnotation ruleAnnotation = RuleAnnotationClauseTextConverter.dmnFromWB(ruleAnnotationClauseText); if (ruleAnnotation != null) { ruleAnnotation.setParent(result); } result.getAnnotationEntry().add(ruleAnnotation); } for (final UnaryTests ie : wb.getInputEntry()) { final org.kie.dmn.model.api.UnaryTests inputEntryConverted = UnaryTestsPropertyConverter.dmnFromWB(ie); if (inputEntryConverted != null) { inputEntryConverted.setParent(result); } result.getInputEntry().add(inputEntryConverted); } for (final LiteralExpression oe : wb.getOutputEntry()) { final org.kie.dmn.model.api.LiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.dmnFromWB(oe); if (outputEntryConverted != null) { outputEntryConverted.setParent(result); } result.getOutputEntry().add(outputEntryConverted); } return result; }
DecisionRulePropertyConverter { public static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb) { final org.kie.dmn.model.api.DecisionRule result = new org.kie.dmn.model.v1_2.TDecisionRule(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); for (final RuleAnnotationClauseText ruleAnnotationClauseText : wb.getAnnotationEntry()) { final org.kie.dmn.model.api.RuleAnnotation ruleAnnotation = RuleAnnotationClauseTextConverter.dmnFromWB(ruleAnnotationClauseText); if (ruleAnnotation != null) { ruleAnnotation.setParent(result); } result.getAnnotationEntry().add(ruleAnnotation); } for (final UnaryTests ie : wb.getInputEntry()) { final org.kie.dmn.model.api.UnaryTests inputEntryConverted = UnaryTestsPropertyConverter.dmnFromWB(ie); if (inputEntryConverted != null) { inputEntryConverted.setParent(result); } result.getInputEntry().add(inputEntryConverted); } for (final LiteralExpression oe : wb.getOutputEntry()) { final org.kie.dmn.model.api.LiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.dmnFromWB(oe); if (outputEntryConverted != null) { outputEntryConverted.setParent(result); } result.getOutputEntry().add(outputEntryConverted); } return result; } }
DecisionRulePropertyConverter { public static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb) { final org.kie.dmn.model.api.DecisionRule result = new org.kie.dmn.model.v1_2.TDecisionRule(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); for (final RuleAnnotationClauseText ruleAnnotationClauseText : wb.getAnnotationEntry()) { final org.kie.dmn.model.api.RuleAnnotation ruleAnnotation = RuleAnnotationClauseTextConverter.dmnFromWB(ruleAnnotationClauseText); if (ruleAnnotation != null) { ruleAnnotation.setParent(result); } result.getAnnotationEntry().add(ruleAnnotation); } for (final UnaryTests ie : wb.getInputEntry()) { final org.kie.dmn.model.api.UnaryTests inputEntryConverted = UnaryTestsPropertyConverter.dmnFromWB(ie); if (inputEntryConverted != null) { inputEntryConverted.setParent(result); } result.getInputEntry().add(inputEntryConverted); } for (final LiteralExpression oe : wb.getOutputEntry()) { final org.kie.dmn.model.api.LiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.dmnFromWB(oe); if (outputEntryConverted != null) { outputEntryConverted.setParent(result); } result.getOutputEntry().add(outputEntryConverted); } return result; }  }
DecisionRulePropertyConverter { public static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb) { final org.kie.dmn.model.api.DecisionRule result = new org.kie.dmn.model.v1_2.TDecisionRule(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); for (final RuleAnnotationClauseText ruleAnnotationClauseText : wb.getAnnotationEntry()) { final org.kie.dmn.model.api.RuleAnnotation ruleAnnotation = RuleAnnotationClauseTextConverter.dmnFromWB(ruleAnnotationClauseText); if (ruleAnnotation != null) { ruleAnnotation.setParent(result); } result.getAnnotationEntry().add(ruleAnnotation); } for (final UnaryTests ie : wb.getInputEntry()) { final org.kie.dmn.model.api.UnaryTests inputEntryConverted = UnaryTestsPropertyConverter.dmnFromWB(ie); if (inputEntryConverted != null) { inputEntryConverted.setParent(result); } result.getInputEntry().add(inputEntryConverted); } for (final LiteralExpression oe : wb.getOutputEntry()) { final org.kie.dmn.model.api.LiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.dmnFromWB(oe); if (outputEntryConverted != null) { outputEntryConverted.setParent(result); } result.getOutputEntry().add(outputEntryConverted); } return result; }  static DecisionRule wbFromDMN(final org.kie.dmn.model.api.DecisionRule dmn); static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb); }
DecisionRulePropertyConverter { public static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb) { final org.kie.dmn.model.api.DecisionRule result = new org.kie.dmn.model.v1_2.TDecisionRule(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); for (final RuleAnnotationClauseText ruleAnnotationClauseText : wb.getAnnotationEntry()) { final org.kie.dmn.model.api.RuleAnnotation ruleAnnotation = RuleAnnotationClauseTextConverter.dmnFromWB(ruleAnnotationClauseText); if (ruleAnnotation != null) { ruleAnnotation.setParent(result); } result.getAnnotationEntry().add(ruleAnnotation); } for (final UnaryTests ie : wb.getInputEntry()) { final org.kie.dmn.model.api.UnaryTests inputEntryConverted = UnaryTestsPropertyConverter.dmnFromWB(ie); if (inputEntryConverted != null) { inputEntryConverted.setParent(result); } result.getInputEntry().add(inputEntryConverted); } for (final LiteralExpression oe : wb.getOutputEntry()) { final org.kie.dmn.model.api.LiteralExpression outputEntryConverted = LiteralExpressionPropertyConverter.dmnFromWB(oe); if (outputEntryConverted != null) { outputEntryConverted.setParent(result); } result.getOutputEntry().add(outputEntryConverted); } return result; }  static DecisionRule wbFromDMN(final org.kie.dmn.model.api.DecisionRule dmn); static org.kie.dmn.model.api.DecisionRule dmnFromWB(final DecisionRule wb);  }