Examples of ITaskDAOConnection


Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

          dao.close();
        }
    }

    public OMElement reassign(OMElement requestElement) throws AxisFault {
       ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            ArrayList<String> taskIds = expectListOfValues(rootQueue, "taskId");
            AuthIdentifierSet users = expectAuthIdentifiers(rootQueue, "userOwner");
            AuthIdentifierSet roles = expectAuthIdentifiers(rootQueue, "roleOwner");
            TaskState taskState;
            String taskStateStr = requireElementValue(rootQueue, "taskState");
            try {
                taskState = TaskState.valueOf(taskStateStr.toUpperCase());
            } catch (IllegalArgumentException e) {
                throw new InvalidInputFormatException("Unknown task state: '" + taskStateStr + "'");
            }
            String participantToken = requireElementValue(rootQueue, "participantToken");
            for(String taskId : taskIds)
              _server.reassign(dao,taskId, users, roles, taskState, participantToken);
            return createOkResponse();
        } catch (Exception e) {
          throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

          dao.close();
        }
    }

    public OMElement getPipa(OMElement requestElement) throws AxisFault {
       ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String taskID = requireElementValue(rootQueue, "pipaurl");
            String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles user = _server.getUserRoles(participantToken);
            Task task = _server.getPipa(dao,taskID, participantToken);
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement marshalResponse(Task task) {
                    OMElement response = createElement("getPipaResponse");
                    response.addChild(new TaskMarshaller().marshalFullTask(task, user));
                    return response;
                }
            }.marshalResponse(task);
            return response;
        } catch (Exception e) {
           throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

          dao.close();
        }
    }

    public OMElement storePipa(OMElement requestElement) throws AxisFault {
      ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            OMElement taskElement = requireElement(rootQueue, "task");
            PIPATask task = (PIPATask) new TaskUnmarshaller().unmarshalFullTask(taskElement);
            String participantToken = requireElementValue(rootQueue, "participantToken");
            // final UserRoles user = _server.getUserRoles(participantToken);
            _server.storePipa(dao,task, participantToken);
            return createOkResponse();
        } catch (Exception e) {
          throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

          dao.close();
        }
    }

    public OMElement deletePipa(OMElement requestElement) throws AxisFault {
        ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
          OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String taskID = requireElementValue(rootQueue, "pipaurl");
            String participantToken = requireElementValue(rootQueue, "participantToken");
            // final UserRoles user = _server.getUserRoles(participantToken);
            _server.deletePipa(dao,taskID, participantToken);
            return createOkResponse();
        } catch (Exception e) {
           throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

          dao.close();
        }
    }

    public OMElement getAvailableTasks(final OMElement requestElement) throws AxisFault {
      ITaskDAOConnection dao=null;
        try {
          dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String participantToken = requireElementValue(rootQueue, "participantToken");
            String taskType = requireElementValue(rootQueue, "taskType");
            String subQuery = requireElementValue(rootQueue, "subQuery");
            String first = expectElementValue(rootQueue, "first");
            String max = expectElementValue(rootQueue, "max");
            HashMap map = new HashMap();
            map.put(TaskFetcher.FETCH_CLASS_NAME, taskType);
            map.put(TaskFetcher.FETCH_SUB_QUERY, subQuery);
            map.put(TaskFetcher.FETCH_FIRST, first);
            map.put(TaskFetcher.FETCH_MAX, max);
            final UserRoles user = _server.getUserRoles(participantToken);
            Task[] tasks = _server.getAvailableTasks(dao,participantToken, map);
            OMElement result = marshalTasksList(user, tasks, "getAvailableTasksResponse");
            return result;
        } catch (Exception e) {
          throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

          dao.close();
        }
    }
   
    public OMElement countAvailableTasks(final OMElement requestElement) throws AxisFault {
      ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String participantToken = requireElementValue(rootQueue, "participantToken");
            String taskType = requireElementValue(rootQueue, "taskType");
            String subQuery = requireElementValue(rootQueue, "subQuery");
            String first = expectElementValue(rootQueue, "first");
            String max = expectElementValue(rootQueue, "max");
            HashMap map = new HashMap();
            map.put(TaskFetcher.FETCH_CLASS_NAME, taskType);
            map.put(TaskFetcher.FETCH_SUB_QUERY, subQuery);
            final UserRoles user = _server.getUserRoles(participantToken);
            final Long taskCount = _server.countAvailableTasks(dao,participantToken, map);
            return new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement createOkResponse() {
                    OMElement response = createElement("countAvailableTasksResponse");
                    response.setText(Long.toString(taskCount));
                    return response;
                }
            }.createOkResponse();
        } catch (Exception e) {
           throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

            return AxisFault.makeFault(e);
        }
    }

    public OMElement skip(OMElement requestElement) throws AxisFault {
      ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String taskID = requireElementValue(rootQueue, "taskId");
            String participantToken = requireElementValue(rootQueue, "participantToken");
            _server.skip(dao,taskID, participantToken);
            return createOkResponse();
        } catch (Exception e) {
          throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
       
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

        String assembly = name.getAssemblyId().getAssemblyName();
        HashSet<AssemblyId> set = _versions.get(assembly);
        if (set == null || set.size() < 1) {
          // if set is equal to 1, we have one more version remaining.
          // fix for WF-1324
          ITaskDAOConnection dao=null;
          //ITaskDAOConnection is accessed here for fix of JIRA WF-1466
          try {
            dao=_taskDAOFactory.openConnection();
              for (String url : deployedResources) {
                  try {
                    if(LOG.isDebugEnabled()) LOG.debug("versions>> "+_versions.toString());
                      _tms.deletePipa(dao,url, token);
                  } catch (UnavailableTaskException e) {
                      LOG.warn("Undeploy - PIPA not found: " + url);
                  } catch (AuthException e) {
                      LOG.warn("Undeploy - AuthException: " + url, e);
                      break; // fail-fast
                  } catch (TMSException e) {
                      LOG.warn("Undeploy - TMSException: " + url, e);
                      break; // fail-fast
                  }
              }
            }finally
          {
            if(dao!=null)
              dao.close();
          }
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.server.dao.ITaskDAOConnection

        try {
            PIPATask task = loadPIPADescriptor(input);
            urls.add(getFormUrl(task));
            if (task.isValid()) {
                LOG.debug("Store PIPA {}", name);
                ITaskDAOConnection dao=_taskDAOFactory.openConnection();
                try {
                    _tms.deletePipa(dao,getFormUrl(task), token);
                } catch (Exception e) {
                    // don't bother with that here
                }
                _tms.storePipa(dao,task, token);
                dao.close();
            } else {
                msg = new DeploymentMessage(Level.ERROR, "Invalid PIPA task descriptor: " + name);
                msg.setResource(name);
            }
        } catch (Exception e) {
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.