Examples of HistoricTaskInstance


Examples of org.activiti.engine.history.HistoricTaskInstance

     
      assertNotNull(task.getId());
     
      taskService.deleteTask(task.getId(), "deleted for testing purposes");
     
      HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery()
        .taskId(task.getId()).singleResult();
     
      assertNotNull(historicTaskInstance);
      assertEquals("deleted for testing purposes", historicTaskInstance.getDeleteReason());
     
      // Delete historic task that is left behind, will not be cleaned up because this is not part of a process
      taskService.deleteTask(task.getId(), true);
     
    }
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

    taskService.saveTask(task);
    task = taskService.createTaskQuery().singleResult();
    assertEquals("form-changed.json", task.getFormKey());
   
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(task.getId()).singleResult();
      assertEquals("form-changed.json", historicTaskInstance.getFormKey());
    }
  }
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

    
     // Complete task
     taskService.complete(task.getId());
    
     // Query task, including processVariables
     HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getId()).includeProcessVariables().singleResult();
     assertNotNull(historicTask);
     assertNotNull(historicTask.getProcessVariables());
     byte[] bytes = (byte[]) historicTask.getProcessVariables().get("binaryVariable");
     assertEquals("It is I, le binary", new String(bytes));
    
     // Query task, including taskVariables
     historicTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getId()).includeTaskLocalVariables().singleResult();
     assertNotNull(historicTask);
     assertNotNull(historicTask.getTaskLocalVariables());
     bytes = (byte[]) historicTask.getTaskLocalVariables().get("binaryTaskVariable");
     assertEquals("It is I, le binary", new String(bytes));
    }
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

    assertEquals("Name does not match", "All your base are belong to us", task.getName());
   
    taskService.complete(task.getId());

    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
      HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getId()).singleResult();
      assertEquals("kermit", historicTask.getOwner());
     
      task = taskService.createTaskQuery().singleResult();
      assertEquals("Task name not set with 'bar' variable", "BAR", task.getName());
    }
     
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

  protected ObjectMapper objectMapper;

  @RequestMapping(value="/runtime/tasks/{taskId}/attachments", method = RequestMethod.GET, produces="application/json")
  public List<AttachmentResponse> getAttachments(@PathVariable String taskId, HttpServletRequest request) {
    List<AttachmentResponse> result = new ArrayList<AttachmentResponse>();
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
    for (Attachment attachment : taskService.getTaskAttachments(task.getId())) {
      result.add(restResponseFactory.createAttachmentResponse(attachment, serverRootUrl));
    }
   
    return result;
  }
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

 
  /**
   * Get valid history task from request. Throws exception if task doen't exist or if task id is not provided.
   */
  protected HistoricTaskInstance getHistoricTaskFromRequest(String taskId) {
    HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
    if (task == null) {
      throw new ActivitiObjectNotFoundException("Could not find a task with id '" + taskId + "'.", Task.class);
    }
    return task;
  }
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

  @RequestMapping(value="/runtime/tasks/{taskId}/events/{eventId}", method = RequestMethod.GET, produces="application/json")
  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

Examples of org.activiti.engine.history.HistoricTaskInstance

  @RequestMapping(value="/runtime/tasks/{taskId}/attachments/{attachmentId}", method = RequestMethod.GET, produces="application/json")
  public AttachmentResponse getAttachment(@PathVariable("taskId") String taskId,
      @PathVariable("attachmentId") String attachmentId, HttpServletRequest request) {
   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    Attachment attachment = taskService.getAttachment(attachmentId);
    if (attachment == null || !task.getId().equals(attachment.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an attachment with id '" + attachmentId + "'.", Comment.class);
    }
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

public class TaskCommentCollectionResource extends TaskBaseResource {

  @RequestMapping(value="/runtime/tasks/{taskId}/comments", method = RequestMethod.GET, produces="application/json")
  public List<CommentResponse> getComments(@PathVariable String taskId, HttpServletRequest request) {
    List<CommentResponse> result = new ArrayList<CommentResponse>();
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
    for (Comment comment : taskService.getTaskComments(task.getId())) {
      result.add(restResponseFactory.createRestComment(comment, serverRootUrl));
    }
   
    return result;
  }
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstance

  @RequestMapping(value="/runtime/tasks/{taskId}/attachments/{attachmentId}/content", method = RequestMethod.GET, produces="application/json")
  public @ResponseBody byte[] getAttachmentContent(@PathVariable("taskId") String taskId,
      @PathVariable("attachmentId") String attachmentId, HttpServletResponse response) {
   
    HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
    Attachment attachment = taskService.getAttachment(attachmentId);
   
    if (attachment == null || !task.getId().equals(attachment.getTaskId())) {
      throw new ActivitiObjectNotFoundException("Task '" + task.getId() +"' doesn't have an attachment with id '" + attachmentId + "'.", Attachment.class);
    }
   
    InputStream attachmentStream = taskService.getAttachmentContent(attachmentId);
    if (attachmentStream == null) {
      throw new ActivitiObjectNotFoundException("Attachment with id '" + attachmentId +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.