Examples of PATask


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

        _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
         */
 
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.