Search in sources :

Example 16 with ProcessDefinition

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());
}
Also used : Task(org.camunda.bpm.engine.task.Task) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 17 with ProcessDefinition

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);
}
Also used : ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 18 with ProcessDefinition

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());
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 19 with ProcessDefinition

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);
}
Also used : ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 20 with ProcessDefinition

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);
}
Also used : ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)1093 Test (org.junit.Test)761 MigrationPlan (org.camunda.bpm.engine.migration.MigrationPlan)474 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)415 Deployment (org.camunda.bpm.engine.test.Deployment)230 Job (org.camunda.bpm.engine.runtime.Job)148 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)119 Batch (org.camunda.bpm.engine.batch.Batch)95 Task (org.camunda.bpm.engine.task.Task)87 HashMap (java.util.HashMap)77 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)64 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)55 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)54 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)47 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)42 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)41 MigrationPlanValidationException (org.camunda.bpm.engine.migration.MigrationPlanValidationException)40 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)39 Date (java.util.Date)38 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)35