use of org.camunda.bpm.engine.repository.ProcessDefinition in project camunda-bpm-platform by camunda.
the class FormServiceTest method testSubmitTaskFormContainingReadonlyVariable.
@Deployment
@Test
public void testSubmitTaskFormContainingReadonlyVariable() {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());
Task task = taskService.createTaskQuery().singleResult();
assertNotNull(task);
formService.submitTaskForm(task.getId(), new HashMap<String, Object>());
testRule.assertProcessEnded(processInstance.getId());
}
use of org.camunda.bpm.engine.repository.ProcessDefinition in project camunda-bpm-platform by camunda.
the class FormServiceTest method testGetStartFormByProcessDefinitionIdWithoutStartform.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
@Test
public void testGetStartFormByProcessDefinitionIdWithoutStartform() {
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list();
assertEquals(1, processDefinitions.size());
ProcessDefinition processDefinition = processDefinitions.get(0);
Object startForm = formService.getRenderedStartForm(processDefinition.getId());
assertNull(startForm);
}
use of org.camunda.bpm.engine.repository.ProcessDefinition in project camunda-bpm-platform by camunda.
the class FormServiceTest method testGetStartFormVariablesEnumType.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/form/FormServiceTest.startFormFieldsUnknownType.bpmn20.xml" })
@Test
public void testGetStartFormVariablesEnumType() {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
VariableMap startFormVariables = formService.getStartFormVariables(processDefinition.getId());
assertEquals("a", startFormVariables.get("enumField"));
assertEquals(ValueType.STRING, startFormVariables.getValueTyped("enumField").getType());
}
use of org.camunda.bpm.engine.repository.ProcessDefinition in project camunda-bpm-platform by camunda.
the class HtmlFormEngineTest method testRenderDateField.
@Deployment
public void testRenderDateField() {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
String renderedForm = (String) formService.getRenderedStartForm(processDefinition.getId());
String expectedForm = IoUtil.readFileAsString("org/camunda/bpm/engine/test/api/form/HtmlFormEngineTest.testRenderDateField.html");
assertHtmlEquals(expectedForm, renderedForm);
}
use of org.camunda.bpm.engine.repository.ProcessDefinition in project camunda-bpm-platform by camunda.
the class HtmlFormEngineTest method testBusinessKey.
@Deployment
public void testBusinessKey() {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
String renderedForm = (String) formService.getRenderedStartForm(processDefinition.getId());
String expectedForm = IoUtil.readFileAsString("org/camunda/bpm/engine/test/api/form/HtmlFormEngineTest.testBusinessKey.html");
assertHtmlEquals(expectedForm, renderedForm);
}
Aggregations