use of org.kie.dmn.model.api.Definitions in project drools by kiegroup.
the class SignavioTest method testUnmarshall.
@Test
public void testUnmarshall() {
DMNRuntime runtime = createRuntime("Test_Signavio_multiple.dmn");
DMNModel model0 = runtime.getModels().get(0);
Definitions definitions = model0.getDefinitions();
DRGElement decision = definitions.getDrgElement().stream().filter(e -> e.getName().equals("greetingForEachPersonInPersons")).findFirst().orElseThrow(IllegalStateException::new);
Object extElement = decision.getExtensionElements().getAny().get(0);
assertThat(extElement, is(instanceOf(MultiInstanceDecisionLogic.class)));
MultiInstanceDecisionLogic mid = (MultiInstanceDecisionLogic) extElement;
LOG.info("{}", mid);
assertThat(mid.getIterationExpression(), is("persons"));
assertThat(mid.getIteratorShapeId(), is("id-707bbdf74438414623ac5d7067805b38"));
assertThat(mid.getAggregationFunction(), is("COLLECT"));
assertThat(mid.getTopLevelDecisionId(), is("id-7a23e2f201e3e0db3c991313cff5cd2b"));
}
use of org.kie.dmn.model.api.Definitions in project drools by kiegroup.
the class ValidatorTest method testINVOCATION_MISSING_TARGETRbis.
@Ignore("known current limitation")
@Test
public void testINVOCATION_MISSING_TARGETRbis() {
Definitions definitions = utilDefinitions("INVOCATION_MISSING_TARGETbis.dmn", "INVOCATION_MISSING_TARGETbis");
List<DMNMessage> validate = validator.validate(definitions);
// assertTrue( validate.stream().anyMatch( p -> p.getMessageType().equals( DMNMessageType.INVOCATION_MISSING_TARGET ) ) );
}
use of org.kie.dmn.model.api.Definitions in project drools by kiegroup.
the class ValidatorTest method testDryRun.
@Test
public void testDryRun() {
DMNRuntime runtime = DMNRuntimeUtil.createRuntime("0001-input-data-string.dmn", DMNInputRuntimeTest.class);
DMNModel dmnModel = runtime.getModel("https://github.com/kiegroup/drools/kie-dmn", "_0001-input-data-string");
assertThat(dmnModel, notNullValue());
Definitions definitions = dmnModel.getDefinitions();
assertThat(definitions, notNullValue());
DMNValidatorFactory.newValidator().validate(definitions);
}
use of org.kie.dmn.model.api.Definitions in project drools by kiegroup.
the class ValidatorTest method testINVOCATION_MISSING_TARGET.
@Test
@Ignore("Needs to be improved as invocations can be used to invoke functions node defined in BKMs. E.g., FEEL built in functions, etc.")
public void testINVOCATION_MISSING_TARGET() {
Definitions definitions = utilDefinitions("INVOCATION_MISSING_TARGET.dmn", "INVOCATION_MISSING_TARGET");
List<DMNMessage> validate = validator.validate(definitions);
// assertTrue( validate.stream().anyMatch( p -> p.getMessageType().equals( DMNMessageType.INVOCATION_MISSING_TARGET ) ) );
}
use of org.kie.dmn.model.api.Definitions in project drools by kiegroup.
the class ValidatorTest method testMACDInputDefinitions.
@Test
public void testMACDInputDefinitions() {
DMNRuntime runtime = DMNRuntimeUtil.createRuntime("MACD-enhanced_iteration.dmn", DMNInputRuntimeTest.class);
DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_6cfe7d88-6741-45d1-968c-b61a597d0964", "MACD-enhanced iteration");
assertThat(dmnModel, notNullValue());
Definitions definitions = dmnModel.getDefinitions();
assertThat(definitions, notNullValue());
List<DMNMessage> messages = DMNValidatorFactory.newValidator().validate(definitions, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(messages.toString(), messages.size(), is(0));
}
Aggregations