Examples of TaskFetcher


Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

    private TaskFetcher _fetcher;

    public JPATaskDaoConnection(EntityManager createEntityManager) {
        super(createEntityManager);
        _fetcher = new TaskFetcher(createEntityManager);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

     @Test
          public void testNativeQueryForAllPATasks() throws Exception {
         
           UserRoles ur = new UserRoles("niko",
                   new String[] { "examples\\employee" });
           final TaskFetcher taskFetcher = new TaskFetcher(em);
         
           // get your query from here
           Task[] list1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
           // we make sure no previous tasks left here
           checkRemoved(list1);
         
           // create and persist a new task for user niko
           PATask task1 = new PATask(getUniqueTaskID(), new URI(
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

           task1.setInput("OR true; DELETE * FROM tempo_task;");
           task1.getUserOwners().add("niko");
           persist(task1);
           UserRoles ur = new UserRoles("niko",
                   new String[] { "examples\\employee" });
           final TaskFetcher taskFetcher = new TaskFetcher(em);
           Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
         
           Assert.assertEquals(1, t1.length);
           checkRemoved(new Task[] { task1 });
          }
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

          task2.addAttachment(att3);
          persist(task2);
        
          UserRoles ur = new UserRoles("niko",
                  new String[] { "examples\\employee" });
          final TaskFetcher taskFetcher = new TaskFetcher(em);
        
          // test task1 has two attachments
          String query = "(T._id = '" + task1.getID() + "')";
          Task[] t2 = taskFetcher.fetchAvailableTasks(ur, PATask.class, query);
          Assert.assertTrue(t2[0] instanceof PATask);
          PATask t = (PATask) t2[0];
          Collection<Attachment> atts = t.getAttachments();
          Assert.assertEquals(2, atts.size());
        
          // test the two attachments are different
          Iterator<Attachment> iter = atts.iterator();
          Attachment a1 = iter.next();
          Attachment a2 = iter.next();
          Assert.assertNotSame(a1.getPayloadURL(), a2.getPayloadURL());
        
          // test task2 has one attachment
          query = "(T._id = '" + task2.getID() + "')";
          t2 = taskFetcher.fetchAvailableTasks(ur, PATask.class, query);
          Assert.assertTrue(t2[0] instanceof PATask);
          t = (PATask) t2[0];
          Assert.assertEquals(1, t.getAttachments().size());
        
          // task2 attachments are not the same as task1
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

             task1.setInput(someJapanese);
             task1.getUserOwners().add(someJapanese);
             persist(task1);
             UserRoles ur = new UserRoles(someJapanese,
                     new String[] { "examples\\employee" });
             final TaskFetcher taskFetcher = new TaskFetcher(em);
             Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
             Assert.assertEquals(1, t1.length);
             checkRemoved(new Task[] { task1 });
            }
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

            task2.getUserOwners().add("niko");
            persist(task2);
          
            UserRoles ur = new UserRoles("niko",
                    new String[] { "examples\\employee" });
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            Task[] ts = taskFetcher.fetchAvailableTasks(ur, PIPATask.class, "");
            Assert.assertEquals(2, ts.length);
          
            PIPATask t3 = taskFetcher
                    .fetchPipaFromUrl("http://hellonicoUnique1.net");
            TaskEquality.areTasksEquals(task1, t3);
          
            PIPATask tt1 = taskFetcher.fetchPipaFromUrl(task1.getProcessEndpoint()
                    .toString());
            TaskEquality.areTasksEquals(task1, tt1);
          
            jpa.begin();
            em.remove(tt1);
            jpa.commit();
          
            try {
                PIPATask ttt1 = taskFetcher.fetchPipaFromUrl(task1
                        .getProcessEndpoint().toString());
                Assert.fail("Should throw an exception");
            } catch (Exception e) {
          
            }
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

            task2.getUserOwners().add("niko");
            persist(task2);
          
            UserRoles ur = new UserRoles("niko",
                    new String[] { "examples\\employee" });
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, query);
            Assert.assertEquals(1, t1.length);
          
            checkRemoved(new Task[] { task1, task2 });
           }
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

                task1.getRoleOwners().add(role);
            task1.getUserOwners().add("niko");
            persist(task1);
          
            UserRoles ur = new UserRoles("niko", assignedRoles);
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
          
            Assert.assertEquals(1, t1.length);
            checkRemoved(new Task[] { task1 });
           }
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

            task3.getUserOwners().add("niko");
            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);
            Assert.assertEquals(2, t2.length);
            Assert.assertEquals(0, t3.length);
View Full Code Here

Examples of org.intalio.tempo.workflow.util.jpa.TaskFetcher

            task1.getUserOwners().add(user);
            persist(task1);
            em.clear(); // <--- this was causing problems as getSingleResult is
            // optimized in openjpa12 and clear the entity manager
            // somehow
            final TaskFetcher taskFetcher = new TaskFetcher(em);
            Notification task3 = (Notification) taskFetcher.fetchTaskIfExists(task1
                    .getID());
          
            checkRemoved(task1);
           }
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.