use of org.kie.workbench.common.dmn.api.definition.model.InputData in project kie-wb-common by kiegroup.
the class DMNIncludedModelHandlerTest method makeInputData.
private InputData makeInputData(final String name, final String type, final boolean allowOnlyVisualChange) {
final InputData inputData = new InputData();
setName(inputData, name);
setType(inputData, type);
inputData.setAllowOnlyVisualChange(allowOnlyVisualChange);
return inputData;
}
use of org.kie.workbench.common.dmn.api.definition.model.InputData in project kie-wb-common by kiegroup.
the class DefaultValueUtilitiesTest method testUpdateNewNodeName_DecisionService.
@Test
public void testUpdateNewNodeName_DecisionService() {
// Add some existing nodes to ensure naming is not affected by existing content
graph.addNode(makeMockNode(new BusinessKnowledgeModel()));
graph.addNode(makeMockNode(new Decision()));
graph.addNode(makeMockNode(new InputData()));
graph.addNode(makeMockNode(new KnowledgeSource()));
final DecisionService decisionService1 = new DecisionService();
final DecisionService decisionService2 = new DecisionService();
final DecisionService decisionService3 = new DecisionService();
final DecisionService decisionService4 = new DecisionService();
assertUpdateNewNodeName(decisionService1, decisionService2, (decisionService) -> decisionService.getName().getValue(), () -> DecisionService.class.getSimpleName() + "-1", () -> DecisionService.class.getSimpleName() + "-2");
// Update existing names manually and add two more
decisionService1.getName().setValue("decisionService");
decisionService2.getName().setValue(DecisionService.class.getSimpleName() + "-5");
assertUpdateNewNodeName(decisionService3, decisionService4, (decisionService) -> decisionService.getName().getValue(), () -> DecisionService.class.getSimpleName() + "-6", () -> DecisionService.class.getSimpleName() + "-7");
}
use of org.kie.workbench.common.dmn.api.definition.model.InputData in project kie-wb-common by kiegroup.
the class DefaultValueUtilitiesTest method testUpdateNewNodeName_InputData.
@Test
public void testUpdateNewNodeName_InputData() {
// Add some existing nodes to ensure naming is not affected by existing content
graph.addNode(makeMockNode(new BusinessKnowledgeModel()));
graph.addNode(makeMockNode(new Decision()));
graph.addNode(makeMockNode(new KnowledgeSource()));
graph.addNode(makeMockNode(new TextAnnotation()));
final InputData inputData1 = new InputData();
final InputData inputData2 = new InputData();
final InputData inputData3 = new InputData();
final InputData inputData4 = new InputData();
assertUpdateNewNodeName(inputData1, inputData2, (inputData) -> inputData.getName().getValue(), () -> InputData.class.getSimpleName() + "-1", () -> InputData.class.getSimpleName() + "-2");
// Update existing names manually and add two more
inputData1.getName().setValue("inputData");
inputData2.getName().setValue(InputData.class.getSimpleName() + "-5");
assertUpdateNewNodeName(inputData3, inputData4, (inputData) -> inputData.getName().getValue(), () -> InputData.class.getSimpleName() + "-6", () -> InputData.class.getSimpleName() + "-7");
}
use of org.kie.workbench.common.dmn.api.definition.model.InputData in project kie-wb-common by kiegroup.
the class DefaultValueUtilitiesTest method testUpdateNewNodeName_TextAnnotation.
@Test
public void testUpdateNewNodeName_TextAnnotation() {
// Add some existing nodes to ensure naming is not affected by existing content
graph.addNode(makeMockNode(new BusinessKnowledgeModel()));
graph.addNode(makeMockNode(new Decision()));
graph.addNode(makeMockNode(new InputData()));
graph.addNode(makeMockNode(new KnowledgeSource()));
final TextAnnotation textAnnotation1 = new TextAnnotation();
final TextAnnotation textAnnotation2 = new TextAnnotation();
final TextAnnotation textAnnotation3 = new TextAnnotation();
final TextAnnotation textAnnotation4 = new TextAnnotation();
assertUpdateNewNodeName(textAnnotation1, textAnnotation2, (textAnnotation) -> textAnnotation.getText().getValue(), () -> TextAnnotation.class.getSimpleName() + "-1", () -> TextAnnotation.class.getSimpleName() + "-2");
// Update existing names manually and add two more
textAnnotation1.getText().setValue("textAnnotation");
textAnnotation2.getText().setValue(TextAnnotation.class.getSimpleName() + "-5");
assertUpdateNewNodeName(textAnnotation3, textAnnotation4, (textAnnotation) -> textAnnotation.getText().getValue(), () -> TextAnnotation.class.getSimpleName() + "-6", () -> TextAnnotation.class.getSimpleName() + "-7");
}
use of org.kie.workbench.common.dmn.api.definition.model.InputData in project kie-wb-common by kiegroup.
the class DecisionServiceParametersListWidgetTest method createInputData.
private InputData createInputData(final String name, final String type) {
final InputData input = mock(InputData.class);
final InformationItemPrimary variable = mock(InformationItemPrimary.class);
final QName typeRef = mock(QName.class);
when(input.getVariable()).thenReturn(variable);
when(input.getName()).thenReturn(new Name(name));
when(typeRef.getLocalPart()).thenReturn(type);
when(variable.getTypeRef()).thenReturn(typeRef);
return input;
}
Aggregations