Package org.activiti.engine.task

Examples of org.activiti.engine.task.Event


  public EventResponse getEvent(@PathVariable("taskId") String taskId,
      @PathVariable("eventId") String eventId, HttpServletRequest request) {
   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    Event event = taskService.getEvent(eventId);
    if (event == null || !task.getId().equals(event.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an event with id '" + eventId + "'.", Event.class);
    }
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
View Full Code Here


      @PathVariable("eventId") String eventId, HttpServletResponse response) {
   
    // Check if task exists
    Task task = getTaskFromRequest(taskId);
   
    Event event = taskService.getEvent(eventId);
    if (event == null || event.getTaskId() == null || !event.getTaskId().equals(task.getId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an event with id '" + event + "'.", Event.class);
    }
   
    taskService.deleteComment(eventId);
    response.setStatus(HttpStatus.NO_CONTENT.value());
View Full Code Here

     
      Task task = taskService.newTask();
      taskService.saveTask(task);
      taskService.addUserIdentityLink(task.getId(), "gonzo", "someType");

      Event event = taskService.getTaskEvents(task.getId()).get(0);
     
      HttpGet httpGet = new HttpGet(SERVER_URL_PREFIX +
          RestUrls.createRelativeResourceUrl(RestUrls.URL_TASK_EVENT, task.getId(), event.getId()));
      CloseableHttpResponse response = executeRequest(httpGet, HttpStatus.SC_OK);
      JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
      closeResponse(response);
      assertNotNull(responseNode);
      assertEquals(event.getId(), responseNode.get("id").textValue());
      assertEquals(event.getAction(), responseNode.get("action").textValue());
      assertEquals(event.getUserId(), responseNode.get("userId").textValue());
      assertTrue(responseNode.get("url").asText().endsWith(
              RestUrls.createRelativeResourceUrl(RestUrls.URL_TASK_EVENT, task.getId(), event.getId())));
      assertTrue(responseNode.get("taskUrl").asText().endsWith(
              RestUrls.createRelativeResourceUrl(RestUrls.URL_TASK, task.getId())));
      assertEquals(now.getTime(), getDateFromISOString(responseNode.get("time").textValue()));
     
    } finally {
View Full Code Here

    assertEquals(1, identityLinks.size());
   
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      List<Event> processInstanceEvents = runtimeService.getProcessInstanceEvents(processInstanceId);
      assertEquals(1, processInstanceEvents.size());
      Event processIsntanceEvent = processInstanceEvents.get(0);
      assertEquals(Event.ACTION_ADD_GROUP_LINK, processIsntanceEvent.getAction());
      List<String> processInstanceEventMessageParts = processIsntanceEvent.getMessageParts();
      assertEquals("muppets", processInstanceEventMessageParts.get(0));
      assertEquals(IdentityLinkType.PARTICIPANT, processInstanceEventMessageParts.get(1));
      assertEquals(2, processInstanceEventMessageParts.size());
    }
   
    runtimeService.deleteParticipantGroup(processInstanceId, "muppets");

    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      List<Event> processInstanceEvents = runtimeService.getProcessInstanceEvents(processInstanceId);
      Event processIsntanceEvent = findProcessInstanceEvent(processInstanceEvents, Event.ACTION_DELETE_GROUP_LINK);
      assertEquals(Event.ACTION_DELETE_GROUP_LINK, processIsntanceEvent.getAction());
      List<String> processInstanceEventMessageParts = processIsntanceEvent.getMessageParts();
      assertEquals("muppets", processInstanceEventMessageParts.get(0));
      assertEquals(IdentityLinkType.PARTICIPANT, processInstanceEventMessageParts.get(1));
      assertEquals(2, processInstanceEventMessageParts.size());
      assertEquals(2, processInstanceEvents.size());
    }
View Full Code Here

    assertEquals(1, identityLinks.size());
   
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      List<Event> taskEvents = taskService.getTaskEvents(taskId);
      assertEquals(1, taskEvents.size());
      Event taskEvent = taskEvents.get(0);
      assertEquals(Event.ACTION_ADD_GROUP_LINK, taskEvent.getAction());
      List<String> taskEventMessageParts = taskEvent.getMessageParts();
      assertEquals("muppets", taskEventMessageParts.get(0));
      assertEquals(IdentityLinkType.CANDIDATE, taskEventMessageParts.get(1));
      assertEquals(2, taskEventMessageParts.size());
    }
     
    taskService.deleteCandidateGroup(taskId, "muppets");

    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      List<Event> taskEvents = taskService.getTaskEvents(taskId);
      Event taskEvent = findTaskEvent(taskEvents, Event.ACTION_DELETE_GROUP_LINK);
      assertEquals(Event.ACTION_DELETE_GROUP_LINK, taskEvent.getAction());
      List<String> taskEventMessageParts = taskEvent.getMessageParts();
      assertEquals("muppets", taskEventMessageParts.get(0));
      assertEquals(IdentityLinkType.CANDIDATE, taskEventMessageParts.get(1));
      assertEquals(2, taskEventMessageParts.size());
      assertEquals(2, taskEvents.size());
    }
View Full Code Here

    assertEquals(1, identityLinks.size());
   
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      List<Event> taskEvents = taskService.getTaskEvents(taskId);
      assertEquals(1, taskEvents.size());
      Event taskEvent = taskEvents.get(0);
      assertEquals(Event.ACTION_ADD_GROUP_LINK, taskEvent.getAction());
      List<String> taskEventMessageParts = taskEvent.getMessageParts();
      assertEquals("muppets", taskEventMessageParts.get(0));
      assertEquals(IdentityLinkType.CANDIDATE, taskEventMessageParts.get(1));
      assertEquals(2, taskEventMessageParts.size());
    }
     
    taskService.deleteCandidateGroup(taskId, "muppets");

    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      List<Event> taskEvents = taskService.getTaskEvents(taskId);
      Event taskEvent = findTaskEvent(taskEvents, Event.ACTION_DELETE_GROUP_LINK);
      assertEquals(Event.ACTION_DELETE_GROUP_LINK, taskEvent.getAction());
      List<String> taskEventMessageParts = taskEvent.getMessageParts();
      assertEquals("muppets", taskEventMessageParts.get(0));
      assertEquals(IdentityLinkType.CANDIDATE, taskEventMessageParts.get(1));
      assertEquals(2, taskEventMessageParts.size());
      assertEquals(2, taskEvents.size());
    }
View Full Code Here

TOP

Related Classes of org.activiti.engine.task.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.