Package org.intalio.tempo.workflow.auth

Examples of org.intalio.tempo.workflow.auth.UserRoles


            persist(task1);
            persist(task2);
            persist(task3);
          
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            UserRoles ur = new UserRoles("niko",
                    new String[] { "examples\\employee" });
            Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
            Task[] t2 = taskFetcher.fetchAvailableTasks(ur, PATask.class,
                    "T._state = TaskState.READY OR T._state = TaskState.CLAIMED");
            UserRoles ur2 = new UserRoles("alex",
                    new String[] { "examples\\employee2" });
            Task[] t3 = taskFetcher.fetchAvailableTasks(ur2, PATask.class,
                    "T._state = TaskState.READY OR T._state = TaskState.CLAIMED");
          
            Assert.assertEquals(3, t1.length);
View Full Code Here


            task1.getRoleOwners().add("examples\\employee");
            task1.getRoleOwners().add("examples\\manager");
            persist(task1);
          
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            UserRoles ur = new UserRoles("niko", new String[] {
                    "examples\\employee", "examples\\manager" });
            Task[] list = taskFetcher.fetchAllAvailableTasks(ur);
            Assert.assertEquals(1, list.length);
           }
View Full Code Here

          
            task1.getUserOwners().add("intalio\\admin");
            persist(task1);
          
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            final UserRoles user = new UserRoles("intalio\\admin", new String[] {
                    "examples\\manager", "examples\\employee" });
            task2 = (PATask) taskFetcher.fetchAllAvailableTasks(user)[0];
            TaskEquality.areTasksEquals(task1, task2);
          
            checkRemoved(task2);
View Full Code Here

            Query q = em.createNamedQuery(Task.FIND_BY_ID).setParameter(1, id);
            PATask task2 = (PATask) (q.getResultList()).get(0);
          
            TaskEquality.areTasksEquals(task1, task2);
          
            final UserRoles credentials = new UserRoles("user1",
                    new String[] { "role1" });
            final UserRoles credentials2 = new UserRoles("user2",
                    new String[] { "role2" });
            final UserRoles credentials3 = new UserRoles("user3",
                    new String[] { "role3" });
          
            Assert.assertTrue(task2.isAvailableTo(credentials));
            Assert.assertTrue(task2.isAvailableTo(credentials2));
            Assert.assertFalse(task2.isAvailableTo(credentials3));
View Full Code Here

        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);
View Full Code Here

      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));
View Full Code Here

            Document domInput = null;
            if (omInputContainer.getFirstElement() != null) {
                domInput = new TaskUnmarshaller().unmarshalTaskOutput(omInputContainer);
            }
            final String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles ur = _server.getUserRoles(participantToken);
            final String user = ur.getUserID();           
            final String formUrl = expectElementValue(rootQueue, "formUrl");
            Document userProcessResponse = _server.initProcess(dao,taskID, user, formUrl, domInput, participantToken);
            if (userProcessResponse == null)
                throw new RuntimeException("TMP did not return a correct message while calling init");
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
View Full Code Here

      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));
View Full Code Here

            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);
View Full Code Here

            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));
View Full Code Here

TOP

Related Classes of org.intalio.tempo.workflow.auth.UserRoles

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.