use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.
the class WebServiceCustomTaskTest method testUnmarshallTopLevelTaskTwoIncomesEmptyProperties.
@Ignore("The test is ignored because there is a bug in new Marshaller.\n" + "It should be enabled after these issues will be resolved:\n" + "https://issues.jboss.org/browse/JBPM-7072\n" + "https://issues.jboss.org/browse/JBPM-7726")
@Test
@Override
public void testUnmarshallTopLevelTaskTwoIncomesEmptyProperties() {
assertDiagram(getDiagram(), AMOUNT_OF_NODES_IN_DIAGRAM);
CustomTask emptyTopLevelTask = getTaskNodeById(getDiagram(), EMPTY_TWO_INCOMES_TOP_LEVEL_TASK_ID, TWO_INCOME_EDGES, HAS_OUTCOME_EDGE);
assertGeneralSet(emptyTopLevelTask.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertServiceTaskExecutionSet(emptyTopLevelTask.getExecutionSet(), EMPTY_VALUE, TASK_SCRIPT_JAVA_LANGUAGE, EMPTY_VALUE, TASK_SCRIPT_JAVA_LANGUAGE, IS_NOT_ASYNC, NOT_AD_HOC_AUTOSTART, EMPTY_VALUE);
assertDataIOSet(emptyTopLevelTask.getDataIOSet(), EMPTY_TASK_DATA_INPUT_OUTPUT);
}
use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.
the class NoWIDCustomTaskResolutionTest method testNoWIDPreserveProperties.
@Test
public void testNoWIDPreserveProperties() {
final Node customTaskNode = diagram.getGraph().getNode(CUSTOM_TASK_ID);
final View customTaskNodeContent = (View) customTaskNode.getContent();
final CustomTask customTask = (CustomTask) customTaskNodeContent.getDefinition();
assertTrue(customTask.getCategory().isEmpty());
assertTrue(customTask.getDescription().isEmpty());
assertEquals(CUSTOM_TASK_NAME, customTask.getName());
assertEquals(ASSIGNMENTS, customTask.getDataIOSet().getAssignmentsinfo().getValue());
assertTrue(customTask.getExecutionSet().getAdHocAutostart().getValue());
assertTrue(customTask.getExecutionSet().getIsAsync().getValue());
assertEquals(ON_ENTRY_SCRIPT, customTask.getExecutionSet().getOnEntryAction().getValue().toString());
assertEquals(ON_EXIT_SCRIPT, customTask.getExecutionSet().getOnExitAction().getValue().toString());
}
use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.
the class NoWIDCustomTaskResolutionTest method testNoWIDPreserveCustomTaskType.
@Test
public void testNoWIDPreserveCustomTaskType() {
final Node customTaskNode = diagram.getGraph().getNode(CUSTOM_TASK_ID);
final View customTaskNodeContent = (View) customTaskNode.getContent();
// Custom tasks shall remain as custom tasks after unmarshalling
assertTrue(customTaskNodeContent.getDefinition() instanceof CustomTask);
final CustomTask customTask = (CustomTask) customTaskNodeContent.getDefinition();
assertEquals(CUSTOM_TASK_TYPE, customTask.getTaskType().getRawType());
}
use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.
the class EmailCustomTaskTest method testUnmarshallSubprocessLevelTaskFilledProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelTaskFilledProperties() {
final String TASK_NAME_JAVA = "Email task10 name ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String TASK_DOCUMENTATION_JAVA = "Email task10 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String TASK_ON_ENTRY_ACTION_JAVA = "System.out.println(\"On Entry Action from Email Task.\");";
final String TASK_ON_EXIT_ACTION_JAVA = "System.out.println(\"On Exit Action from Email Task.\");";
final String TASK_NAME_JAVASCRIPT = "Email task13 name ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String TASK_DOCUMENTATION_JAVASCRIPT = "Email task13 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String TASK_ON_ENTRY_ACTION_JAVASCRIPT = "console.log(\"On Entry Action from Email Task.\");";
final String TASK_ON_EXIT_ACTION_JAVASCRIPT = "console.log(\"On Exit Action from Email Task.\");";
final String TASK_NAME_MVEL = "Email task16 name ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String TASK_DOCUMENTATION_MVEL = "Email task16 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String TASK_ON_ENTRY_ACTION_MVEL = "System.out.println(\"On Entry Action from Email Task.\");";
final String TASK_ON_EXIT_ACTION_MVEL = "System.out.println(\"On Exit Action from Email Task.\");";
final String TASK_DATA_INPUT_OUTPUT = "|Body:String,From:String,Subject:String,To:String,input:String||output:String|[din]processGlobalVar->input,[dout]output->processGlobalVar";
assertDiagram(getDiagram(), AMOUNT_OF_NODES_IN_DIAGRAM);
CustomTask filledSubprocessLevelTaskJava = getTaskNodeById(getDiagram(), FILLED_SUBPROCESS_LEVEL_TASK_JAVA_ID, ZERO_INCOME_EDGES, HAS_NO_OUTCOME_EDGE);
assertGeneralSet(filledSubprocessLevelTaskJava.getGeneral(), TASK_NAME_JAVA, TASK_DOCUMENTATION_JAVA);
assertServiceTaskExecutionSet(filledSubprocessLevelTaskJava.getExecutionSet(), TASK_ON_ENTRY_ACTION_JAVA, TASK_SCRIPT_JAVA_LANGUAGE, TASK_ON_EXIT_ACTION_JAVA, TASK_SCRIPT_JAVA_LANGUAGE, IS_ASYNC, AD_HOC_AUTOSTART, SLA_DUE_DATE);
assertDataIOSet(filledSubprocessLevelTaskJava.getDataIOSet(), TASK_DATA_INPUT_OUTPUT);
CustomTask filledSubprocessLevelTaskJavascript = getTaskNodeById(getDiagram(), FILLED_SUBPROCESS_LEVEL_TASK_JAVASCRIPT_ID, ZERO_INCOME_EDGES, HAS_NO_OUTCOME_EDGE);
assertGeneralSet(filledSubprocessLevelTaskJavascript.getGeneral(), TASK_NAME_JAVASCRIPT, TASK_DOCUMENTATION_JAVASCRIPT);
assertServiceTaskExecutionSet(filledSubprocessLevelTaskJavascript.getExecutionSet(), TASK_ON_ENTRY_ACTION_JAVASCRIPT, TASK_SCRIPT_JAVASCRIPT_LANGUAGE, TASK_ON_EXIT_ACTION_JAVASCRIPT, TASK_SCRIPT_JAVASCRIPT_LANGUAGE, IS_ASYNC, AD_HOC_AUTOSTART, SLA_DUE_DATE);
assertDataIOSet(filledSubprocessLevelTaskJavascript.getDataIOSet(), TASK_DATA_INPUT_OUTPUT);
CustomTask filledSubprocessLevelTaskMvel = getTaskNodeById(getDiagram(), FILLED_SUBPROCESS_LEVEL_TASK_MVEL_ID, ZERO_INCOME_EDGES, HAS_NO_OUTCOME_EDGE);
assertGeneralSet(filledSubprocessLevelTaskMvel.getGeneral(), TASK_NAME_MVEL, TASK_DOCUMENTATION_MVEL);
assertServiceTaskExecutionSet(filledSubprocessLevelTaskMvel.getExecutionSet(), TASK_ON_ENTRY_ACTION_MVEL, TASK_SCRIPT_MVEL_LANGUAGE, TASK_ON_EXIT_ACTION_MVEL, TASK_SCRIPT_MVEL_LANGUAGE, IS_ASYNC, AD_HOC_AUTOSTART, SLA_DUE_DATE);
assertDataIOSet(filledSubprocessLevelTaskMvel.getDataIOSet(), TASK_DATA_INPUT_OUTPUT);
}
use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.
the class EmailCustomTaskTest method testUnmarshallSubprocessLevelTaskTwoIncomesEmptyProperties.
@Ignore("The test is ignored because there is a bug in new Marshaller.\n" + "It should be enabled after these issues will be resolved:\n" + "https://issues.jboss.org/browse/JBPM-7072\n" + "https://issues.jboss.org/browse/JBPM-7726")
@Test
@Override
public void testUnmarshallSubprocessLevelTaskTwoIncomesEmptyProperties() {
assertDiagram(getDiagram(), AMOUNT_OF_NODES_IN_DIAGRAM);
CustomTask emptySubprocessLevelTask = getTaskNodeById(getDiagram(), EMPTY_TWO_INCOMES_SUBPROCESS_LEVEL_TASK_ID, TWO_INCOME_EDGES, HAS_OUTCOME_EDGE);
assertGeneralSet(emptySubprocessLevelTask.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertServiceTaskExecutionSet(emptySubprocessLevelTask.getExecutionSet(), EMPTY_VALUE, TASK_SCRIPT_JAVA_LANGUAGE, EMPTY_VALUE, TASK_SCRIPT_JAVA_LANGUAGE, IS_NOT_ASYNC, NOT_AD_HOC_AUTOSTART, EMPTY_VALUE);
assertDataIOSet(emptySubprocessLevelTask.getDataIOSet(), EMPTY_TASK_DATA_INPUT_OUTPUT);
}
Aggregations