Search in sources :

Example 1 with DmnModelResource

use of org.camunda.bpm.model.dmn.util.DmnModelResource in project camunda-dmn-model by camunda.

the class ExpressionLanguageTest method shouldReadExpressionLanguage.

@Test
@DmnModelResource(resource = EXPRESSION_LANGUAGE_DMN)
public void shouldReadExpressionLanguage() {
    Definitions definitions = modelInstance.getDefinitions();
    assertThat(definitions.getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
    DecisionTable decisionTable = modelInstance.getModelElementById("decisionTable");
    Input input = decisionTable.getInputs().iterator().next();
    assertThat(input.getInputExpression().getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
    assertThat(input.getInputValues().getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
    Output output = decisionTable.getOutputs().iterator().next();
    assertThat(output.getOutputValues().getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
    Rule rule = decisionTable.getRules().iterator().next();
    InputEntry inputEntry = rule.getInputEntries().iterator().next();
    assertThat(inputEntry.getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
    OutputEntry outputEntry = rule.getOutputEntries().iterator().next();
    assertThat(outputEntry.getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
}
Also used : DecisionTable(org.camunda.bpm.model.dmn.instance.DecisionTable) Input(org.camunda.bpm.model.dmn.instance.Input) OutputEntry(org.camunda.bpm.model.dmn.instance.OutputEntry) Definitions(org.camunda.bpm.model.dmn.instance.Definitions) Output(org.camunda.bpm.model.dmn.instance.Output) Rule(org.camunda.bpm.model.dmn.instance.Rule) InputEntry(org.camunda.bpm.model.dmn.instance.InputEntry) Test(org.junit.Test) DmnModelResource(org.camunda.bpm.model.dmn.util.DmnModelResource)

Aggregations

DecisionTable (org.camunda.bpm.model.dmn.instance.DecisionTable)1 Definitions (org.camunda.bpm.model.dmn.instance.Definitions)1 Input (org.camunda.bpm.model.dmn.instance.Input)1 InputEntry (org.camunda.bpm.model.dmn.instance.InputEntry)1 Output (org.camunda.bpm.model.dmn.instance.Output)1 OutputEntry (org.camunda.bpm.model.dmn.instance.OutputEntry)1 Rule (org.camunda.bpm.model.dmn.instance.Rule)1 DmnModelResource (org.camunda.bpm.model.dmn.util.DmnModelResource)1 Test (org.junit.Test)1