use of org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel in project kie-wb-common by kiegroup.
the class BPMNFormModelGeneratorImplTest method testCorrectTaskFormModelIsGeneratedForTaskWithDifferentInputsAndOutputsInAdHocSubprocess.
@Test
public void testCorrectTaskFormModelIsGeneratedForTaskWithDifferentInputsAndOutputsInAdHocSubprocess() {
final String TASK_ID = "_D3B8EE8F-5402-408D-815D-FFE1BAD943D9", TASK_NAME = "taskWithDifferentInputsAndOutputs";
final Map<String, String> EXPECTED_TASK_VARIABLES = new HashMap<String, String>() {
{
putAll(EXPECTED_INPUT_VARIABLES);
putAll(EXPECTED_OUTPUT_VARIABLES);
}
};
TaskFormModel taskFormModel = generator.generateTaskFormModel(processWithAllVariablesDefinitions, TASK_ID, path);
assertTaskFormModelIsCorrect(taskFormModel, PROCESS_WITH_ALL_VARIABLES_ID, TASK_NAME);
assertJBPMVariablesAreCorrect(taskFormModel, EXPECTED_TASK_VARIABLES);
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel in project kie-wb-common by kiegroup.
the class BPMNFormModelGeneratorImplTest method testGenerateAllForProcessWithAllPossibleProcessVariables.
@Test
public void testGenerateAllForProcessWithAllPossibleProcessVariables() {
final Map<String, String> EXPECTED_PROCESS_VARIABLES = new HashMap<String, String>() {
{
put("string", String.class.getName());
put("integer", Integer.class.getName());
put("boolean", Boolean.class.getName());
put("float", Float.class.getName());
put("object", Object.class.getName());
put("dataObject", DATA_OBJECT_TYPE);
put("customType", CUSTOM_TYPE);
}
};
// generate all = generateProcessFormModel + generateTaskFormModels
BusinessProcessFormModel processFormModel = generator.generateProcessFormModel(processWithAllVariablesDefinitions, path);
assertProcessFormModelFieldsAreCorrect(processFormModel, PROCESS_WITH_ALL_VARIABLES_NAME);
assertJBPMVariablesAreCorrect(processFormModel, EXPECTED_PROCESS_VARIABLES);
List<TaskFormModel> taskFormModels = generator.generateTaskFormModels(processWithAllVariablesDefinitions, path);
// taskOnlyWithOutputs-taskform, emptyTask-taskform, taskOnlyWithInputs-taskform, taskWithDifferentInputsAndOutputs-taskform, taskWithTheSameInputsAndOutputs-taskform
final int EXPECTED_NUMBER_OF_HUMAN_TASKS = 5;
assertEquals("Forms should be generated for all human tasks including tasks in subprocesses and swimlanes", EXPECTED_NUMBER_OF_HUMAN_TASKS, taskFormModels.size());
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel in project kie-wb-common by kiegroup.
the class BPMNFormModelGeneratorImplTest method testCorrectTaskFormModelIsGeneratedForTaskThatContainsOnlyOutputsInEmbeddedSubprocess.
@Test
public void testCorrectTaskFormModelIsGeneratedForTaskThatContainsOnlyOutputsInEmbeddedSubprocess() {
final String TASK_ID = "_9E9EAE16-F9F4-49D0-854D-0D2C8CB9382F", TASK_NAME = "taskOnlyWithOutputs";
TaskFormModel taskFormModel = generator.generateTaskFormModel(processWithAllVariablesDefinitions, TASK_ID, path);
assertTaskFormModelIsCorrect(taskFormModel, PROCESS_WITH_ALL_VARIABLES_ID, TASK_NAME);
assertJBPMVariablesAreCorrect(taskFormModel, EXPECTED_OUTPUT_VARIABLES);
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel in project kie-wb-common by kiegroup.
the class BPMNFormModelGeneratorImplTest method testGenerateTaskFormModelForTaskWithSharedForm.
@Test
public void testGenerateTaskFormModelForTaskWithSharedForm() {
final String[] TASK_IDS = new String[] { "_77BDDEC9-0D5E-4C46-8AD6-1B528836A22B", "_C976E341-8E35-42C7-B878-67049CE63E5F", "_27F23135-87E9-47C5-9B97-DA793699E8CF" };
final String TASK_NAME = "task";
TaskFormModel[] generatedModels = new TaskFormModel[TASK_IDS.length];
for (int i = 0; i < TASK_IDS.length; i++) {
generatedModels[i] = generator.generateTaskFormModel(processWithSharedForms, TASK_IDS[i], path);
assertNotNull(generatedModels[i]);
assertTaskFormModelIsCorrect(generatedModels[i], PROCESS_WITH_SHARED_FORMS_ID, TASK_NAME);
checkExpectedMergedFormVariables(generatedModels[i]);
}
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel in project kie-wb-common by kiegroup.
the class BPMNFormModelGeneratorImplTest method testCorrectTaskFormModelIsGeneratedForTaskWithoutAnyInputsOrOutputsInSwimlane.
@Test
public void testCorrectTaskFormModelIsGeneratedForTaskWithoutAnyInputsOrOutputsInSwimlane() {
final String TASK_ID = "_23BBA464-615A-405F-8C3B-4F643BE522D6", TASK_NAME = "emptyTask";
TaskFormModel taskFormModel = generator.generateTaskFormModel(processWithAllVariablesDefinitions, TASK_ID, path);
assertTaskFormModelIsCorrect(taskFormModel, PROCESS_WITH_ALL_VARIABLES_ID, TASK_NAME);
assertTrue(taskFormModel.getProperties().isEmpty());
}
Aggregations