Search in sources :

Example 11 with JSITUnaryTests

use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.

the class ItemDefinitionPropertyConverter method dmnFromWB.

public static JSITItemDefinition dmnFromWB(final ItemDefinition wb) {
    if (Objects.isNull(wb)) {
        return null;
    }
    final JSITItemDefinition result = new JSITItemDefinition();
    result.setId(wb.getId().getValue());
    final Optional<String> description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription()));
    description.ifPresent(result::setDescription);
    result.setName(wb.getName().getValue());
    QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef);
    result.setTypeLanguage(wb.getTypeLanguage());
    result.setIsCollection(wb.isIsCollection());
    final JSITUnaryTests utConverted = UnaryTestsPropertyConverter.dmnFromWB(wb.getAllowedValues());
    result.setAllowedValues(utConverted);
    for (ItemDefinition child : wb.getItemComponent()) {
        final JSITItemDefinition convertedChild = ItemDefinitionPropertyConverter.dmnFromWB(child);
        result.addItemComponent(convertedChild);
    }
    return result;
}
Also used : JSITUnaryTests(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests) JSITItemDefinition(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition) ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition) JSITItemDefinition(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition)

Example 12 with JSITUnaryTests

use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.

the class OutputClauseUnaryTestsPropertyConverterTest method testDMNFromWBWhenNull.

@Test
public void testDMNFromWBWhenNull() {
    final JSITUnaryTests dmn = OutputClauseUnaryTestsPropertyConverter.dmnFromWB(null);
    assertThat(dmn).isNull();
}
Also used : JSITUnaryTests(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests) Test(org.junit.Test)

Aggregations

JSITUnaryTests (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests)12 Test (org.junit.Test)4 UnaryTests (org.kie.workbench.common.dmn.api.definition.model.UnaryTests)4 JSITLiteralExpression (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITLiteralExpression)4 OutputClauseUnaryTests (org.kie.workbench.common.dmn.api.definition.model.OutputClauseUnaryTests)3 QName (javax.xml.namespace.QName)2 ConstraintType (org.kie.workbench.common.dmn.api.definition.model.ConstraintType)2 LiteralExpression (org.kie.workbench.common.dmn.api.definition.model.LiteralExpression)2 RuleAnnotationClauseText (org.kie.workbench.common.dmn.api.definition.model.RuleAnnotationClauseText)2 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)2 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)2 JSITDecisionRule (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionRule)2 JSITRuleAnnotation (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITRuleAnnotation)2 HashMap (java.util.HashMap)1 DecisionRule (org.kie.workbench.common.dmn.api.definition.model.DecisionRule)1 IsUnaryTests (org.kie.workbench.common.dmn.api.definition.model.IsUnaryTests)1 ItemDefinition (org.kie.workbench.common.dmn.api.definition.model.ItemDefinition)1 ExpressionLanguage (org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage)1 Text (org.kie.workbench.common.dmn.api.property.dmn.Text)1 JSITInputClause (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInputClause)1