use of org.camunda.bpm.dmn.engine.impl.type.DefaultTypeDefinition in project camunda-engine-dmn by camunda.
the class DmnTransformTest method shouldTransformOutputs.
@Test
public void shouldTransformOutputs() {
DmnDecisionImpl decisionEntity = (DmnDecisionImpl) parseDecisionFromFile("decision1", TRANSFORM_DMN);
DmnDecisionTableImpl decisionTable = (DmnDecisionTableImpl) decisionEntity.getDecisionLogic();
List<DmnDecisionTableOutputImpl> outputs = decisionTable.getOutputs();
assertThat(outputs).hasSize(2);
DmnDecisionTableOutputImpl output = outputs.get(0);
assertThat(output.getId()).isEqualTo("output1");
assertThat(output.getName()).isEqualTo("camunda");
assertThat(output.getOutputName()).isEqualTo("camunda");
assertThat(output.getTypeDefinition()).isNotNull();
assertThat(output.getTypeDefinition().getTypeName()).isEqualTo("string");
output = outputs.get(1);
assertThat(output.getId()).isEqualTo("output2");
assertThat(output.getName()).isNull();
assertThat(output.getOutputName()).isEqualTo("out2");
assertThat(output.getTypeDefinition()).isNotNull();
assertThat(output.getTypeDefinition()).isEqualTo(new DefaultTypeDefinition());
}
use of org.camunda.bpm.dmn.engine.impl.type.DefaultTypeDefinition in project camunda-engine-dmn by camunda.
the class DmnTransformTest method shouldTransformInputs.
@Test
public void shouldTransformInputs() {
DmnDecisionImpl decisionEntity = (DmnDecisionImpl) parseDecisionFromFile("decision1", TRANSFORM_DMN);
DmnDecisionTableImpl decisionTable = (DmnDecisionTableImpl) decisionEntity.getDecisionLogic();
List<DmnDecisionTableInputImpl> inputs = decisionTable.getInputs();
assertThat(inputs).hasSize(2);
DmnDecisionTableInputImpl input = inputs.get(0);
assertThat(input.getId()).isEqualTo("input1");
assertThat(input.getName()).isEqualTo("camunda");
assertThat(input.getInputVariable()).isEqualTo("camunda");
DmnExpressionImpl inputExpression = input.getExpression();
assertThat(inputExpression).isNotNull();
assertThat(inputExpression.getId()).isEqualTo("inputExpression");
assertThat(inputExpression.getName()).isNull();
assertThat(inputExpression.getExpressionLanguage()).isEqualTo("camunda");
assertThat(inputExpression.getExpression()).isEqualTo("camunda");
assertThat(inputExpression.getTypeDefinition()).isNotNull();
assertThat(inputExpression.getTypeDefinition().getTypeName()).isEqualTo("string");
input = inputs.get(1);
assertThat(input.getId()).isEqualTo("input2");
assertThat(input.getName()).isNull();
assertThat(input.getInputVariable()).isEqualTo(DmnDecisionTableInputImpl.DEFAULT_INPUT_VARIABLE_NAME);
inputExpression = input.getExpression();
assertThat(inputExpression).isNotNull();
assertThat(inputExpression.getId()).isNull();
assertThat(inputExpression.getName()).isNull();
assertThat(inputExpression.getExpressionLanguage()).isNull();
assertThat(inputExpression.getExpression()).isNull();
assertThat(inputExpression.getTypeDefinition()).isNotNull();
assertThat(inputExpression.getTypeDefinition()).isEqualTo(new DefaultTypeDefinition());
}
Aggregations