Examples of RemoteTMSFactory


Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

        junit.textui.TestRunner.run(RemoteTMSClientTest.class);
    }


    public void testInput() throws Exception {
        ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
        Document input1 = Utils.createXMLDocument("/absr.xml");
        String task1ID = nextRandom();
        PATask task1 = new PATask(task1ID, new URI("http://localhost/1"), "processID", "urn:completeSOAPAction", input1);
        task1.getUserOwners().add("intalio\\admin");
        tms.create(task1);
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

        PATask task2 = (PATask) tms.getTask(task1ID);
        TaskEquality.areTasksEquals(task1, task2);
    }

    public void testUpdate() throws Exception {
        ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
        Document input1 = Utils.createXMLDocument("/absr.xml");
        String id = "583c10bfdbd326ba:69a8b3cd:124dd681279:-7ef6127.0.1.1163844" + System.currentTimeMillis();
        PATask task1 = new PATask(id, new URI("http://localhost/1"), "processID", "urn:completeSOAPAction", input1);
        String description = "new two:" + System.currentTimeMillis();
        task1.getUserOwners().add("intalio\\admin");
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

    }

    public void testPIPAInit() throws Exception {
        String pipaId = "d1f20ad2-bba4-45aa-b449-d2f147c84561";
        Document outputForInit = Utils.createXMLDocument("/japaneseOutputForPipa.xml");
        ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
        Task[] tasks = tms.getTaskList();
        for (Task t : tasks) {
            if (t instanceof PIPATask) {
                pipaId = t.getID();
                break;
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

        }
        tms.init(pipaId, outputForInit);
    }

    public void testBasicPATaskLifecycle() throws Exception {
        ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
        Task[] tasks = tms.getTaskList();
        Assert.assertNotNull(tasks);

        String task1ID = nextRandom();
        PATask task1 = new PATask(task1ID, new URI("http://localhost/1"), "processID", "urn:completeSOAPAction", Utils.createXMLDocument());
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

    private String nextRandom() {
        return String.valueOf(((Integer) SECURE_RANDOM.nextInt(100000000)));
    }

    public void testAttachments() throws Exception {
        ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();

        String task1ID = nextRandom();
        PATask task1 = new PATask(task1ID, new URI("http://localhost/1"), "processID", "urn:completeSOAPAction", Utils.createXMLDocument());
        task1.getUserOwners().add("test.system-test");
        task1.getUserOwners().add("intalio\\admin");
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

        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.tms.client.RemoteTMSFactory

        _logger.debug(task2.getRoleOwners().toString());
        tms.deletePipa(task1.getProcessEndpoint().toString());
    }
   
    public void testUpdate2() throws Exception {
      ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
      Task[] tasks = tms.getAvailableTasks(TaskType.ACTIVITY.name(), "");
      Random rand = new Random();
      ((PATask)tasks[0]).setPriority(rand.nextInt(10));
      tms.update(tasks[0]);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

      ((PATask)tasks[0]).setPriority(rand.nextInt(10));
      tms.update(tasks[0]);
    }
   
    public void testMultipleReassign() throws Exception {
      ITaskManagementService tms = new RemoteTMSFactory(TMS_REMOTE_URL, TOKEN).getService();
     
     
      Task[] tasks = tms.getAvailableTasks(TaskType.ACTIVITY.name(), "");
      TaskState newState = TaskState.READY;
      if(((PATask)tasks[0]).getState().equals(TaskState.READY))
View Full Code Here

Examples of org.intalio.tempo.workflow.tms.client.RemoteTMSFactory

        initSecurityProvider();
        initRBACProvider();
    }

    public void testReassginTaskLifecycle() throws Exception {
        ITaskManagementService tms = new RemoteTMSFactory(
                "http://localhost:8080/axis2/services/TaskManagementServices", TOKEN_CURRENT).getService();

        /*
         * Get available users
         */
        _logger.debug("Get the users from role: " + ROLE_TARGET2);
        RBACQuery query = rbacProvider.getQuery();
        String[] users = query.assignedUsers(ROLE_TARGET2);
        _logger.debug("Get the users: " + Arrays.asList(users));

        /*
         * Create a new task for current user
         */
        PATask task1 = new PATask(String.valueOf(new Random().nextInt(10000)), new URI("http://localhost/1"),
                "processID", "urn:completeSOAPAction", Utils.createXMLDocument());
        task1.getUserOwners().add(USER_CURRENT);
        tms.create(task1);

        /*
         * Get task list of current user
         */
        _logger.debug("Get the task list from token: " + TOKEN_CURRENT);
        Task[] tasks = tms.getTaskList();

        /*
         * Select one task to re-assign
         */
        PATask selectTask = null;
        for (Task task : tasks) {
            _logger.debug(task.getClass().getName());
            if (task instanceof PATask) {
                selectTask = (PATask) task;
                break;
            }
        }
        if (selectTask == null) {
            throw new Exception("There is no PATask in the current user[examples\\msmith] task list");
        }
        String selectTaskId = selectTask.getID();
        _logger.debug("Select one task: " + selectTaskId);

        /*
         * Select a user to be re-assigned.
         */
        AuthIdentifierSet targetUserSet = new AuthIdentifierSet();
        String targetUserId = users[0];
        _logger.debug("Select one target user = " + targetUserId);
        targetUserSet.add(targetUserId);

        /*
         * Re-assign task
         */
        Collection<String> uOwners = selectTask.getUserOwners();
        uOwners.clear();
        selectTask.getRoleOwners().clear();
        selectTask.getUserOwners().addAll(targetUserSet);

        tms.reassign(new String[] {selectTask.getID()}, (AuthIdentifierSet)selectTask.getUserOwners(), (AuthIdentifierSet) selectTask.getRoleOwners(), selectTask.getState());
        _logger.debug("Reassign task[" + selectTaskId + "] to " + targetUserId);

        /*
         * check that the task is not in the inbox of current user
         */
        boolean task_nowuser_inbox = false;
        Task[] tasks2 = tms.getTaskList();
        for (int i = 0; i < tasks2.length; i++) {
            if (selectTaskId.equalsIgnoreCase(tasks2[i].getID())) {
                task_nowuser_inbox = true;
            }
        }
        if (!task_nowuser_inbox) {
            _logger.debug("The task " + selectTaskId + " is not in the current user[" + USER_CURRENT + "]");
        }
        Assert.assertEquals(false, task_nowuser_inbox);

        /*
         * check that the task is not in the inbox of target user
         */
        ITaskManagementService tms_target = new RemoteTMSFactory(
                "http://localhost:8080/axis2/services/TaskManagementServices", TOKEN_TARGET2).getService();
        boolean task_targetuser_inbox = false;
        Task[] tasks3 = tms_target.getTaskList();
        for (int i = 0; i < tasks3.length; i++) {
            if (selectTaskId.equalsIgnoreCase(tasks3[i].getID())) {
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.