Search in sources :

Example 6 with Event

use of org.camunda.bpm.engine.task.Event in project camunda-bpm-platform by camunda.

the class TaskEventsTest method testAddAttachmentEvents.

public void testAddAttachmentEvents() {
    // initially there are no task events
    assertTrue(taskService.getTaskEvents(task.getId()).isEmpty());
    identityService.setAuthenticatedUserId(JONNY);
    taskService.createAttachment(IMAGE_PNG, task.getId(), null, IMAGE_NAME, IMAGE_DESC, IMAGE_URL);
    // now there is a task event created
    List<Event> events = taskService.getTaskEvents(task.getId());
    assertEquals(1, events.size());
    Event event = events.get(0);
    assertEquals(1, event.getMessageParts().size());
    assertEquals(IMAGE_NAME, event.getMessageParts().get(0));
    assertEquals(task.getId(), event.getTaskId());
    assertEquals(ACTION_ADD_ATTACHMENT, event.getAction());
    assertEquals(IMAGE_NAME, event.getMessage());
    assertEquals(null, event.getProcessInstanceId());
    assertNotNull(event.getTime().getTime() <= ClockUtil.getCurrentTime().getTime());
    assertNoCommentsForTask();
}
Also used : Event(org.camunda.bpm.engine.task.Event)

Example 7 with Event

use of org.camunda.bpm.engine.task.Event in project camunda-bpm-platform by camunda.

the class TaskEventsTest method testAddGroupLinkEvents.

public void testAddGroupLinkEvents() {
    // initially there are no task events
    assertTrue(taskService.getTaskEvents(task.getId()).isEmpty());
    taskService.addCandidateGroup(task.getId(), ACCOUNTING);
    // now there is a task event created
    List<Event> events = taskService.getTaskEvents(task.getId());
    assertEquals(1, events.size());
    Event event = events.get(0);
    assertEquals(ACCOUNTING, event.getMessageParts().get(0));
    assertEquals(CANDIDATE, event.getMessageParts().get(1));
    assertEquals(task.getId(), event.getTaskId());
    assertEquals(ACTION_ADD_GROUP_LINK, event.getAction());
    assertEquals(ACCOUNTING + CommentEntity.MESSAGE_PARTS_MARKER + CANDIDATE, event.getMessage());
    assertEquals(null, event.getProcessInstanceId());
    assertNotNull(event.getTime().getTime() <= ClockUtil.getCurrentTime().getTime());
    assertNoCommentsForTask();
}
Also used : Event(org.camunda.bpm.engine.task.Event)

Aggregations

Event (org.camunda.bpm.engine.task.Event)7 Date (java.util.Date)3 Attachment (org.camunda.bpm.engine.task.Attachment)1 IdentityLink (org.camunda.bpm.engine.task.IdentityLink)1 Deployment (org.camunda.bpm.engine.test.Deployment)1