Package org.intalio.tempo.workflow.task

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


        UserRoles credentials = _authProvider.authenticate(participantToken);

        String userID = credentials.getUserID();
        for (String taskID : taskIDs) {
            try {
                Task task = dao.fetchTaskIfExists(taskID);
                if (_permissions.isAuthorized(TaskPermissions.ACTION_DELETE, task, credentials)) {
                    dao.deleteTask(task.getInternalId(), taskID);
                    dao.commit();
                    if (_logger.isDebugEnabled())
                        _logger.debug(userID + " has deleted Workflow Task " + task);
                } else {
                    problemTasks.put(taskID, new AuthException(userID + " cannot delete" + taskID));
View Full Code Here


    }

    public void update(ITaskDAOConnection dao,TaskMetadata task, String participantToken) throws AuthException, TMSException, AxisFault {
        try {
            String id = task.getTaskId();
            Task previous = dao.fetchTaskIfExists(id);
            if (previous != null && (previous instanceof PATask)) {
                PATask paPrevious = (PATask) previous;

                // security ?
                UserRoles credentials = _authProvider.authenticate(participantToken);
View Full Code Here

    }

    public Document initProcess(ITaskDAOConnection dao,String taskID, String user, String formUrl, Document input, String participantToken)
            throws AuthException, UnavailableTaskException, AccessDeniedException, AxisFault {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof PIPATask) {
            PIPATask pipaTask = (PIPATask) task;
            Document document = sendInitMessage(pipaTask, user, formUrl, participantToken, input);
            if (_logger.isDebugEnabled())
View Full Code Here

    }

    public Attachment[] getAttachments(ITaskDAOConnection dao,String taskID, String participantToken) throws AuthException,
            UnavailableTaskException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithAttachments) {
            ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) task;
            return taskWithAttachments.getAttachments().toArray(new Attachment[] {});
        } else {
View Full Code Here

    }

    public void addAttachment(ITaskDAOConnection dao,String taskID, Attachment attachment, String participantToken) throws AuthException,
            UnavailableTaskException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithAttachments == false) {
            throw new UnavailableTaskException("Task does not support attachments");
        }
        ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) task;
View Full Code Here

    }

    public void removeAttachment(ITaskDAOConnection dao,String taskID, URL attachmentURL, String participantToken) throws AuthException,
            UnavailableAttachmentException, UnavailableTaskException {

        Task task = null;
        boolean availableTask = false;
        boolean availableAttachment = false;

        UserRoles credentials = _authProvider.authenticate(participantToken);
        try {
            task = dao.fetchTaskIfExists(taskID);
            availableTask = task instanceof ITaskWithAttachments && task.isAvailableTo(credentials);
            if (availableTask) {
                ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) task;
                Attachment removedAttachment = taskWithAttachments.removeAttachment(attachmentURL);
                availableAttachment = (removedAttachment != null);
                if (availableAttachment) {
View Full Code Here

        // to be present
        // .authenticate(participantToken); // for the Escalations to work. This
        // is
        // a security hole for now!

        Task task = null;
        boolean available = false;

        try {
            task = dao.fetchTaskIfExists(taskID);
            // if (task.isAvailableTo(credentials) && (task instanceof
            // ITaskWithState)) { // TODO: see above
            available = task instanceof ITaskWithState;
            if (available) {
                ((ITaskWithState) task).setState(state);
                task.setUserOwners(users);
                task.setRoleOwners(roles);

                dao.updateTask(task);
                dao.commit();
                if (_logger.isDebugEnabled())
                    _logger.debug(" changed to user owners " + users + " and role owners " + roles);
View Full Code Here

            dao.commit();
        } else {
            UserRoles credentials = _authProvider.authenticate(participantToken);
            String userID = credentials.getUserID();
            try {
                Task task = dao.fetchPipa(formUrl);
                if (_permissions.isAuthorized(TaskPermissions.ACTION_DELETE, task, credentials)) {
                    dao.deletePipaTask(formUrl);
                    dao.commit();
                    if (_logger.isDebugEnabled())
                        _logger.debug(userID + " has deleted PIPA Task " + task);
View Full Code Here

    }

    public void skip(ITaskDAOConnection dao,String taskID, String participantToken) throws AuthException, UnavailableTaskException,
            InvalidTaskStateException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithState) {
            ITaskWithState taskWithState = (ITaskWithState) task;
            taskWithState.setState(TaskState.OBSOLETE);
            dao.updateTask(task);
View Full Code Here

            OMElement taskElement = expectElement(rootQueue, "task");
            if (taskElement == null)
                break;

            try {
                Task task = new TaskUnmarshaller().unmarshalTaskFromMetadata(taskElement);
                tasks.add(task);
            } catch (Exception e) {
                _log.error("Error reading task: " + taskElement, e);
            }
        }
View Full Code Here

TOP

Related Classes of org.intalio.tempo.workflow.task.Task

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.