@Test public void testDmnFromWbWithAnnotationRules() { final org.kie.workbench.common.dmn.api.definition.model.DecisionRule wb = new org.kie.workbench.common.dmn.api.definition.model.DecisionRule(); final String annotation1 = "the text one"; final String annotation2 = "the text two"; final RuleAnnotationClauseText ruleAnnotation1 = createWbRuleAnnotation(annotation1); final RuleAnnotationClauseText ruleAnnotation2 = createWbRuleAnnotation(annotation2); wb.getAnnotationEntry().add(ruleAnnotation1); wb.getAnnotationEntry().add(ruleAnnotation2); final org.kie.dmn.model.api.DecisionRule dmn = DecisionRulePropertyConverter.dmnFromWB(wb); assertEquals(2, dmn.getAnnotationEntry().size()); assertEquals(annotation1, dmn.getAnnotationEntry().get(0).getText()); assertEquals(annotation2, dmn.getAnnotationEntry().get(1).getText()); }
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);  }