Package org.intalio.tempo.workflow.task

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


    private Task testRoundTrip(Task task1) throws Exception {
        TaskMarshaller marshaller = new TaskMarshaller();
        task1.getUserOwners().add("user1");
        task1.getUserOwners().add("user2");
        Task task2 = roundMe(task1, marshaller);
        TaskEquality.areTasksEquals(task1, task2);
        return task2;
    }
View Full Code Here


        return task2;
    }

    private Task roundMe(Task task1, TaskMarshaller marshaller) {
        OMElement marshalledTask = marshaller.marshalFullTask(task1, null);
        Task task2 = new TaskUnmarshaller().unmarshalFullTask(marshalledTask);
        _logger.info(">>" + XmlTooling.taskToString(task2));
        return task2;
    }
View Full Code Here

        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String taskID = requireElementValue(rootQueue, "taskId");
            String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles user = _server.getUserRoles(participantToken);
            Task task = _server.getTask(dao,taskID, participantToken);
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement marshalResponse(Task task) {
                    OMElement response = createElement("getTaskResponse");
                    response.addChild(new TaskMarshaller().marshalFullTask(task, user));
                    return response;
View Full Code Here

        ITaskDAOConnection dao=null;
      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            OMElement taskElement = requireElement(rootQueue, "task");
            Task task = new TaskUnmarshaller().unmarshalFullTask(taskElement);
            if (task instanceof PIPATask) {
                throw new InvalidInputFormatException("Not allowed to create() PIPA tasks");
            }
            String participantToken = requireElementValue(rootQueue, "participantToken");
            _server.create(dao,task, participantToken);
View Full Code Here

        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String taskID = requireElementValue(rootQueue, "pipaurl");
            String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles user = _server.getUserRoles(participantToken);
            Task task = _server.getPipa(dao,taskID, participantToken);
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement marshalResponse(Task task) {
                    OMElement response = createElement("getPipaResponse");
                    response.addChild(new TaskMarshaller().marshalFullTask(task, user));
                    return response;
View Full Code Here

    public Task getTask(ITaskDAOConnection dao,String taskID, String participantToken) throws AuthException, UnavailableTaskException,
            AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        
        Task task = dao.fetchTaskIfExists(taskID);
        if ((task != null)) {
            checkIsAvailable(taskID, task, credentials);
            if (_logger.isDebugEnabled())
                _logger.debug("Workflow Task " + taskID + " for user " + credentials.getUserID());
            return task;
View Full Code Here

    }

    public void setOutput(ITaskDAOConnection dao,String taskID, Document output, String participantToken) throws AuthException,
            UnavailableTaskException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithOutput) {
            ITaskWithOutput taskWithOutput = (ITaskWithOutput) task;
            taskWithOutput.setOutput(output);
            dao.updateTask(task);
View Full Code Here

    }

    public void complete(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.COMPLETED);
            dao.updateTask(task);
View Full Code Here

    }

    public void setOutputAndComplete(ITaskDAOConnection dao,String taskID, Document output, String participantToken) throws AuthException,
            UnavailableTaskException, InvalidTaskStateException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithOutput && task instanceof ITaskWithState) {
            ((ITaskWithOutput) task).setOutput(output);
            ((ITaskWithState) task).setState(TaskState.COMPLETED);
            dao.updateTask(task);
View Full Code Here

    public void fail(ITaskDAOConnection dao,String taskID, String failureCode, String failureReason, String participantToken)
            throws AuthException, UnavailableTaskException {
        boolean available = false;

        // UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        available = task instanceof ITaskWithState;
        // && task.isAvailableTo(credentials)
        if (available) {
            ITaskWithState taskWithState = (ITaskWithState) task;
            taskWithState.setState(TaskState.FAILED);
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.