Package com.itedge.infrastructure.domain

Examples of com.itedge.infrastructure.domain.IProcessEntity


      @RequestParam(value = TASK_HISTORY_PARAM, required = true) Boolean historyParam,
      @RequestParam(value = PROC_ID, required = true) String procId, Model model,
      HttpServletRequest request) throws TaskHandlerException {
        Task currentTask = null;
        HistoricTaskInstance historyTask = null;
        IProcessEntity linkedObject = getLinkedObject(procId);
        if (Boolean.FALSE.equals(historyParam)) {
          request.setAttribute(TASK_HISTORY_PARAM, false);
            currentTask = getCurrentTask(id);
            // living task instance requested, but already completed by other actor
            if (currentTask == null) {
              historyTask = getHistoryTask(id);
              if (historyTask != null) {
                // force historic view with additional info, who and when already completed task
                request.setAttribute(TASK_HISTORY_PARAM, true);
                Object[] arguments = new Object[2];
                arguments[0] = historyTask.getAssignee();
                arguments[1] = new SimpleDateFormat(InfrastructureConstants.ISO_DATE_TIME_FORMAT)
                  .format(historyTask.getEndTime());
                model.addAttribute(MODEL_ATTR_TASK_COMPLETED,
                  messageSource.getMessage(InfrastructureConstants.TASK_ALREADY_COMPLETED,
              arguments, InfrastructureConstants.UNDEFINED_MESSAGE, request.getLocale()));
              } else {
                // there is not living, nor historic instance, task is non existing / was deleted
                request.getSession()
                  .setAttribute(InfrastructureConstants.SESSION_ATTR_FROM_NON_EXISTING_TASK, true);
                return "redirect:/" + getLinkedObjectViewPath() +
                    WebUtil.encodeUrlPathSegment(linkedObject.getId().toString(),
                    request);
              }
          }
        } else {
          request.setAttribute(TASK_HISTORY_PARAM, true);
View Full Code Here


  @RequestMapping(params = TASK_NAME_PARAM, method = {RequestMethod.POST, RequestMethod.PUT})
  public String saveTask(Model model, HttpServletRequest request) throws TaskHandlerException {
      String path = request.getParameter(TASK_NAME_PARAM);
      String taskId = (String) request.getSession().getAttribute(SESSION_ATTR_TASK_ID);
      String procId = (String) request.getSession().getAttribute(SESSION_ATTR_PROC_ID);
      IProcessEntity linkedObject = getLinkedObject(procId);
      if (taskHandlerMapping.containsKey(path)) {
      ITaskDataHandler<ITaskDataEntity, IProcessEntity> handler = taskHandlerMapping.get(path);
        ITaskDataEntity taskData = handler.bindTaskData(request, linkedObject);
      TaskDataUtil.setLastUpdate(taskData, ContextUtil.getLoggedUsername());
        if (RequestMethod.PUT.name().equals(request.getMethod())) {
          handler.saveTaskData(taskData);
        } else if (RequestMethod.POST.name().equals(request.getMethod())) {
          handler.saveTaskDataAndPushProcess(taskData, linkedObject, taskId);
        }
      }
      return "redirect:/" + getLinkedObjectViewPath() +
        WebUtil.encodeUrlPathSegment(linkedObject.getId().toString(), request);
  }
View Full Code Here

TOP

Related Classes of com.itedge.infrastructure.domain.IProcessEntity

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.