Examples of PIPATask


Examples of org.intalio.tempo.workflow.task.PIPATask

    URI uri = new URI("http://hellonico.net");
    switch (type) {
    case NOTIFICATION:
      return new Notification(id, uri, xml.parseXML("<hello/>"));
    case PIPA:
      return new PIPATask(id, uri, uri, uri, "initOperationSOAPAction");
    case PA:
      return new PATask(id, new URI("http://hellonico.net"), "processId",
          "soap", xml.parseXML("<hello/>"));
    default:
      int rand = random.nextInt(3);
      switch (rand) {
      case 0:
        return new PATask(id, new URI("http://hellonico.net"),
            "processId", "soap", xml.parseXML("<hello/>"));
      case 1:
        return new PIPATask(id, uri, uri, uri,
            "initOperationSOAPAction");
      default:
        return new Notification(id, uri, xml.parseXML("<hello/>"));
      }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

      UserRoles ur = new UserRoles("Matthieu", new AuthIdentifierSet(new String[]{"intalio\\admin", "intalio\\tester"}));
      UserRoles ur2 = new UserRoles("Niko", new AuthIdentifierSet(new String[]{"intalio\\guru"}));
      UserRoles ur3 = new UserRoles("just\\me", new AuthIdentifierSet(new String[]{"intalio\\guru"}));
     
     
      Assert.assertFalse(tp.isAuthorized("create", new PIPATask(), ur));
      Assert.assertTrue(tp.isAuthorized("delete", new PIPATask(), ur));
      Assert.assertFalse(tp.isAuthorized("delete", new PIPATask(), ur2));
      Assert.assertFalse(tp.isAuthorized("delete", new PIPATask(), ur3));
      Assert.assertTrue(tp.isAuthorized("create", new PIPATask(), ur3));
     
  }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

        entityManager.persist(task);
    }

    public void deletePipaTask(String formUrl) {
        try {
            PIPATask toDelete = _fetcher.fetchPipaFromUrl(formUrl);
            checkTransactionIsActive();
            entityManager.remove(toDelete);
        } catch (Exception nre) {
            throw new NoResultException(nre.getMessage());
        }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

        checkTransactionIsActive();
        entityManager.persist(task);
    }

    public PIPATask fetchPipa(String formUrl) throws UnavailableTaskException {
        PIPATask pipa = _fetcher.fetchPipaFromUrl(formUrl);
        return pipa;
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

        Assert.assertEquals(attachment1.getPayloadURL(), task4.getAttachments().iterator().next().getPayloadURL());
    }

    public void testPipa() throws Exception {
        Random rand = new Random();
        PIPATask task1 = new PIPATask("abc", "http://localhost/" + rand.nextInt());
        task1.setInitMessageNamespaceURI(URI.create("urn:ns"));
        task1.setProcessEndpointFromString("http://localhost/process" + rand.nextInt());
        task1.setInitOperationSOAPAction("initProcess" + rand.nextInt());

        String[] unnormalizedRoles = { "jkl/jkl", "mno\\mno", "pqr.pqr" };
        task1.setRoleOwners(unnormalizedRoles);

        ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
        tms.storePipa(task1);
        PIPATask task2 = tms.getPipa(task1.getProcessEndpoint().toString());
        TaskEquality.areTasksEquals(task1, task2);
        _logger.debug(task2.getRoleOwners().toString());
        tms.deletePipa(task1.getProcessEndpoint().toString());
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

     /**
         *Test round trip marshalling of PIPA task
         */
    public void testPIPAMarshallingRoundtrip() throws Exception {
        PIPATask task1 = new PIPATask("taskID", new URI("http://localhost/URL"), new URI("http://localhost/URL1"),
                new URI("urn:ns"), "urn:action");
        testRoundTrip(task1);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

        TaskMarshaller marshaller = new TaskMarshaller();
        _logger.debug(TestUtils.toPrettyXML(marshaller.marshalTaskMetadata(task, roles)));
    }

    public void testPIPATaskMarshalling() throws Exception {
        PIPATask task = new PIPATask("id", new URI("http://localhost/form"), new URI("http://localhost/endpoint"), new URI("urn:initNS"), "urn:initSoapAction");
        task.getUserOwners().add("test/user1");
        task.getRoleOwners().add("test.role1");
        task.getRoleOwners().add("test\\role2");
       
       

        this.testTaskMarshalling(task);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

        task.authorizeActionForUser("dismiss", "test/user1");
        this.testTaskMarshalling(task);
    }

    public void testPIPATaskMetaMarshalling() throws Exception {
        PIPATask task = new PIPATask("id", new URI("http://localhost/form"), new URI("http://localhost/endpoint"), new URI("urn:initNS"), "urn:initSoapAction");
        task.getUserOwners().add("test/user1");
        task.getRoleOwners().add("test.role1");
        task.getRoleOwners().add("test\\role2");
        this.testTaskMetadataMarshalling(task, null);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.task.PIPATask

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

Examples of org.intalio.tempo.workflow.task.PIPATask

    private static final String PROPERTY_FORM_URI = "formURI";

    public static PIPATask parsePipa(Properties prop) {
        logger.info("Parse PIPA using properties: " + prop.toString());

        PIPATask task = new PIPATask(UUID.randomUUID().toString(), prop.getProperty(PROPERTY_FORM_URI));
        task.setDescription(prop.getProperty(PROPERTY_DESCRIPTION));
        task.setInitMessageNamespaceURI(URI.create(prop.getProperty(PROPERTY_FORM_NS)));
        task.setProcessEndpointFromString(prop.getProperty(PROPERTY_PROCESS_ENDPOINT));
        task.setInitOperationSOAPAction(prop.getProperty(PROPERTY_USER_PROCESS_INIT_ACTION));

        String userOwnerHeader = prop.getProperty(PROPERTY_TASK_USER_OWNERS);
        String[] userOwners = split(userOwnerHeader);
        task.setUserOwners(userOwners);

        String roleOwnerHeader = prop.getProperty(PROPERTY_TASK_ROLE_OWNERS);
        String[] roleOwners = split(roleOwnerHeader);
        task.setRoleOwners(roleOwners);
        return task;
    }
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.