Examples of ITaskDAOConnection


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

        createTask();
    }

    public void testReassginLive() throws Exception {
       ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
         ITaskDAOConnection dao=daoFactory.openConnection();
        /*
         * Get available users
         */
        _logger.debug("Get the users from role: " + ROLE_TARGET);
        String[] users = queryAssignedUsers(ROLE_TARGET);
View Full Code Here

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

        paTask.getRoleOwners().add("test/role3");
       
        paTask.getUserOwners().add("test/user1");
        paTask.getRoleOwners().add("test/role3");
        ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
        ITaskDAOConnection dao=daoFactory.openConnection();
        server.create(dao,paTask, "token1");

        TaskEquality.areTasksEquals(paTask, server.getTask(dao,"taskID", "token1"));
        TaskEquality.areTasksEquals(paTask, server.getTask(dao,"taskID", "token2"));
        TaskEquality.areTasksEquals(paTask, server.getTaskList(dao,"token1")[0]);
View Full Code Here

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

        ITMSServer server = Utils.createTMSServerJPA();
        Notification notification = new Notification("taskID", new URI("http://localhost/1"), Utils.createXMLDocument());
        notification.getUserOwners().add("test/user1");
        notification.getRoleOwners().add("test/role3");
        ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
        ITaskDAOConnection dao=daoFactory.openConnection();
        server.create(dao,notification, "token1");
        try {
            TaskMetadata metadata = TaskMetadata.Factory.newInstance()
            metadata.setTaskId("taskID");
            metadata.setTaskType(TaskType.NOTIFICATION.name());
View Full Code Here

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

        TaskMetadata metadata = TaskMetadata.Factory.newInstance()
        metadata.setTaskId("taskID");
        metadata.setTaskType(TaskType.ACTIVITY.name());
        try {
          ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
            ITaskDAOConnection dao=daoFactory.openConnection();
            server.update(dao,metadata, "token");
            fail("should not be able to update a notification");
        } catch (Exception e) {
            // expected
        }   
View Full Code Here

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

    public void testCanUpdatePriority() throws Exception {
        ITMSServer server = Utils.createTMSServerJPA();
        String id = ""+System.currentTimeMillis();
        PATask pa = getPATask(id);
        ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
        ITaskDAOConnection dao=daoFactory.openConnection();
        server.create(dao,pa, "token1");
        TaskMetadata metadata = TaskMetadata.Factory.newInstance()
        metadata.setTaskId(id);
       
        metadata.setPriority(5);
View Full Code Here

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

        ITMSServer server = Utils.createTMSServer();
        Notification notification = new Notification("taskID", new URI("http://localhost/1"), Utils.createXMLDocument());
        notification.getUserOwners().add("test/user1");
        notification.getRoleOwners().add("test/role3");
        ITaskDAOConnectionFactory daoFactory=new SimpleTaskDAOConnectionFactory();
        ITaskDAOConnection dao=daoFactory.openConnection();
        server.create(dao,notification, "token1");

        TaskEquality.areTasksEquals(notification, server.getTask(dao,"taskID", "token1"));
        TaskEquality.areTasksEquals(notification, server.getTask(dao,"taskID", "token2"));
        TaskEquality.areTasksEquals(notification, server.getTaskList(dao,"token1")[0]);
View Full Code Here

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

        _registerPipa = new DeploymentServiceRegister(_pipa);
        _registerPipa.init();
    }

    public OMElement getTaskList(final OMElement requestElement) throws AxisFault {
        ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles user = _server.getUserRoles(participantToken);
      Task[] tasks = _server.getTaskList(dao,participantToken);
            OMElement result = marshalTasksList(user, tasks, "getTaskListResponse");
            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 getTask(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");
            final UserRoles user = _server.getUserRoles(participantToken);
            Task task = _server.getTask(dao,taskID, participantToken);
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement marshalResponse(Task task) {
                    OMElement response = createElement("getTaskResponse");
                    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

            }
        }.createOkResponse();
    }

    public OMElement create(OMElement requestElement) throws AxisFault {
        ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            OMElement taskElement = requireElement(rootQueue, "task");
            Task task = new TaskUnmarshaller().unmarshalFullTask(taskElement);
            if (task instanceof PIPATask) {
                throw new InvalidInputFormatException("Not allowed to create() PIPA tasks");
            }
            String participantToken = requireElementValue(rootQueue, "participantToken");
            _server.create(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 update(OMElement requestElement) throws AxisFault {
      ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            OMElement taskElement = requireElement(rootQueue, "taskMetadata");
            TaskMetadata metadata = new TaskUnmarshaller().unmarshalPartialTask2(taskElement);
            String participantToken = requireElementValue(rootQueue, "participantToken");
            _server.update(dao,metadata, participantToken);
            return createOkResponse();
        } catch (Exception e) {
            throw makeFault(e);
        }
        finally{
          if(dao!=null)
          dao.close();
        }
    }
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.