Java Code Examples for org.camunda.bpm.engine.task.Task#setDescription()
The following examples show how to use
org.camunda.bpm.engine.task.Task#setDescription() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskServiceTest.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) @Test public void testUserTaskOptimisticLocking() { runtimeService.startProcessInstanceByKey("oneTaskProcess"); Task task1 = taskService.createTaskQuery().singleResult(); Task task2 = taskService.createTaskQuery().singleResult(); task1.setDescription("test description one"); taskService.saveTask(task1); try { task2.setDescription("test description two"); taskService.saveTask(task2); fail("Expecting exception"); } catch(OptimisticLockingException e) { // Expected exception } }
Example 2
Source File: TaskQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
@Test public void shouldReturnTasksWithTaskNameOrTaskDescription() { // given Task task1 = taskService.newTask(); task1.setName("aTaskName"); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setDescription("aTaskDescription"); taskService.saveTask(task2); // when List<Task> tasks = taskService.createTaskQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .endOr() .list(); // then assertEquals(2, tasks.size()); }
Example 3
Source File: StandaloneTaskTest.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
public void testOptimisticLockingThrownOnMultipleUpdates() { Task task = taskService.newTask(); taskService.saveTask(task); String taskId = task.getId(); // first modification Task task1 = taskService.createTaskQuery().taskId(taskId).singleResult(); Task task2 = taskService.createTaskQuery().taskId(taskId).singleResult(); task1.setDescription("first modification"); taskService.saveTask(task1); // second modification on the initial instance task2.setDescription("second modification"); try { taskService.saveTask(task2); fail("should get an exception here as the task was modified by someone else."); } catch (OptimisticLockingException expected) { // exception was thrown as expected } taskService.deleteTask(taskId, true); }
Example 4
Source File: TaskServiceWithJdbcSimpleProcessingTest.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
@Test @Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testUserTaskOptimisticLocking() { runtimeService.startProcessInstanceByKey("oneTaskProcess"); thrown.expect(OptimisticLockingException.class); Task task1 = taskService.createTaskQuery().singleResult(); Task task2 = taskService.createTaskQuery().singleResult(); task1.setDescription("test description one"); taskService.saveTask(task1); task2.setDescription("test description two"); taskService.saveTask(task2); }
Example 5
Source File: HistoricTaskInstanceQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
@Test public void shouldReturnHistoricTasksWithTaskNameOrTaskDescription() { // given Task task1 = taskService.newTask(); task1.setName("aTaskName"); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setDescription("aTaskDescription"); taskService.saveTask(task2); // when List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .endOr() .list(); // then assertEquals(2, tasks.size()); }
Example 6
Source File: HistoricTaskInstanceUpdateTest.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
@Deployment public void testHistoricTaskInstanceUpdate() { runtimeService.startProcessInstanceByKey("HistoricTaskInstanceTest").getId(); Task task = taskService.createTaskQuery().singleResult(); // Update and save the task's fields before it is finished task.setPriority(12345); task.setDescription("Updated description"); task.setName("Updated name"); task.setAssignee("gonzo"); taskService.saveTask(task); taskService.complete(task.getId()); assertEquals(1, historyService.createHistoricTaskInstanceQuery().count()); HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().singleResult(); assertEquals("Updated name", historicTaskInstance.getName()); assertEquals("Updated description", historicTaskInstance.getDescription()); assertEquals("gonzo", historicTaskInstance.getAssignee()); assertEquals("task", historicTaskInstance.getTaskDefinitionKey()); }
Example 7
Source File: TaskDto.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
public void updateTask(Task task) { task.setName(getName()); task.setDescription(getDescription()); task.setPriority(getPriority()); task.setAssignee(getAssignee()); task.setOwner(getOwner()); DelegationState state = null; if (getDelegationState() != null) { DelegationStateConverter converter = new DelegationStateConverter(); state = converter.convertQueryParameterToType(getDelegationState()); } task.setDelegationState(state); task.setDueDate(getDue()); task.setFollowUpDate(getFollowUp()); task.setParentTaskId(getParentTaskId()); task.setCaseInstanceId(getCaseInstanceId()); task.setTenantId(getTenantId()); }
Example 8
Source File: TaskQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 5 votes |
@Test public void shouldReturnTasksWithMultipleOrCriteria() { // given Task task1 = taskService.newTask(); task1.setName("aTaskName"); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setDescription("aTaskDescription"); taskService.saveTask(task2); Task task3 = taskService.newTask(); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setPriority(5); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setOwner("aTaskOwner"); taskService.saveTask(task5); // when List<Task> tasks = taskService.createTaskQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskId(task3.getId()) .taskPriority(5) .taskOwner("aTaskOwner") .endOr() .list(); // then assertEquals(5, tasks.size()); }
Example 9
Source File: StandaloneTaskTest.java From camunda-bpm-platform with Apache License 2.0 | 5 votes |
public void testRevisionUpdatedOnSave() { Task task = taskService.newTask(); taskService.saveTask(task); assertEquals(1, ((TaskEntity) task).getRevision()); task.setDescription("first modification"); taskService.saveTask(task); assertEquals(2, ((TaskEntity) task).getRevision()); task.setDescription("second modification"); taskService.saveTask(task); assertEquals(3, ((TaskEntity) task).getRevision()); taskService.deleteTask(task.getId(), true); }
Example 10
Source File: HistoricTaskInstanceQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 5 votes |
@Test public void shouldReturnHistoricTasksWithMultipleOrCriteria() { // given Task task1 = taskService.newTask(); task1.setName("aTaskName"); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setDescription("aTaskDescription"); taskService.saveTask(task2); Task task3 = taskService.newTask(); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setPriority(5); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setOwner("aTaskOwner"); taskService.saveTask(task5); // when List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskId(task3.getId()) .taskPriority(5) .taskOwner("aTaskOwner") .endOr() .list(); // then assertEquals(5, tasks.size()); }
Example 11
Source File: GetHistoricOperationLogsForOptimizeTest.java From camunda-bpm-platform with Apache License 2.0 | 4 votes |
private void createLogEntriesThatShouldNotBeReturned(String processInstanceId) { ClockUtil.setCurrentTime(new Date()); String processTaskId = taskService.createTaskQuery().singleResult().getId(); // create and remove some links taskService.addCandidateUser(processTaskId, "er"); taskService.deleteCandidateUser(processTaskId, "er"); taskService.addCandidateGroup(processTaskId, "wir"); taskService.deleteCandidateGroup(processTaskId, "wir"); // assign and reassign the owner taskService.setOwner(processTaskId, "icke"); // change priority of task taskService.setPriority(processTaskId, 10); // add and delete an attachment Attachment attachment = taskService.createAttachment( "image/ico", processTaskId, processInstanceId, "favicon.ico", "favicon", "http://camunda.com/favicon.ico" ); taskService.deleteAttachment(attachment.getId()); runtimeService.deleteProcessInstance(processInstanceId, "that's why"); // create a standalone userTask Task userTask = taskService.newTask(); userTask.setName("to do"); taskService.saveTask(userTask); // change some properties manually to create an update event ClockUtil.setCurrentTime(new Date()); userTask.setDescription("desc"); userTask.setOwner("icke"); userTask.setAssignee("er"); userTask.setDueDate(new Date()); taskService.saveTask(userTask); taskService.deleteTask(userTask.getId(), true); }
Example 12
Source File: TaskQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 4 votes |
@Test public void shouldReturnTasksFilteredByMultipleOrAndCriteria() { // given Task task1 = taskService.newTask(); task1.setPriority(4); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setName("aTaskName"); task2.setOwner("aTaskOwner"); task2.setAssignee("aTaskAssignee"); task2.setPriority(4); taskService.saveTask(task2); Task task3 = taskService.newTask(); task3.setName("aTaskName"); task3.setOwner("aTaskOwner"); task3.setAssignee("aTaskAssignee"); task3.setPriority(4); task3.setDescription("aTaskDescription"); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setOwner("aTaskOwner"); task4.setAssignee("aTaskAssignee"); task4.setPriority(4); task4.setDescription("aTaskDescription"); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setDescription("aTaskDescription"); task5.setOwner("aTaskOwner"); taskService.saveTask(task5); // when List<Task> tasks = taskService.createTaskQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskId(task3.getId()) .endOr() .taskOwner("aTaskOwner") .taskPriority(4) .taskAssignee("aTaskAssignee") .list(); // then assertEquals(3, tasks.size()); }
Example 13
Source File: TaskQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 4 votes |
@Test public void shouldReturnTasksFilteredByMultipleOrQueries() { // given Task task1 = taskService.newTask(); task1.setName("aTaskName"); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setName("aTaskName"); task2.setDescription("aTaskDescription"); taskService.saveTask(task2); Task task3 = taskService.newTask(); task3.setName("aTaskName"); task3.setDescription("aTaskDescription"); task3.setOwner("aTaskOwner"); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setName("aTaskName"); task4.setDescription("aTaskDescription"); task4.setOwner("aTaskOwner"); task4.setAssignee("aTaskAssignee"); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setName("aTaskName"); task5.setDescription("aTaskDescription"); task5.setOwner("aTaskOwner"); task5.setAssignee("aTaskAssignee"); task5.setPriority(4); taskService.saveTask(task5); Task task6 = taskService.newTask(); task6.setName("aTaskName"); task6.setDescription("aTaskDescription"); task6.setOwner("aTaskOwner"); task6.setAssignee("aTaskAssignee"); task6.setPriority(4); taskService.saveTask(task6); // when List<Task> tasks = taskService.createTaskQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .endOr() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskAssignee("aTaskAssignee") .endOr() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskOwner("aTaskOwner") .taskAssignee("aTaskAssignee") .endOr() .or() .taskAssignee("aTaskAssignee") .taskPriority(4) .endOr() .list(); // then assertEquals(3, tasks.size()); }
Example 14
Source File: FilterTaskQueryTest.java From camunda-bpm-platform with Apache License 2.0 | 4 votes |
protected void createTasksForOrQueries() { Task task1 = taskService.newTask(); task1.setName("taskForOr"); task1.setDescription("aTaskDescription"); task1.setPriority(3); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setName("taskForOr"); task2.setDescription("aTaskDescription"); task2.setAssignee("aTaskAssignee"); task2.setTenantId("aTenantId"); taskService.saveTask(task2); Task task3 = taskService.newTask(); task3.setName("taskForOr"); task3.setOwner("aTaskOwner"); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setName("taskForOr"); task4.setOwner("aTaskOwner"); task4.setPriority(3); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setDescription("aTaskDescription"); task5.setAssignee("aTaskAssignee"); taskService.saveTask(task5); Task task6 = taskService.newTask(); task6.setDescription("aTaskDescription"); task6.setAssignee("aTaskAssignee"); task6.setTenantId("aTenantId"); taskService.saveTask(task6); Task task7 = taskService.newTask(); task7.setTenantId("aTenantId"); task7.setOwner("aTaskOwner"); task7.setPriority(3); task7.setAssignee("aTaskAssignee"); taskService.saveTask(task7); }
Example 15
Source File: HistoricTaskInstanceQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 4 votes |
@Test public void shouldReturnHistoricTasksFilteredByMultipleOrAndCriteria() { // given Task task1 = taskService.newTask(); task1.setPriority(4); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setName("aTaskName"); task2.setOwner("aTaskOwner"); task2.setAssignee("aTaskAssignee"); task2.setPriority(4); taskService.saveTask(task2); Task task3 = taskService.newTask(); task3.setName("aTaskName"); task3.setOwner("aTaskOwner"); task3.setAssignee("aTaskAssignee"); task3.setPriority(4); task3.setDescription("aTaskDescription"); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setOwner("aTaskOwner"); task4.setAssignee("aTaskAssignee"); task4.setPriority(4); task4.setDescription("aTaskDescription"); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setDescription("aTaskDescription"); task5.setOwner("aTaskOwner"); taskService.saveTask(task5); // when List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskId(task3.getId()) .endOr() .taskOwner("aTaskOwner") .taskPriority(4) .taskAssignee("aTaskAssignee") .list(); // then assertEquals(3, tasks.size()); }
Example 16
Source File: HistoricTaskInstanceQueryOrTest.java From camunda-bpm-platform with Apache License 2.0 | 4 votes |
@Test public void shouldReturnHistoricTasksFilteredByMultipleOrQueries() { // given Task task1 = taskService.newTask(); task1.setName("aTaskName"); taskService.saveTask(task1); Task task2 = taskService.newTask(); task2.setName("aTaskName"); task2.setDescription("aTaskDescription"); taskService.saveTask(task2); Task task3 = taskService.newTask(); task3.setName("aTaskName"); task3.setDescription("aTaskDescription"); task3.setOwner("aTaskOwner"); taskService.saveTask(task3); Task task4 = taskService.newTask(); task4.setName("aTaskName"); task4.setDescription("aTaskDescription"); task4.setOwner("aTaskOwner"); task4.setAssignee("aTaskAssignee"); taskService.saveTask(task4); Task task5 = taskService.newTask(); task5.setName("aTaskName"); task5.setDescription("aTaskDescription"); task5.setOwner("aTaskOwner"); task5.setAssignee("aTaskAssignee"); task5.setPriority(4); taskService.saveTask(task5); Task task6 = taskService.newTask(); task6.setName("aTaskName"); task6.setDescription("aTaskDescription"); task6.setOwner("aTaskOwner"); task6.setAssignee("aTaskAssignee"); task6.setPriority(4); taskService.saveTask(task6); // when List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .endOr() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskAssignee("aTaskAssignee") .endOr() .or() .taskName("aTaskName") .taskDescription("aTaskDescription") .taskOwner("aTaskOwner") .taskAssignee("aTaskAssignee") .endOr() .or() .taskAssignee("aTaskAssignee") .taskPriority(4) .endOr() .list(); // then assertEquals(3, tasks.size()); }