Example #1
0
 public void tesBasicTaskPropertiesNotNull() {
   Task task = taskService.createTaskQuery().taskId(taskIds.get(0)).singleResult();
   assertNotNull(task.getDescription());
   assertNotNull(task.getId());
   assertNotNull(task.getName());
   assertNotNull(task.getCreateTime());
 }
Example #2
0
  /**
   * easyui AJAX请求数据 待办任务
   *
   * @param request
   * @param response
   * @param dataGrid
   */
  @RequestMapping(params = "claimedTaskDataGrid")
  public void claimedTaskDataGrid(
      HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {

    // String userId = "leaderuser";
    String userId = ResourceUtil.getSessionUserName().getId();
    TaskService taskService = processEngine.getTaskService();
    List<Task> tasks = taskService.createTaskQuery().taskAssignee(userId).list();

    StringBuffer rows = new StringBuffer();
    for (Task t : tasks) {
      rows.append(
          "{'name':'"
              + t.getName()
              + "','description':'"
              + t.getDescription()
              + "','taskId':'"
              + t.getId()
              + "','processDefinitionId':'"
              + t.getProcessDefinitionId()
              + "','processInstanceId':'"
              + t.getProcessInstanceId()
              + "'},");
    }
    String rowStr = StringUtils.substringBeforeLast(rows.toString(), ",");

    JSONObject jObject =
        JSONObject.fromObject("{'total':" + tasks.size() + ",'rows':[" + rowStr + "]}");
    responseDatagrid(response, jObject);
  }
  public TTaskAbstract adapt(Task vendorTask) {
    TTaskAbstract taskAbstract = new TTaskAbstract();
    taskAbstract.setId(vendorTask.getId());
    taskAbstract.setName(new QName(vendorTask.getName()));
    // taskAbstract.set ->  vendorTask.getAssignee()
    taskAbstract.setPresentationName(vendorTask.getDescription()); // /not sure about this
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(vendorTask.getCreateTime());
    taskAbstract.setCreatedOn(new XMLGregorianCalendarImpl(calendar));
    taskAbstract.setPriority(BigInteger.valueOf(vendorTask.getPriority()));

    return taskAbstract;
  }