Package org.intalio.tempo.workflow.task

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


        }.marshalRequest();

        try {
            OMElement response = sendRequest(request, TaskXMLConstants.TASK_NAMESPACE + "getTask");
            OMElement taskElement = response.getFirstElement();
            Task task = new TaskUnmarshaller().unmarshalFullTask(taskElement);

            return task;
        } catch (InvalidInputFormatException e) {
            throw new RuntimeException(e);
        }
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

        Attachments attachmentsElement = taskMetadata.getAttachments();
        String isChainedBeforeStr = expectElementValue(taskMetadata, "isChainedBefore");
        String previousTaskID = expectElementValue(taskMetadata, "previousTaskId");

        Class<? extends Task> taskClass = TaskTypeMapper.getTypeClassByName(taskTypeStr);
        Task resultTask = null;
        TaskState taskState = null;

        if (!ITaskWithState.class.isAssignableFrom(taskClass)) {
            forbidParameter(taskStateStr, "task state");
            forbidParameter(failureCode, "failure code");
            forbidParameter(failureReason, "failure reason");
        } else {
            try {
                taskState = (taskStateStr == null) ? TaskState.READY : TaskState.valueOf(taskStateStr.toUpperCase());
            } catch (IllegalArgumentException e) {
                _logger.error("Error in unmarshalling task from metadata", e);
                throw new InvalidInputFormatException("Unknown task state: '" + taskStateStr + "'");
            }
        }
        if (IProcessBoundTask.class.isAssignableFrom(taskClass)) {
            if (taskMetadata.xgetProcessId() == null) {
                /*
                 * The following line will be commented to support versions of
                 * designer that do not generate the processId
                 */

                // throw new
                // InvalidInputFormatException("ProcessID not specified");
            }
        } else {
            forbidParameter(processID, "processID");
        }
        if (IInstanceBoundTask.class.isAssignableFrom(taskClass)) {
            if (taskMetadata.xgetInstanceId() == null) {
                /*
                 * The following line will be commented to support versions of
                 * designer that do not generate the InstanceId
                 */
                // throw new
                // InvalidInputFormatException("instanceID not specified");
            }
        } else {
            forbidParameter(instanceID, "instanceID");
        }
        if (ICompleteReportingTask.class.isAssignableFrom(taskClass)) {
            requireParameter(completeSOAPAction, "completion SOAPAction");
        } else {
            forbidParameter(completeSOAPAction, "completion SOAPAction");
        }
        if (!ITaskWithAttachments.class.isAssignableFrom(taskClass)) {
            forbidParameter(attachmentsElement, "task attachment(s)");
        }
        if (!IChainableTask.class.isAssignableFrom(taskClass)) {
            forbidParameter(isChainedBeforeStr, "is-chained-before flag");
            forbidParameter(previousTaskID, "previous chained task ID");
        }

        resultTask = TaskTypeMapper.getNewInstance(taskClass, taskID, formURL);

        resultTask.getUserOwners().addAll(userOwners);
        resultTask.getRoleOwners().addAll(roleOwners);

        resultTask.setDescription(description == null ? "" : description);

        try {
            Calendar creationDate = taskMetadata.getCreationDate();
            if (creationDate != null)
                resultTask.setCreationDate(creationDate.getTime());
            else
                resultTask.setCreationDate(new Date());
        } catch (XmlValueOutOfRangeException e) {
            resultTask.setCreationDate(new Date());
        }

        for (String action : actions) {
            ACL acl = readACL(taskMetadata, action);
            authorize(resultTask, action, acl);
View Full Code Here

    private Task unmarshalFullTask(XmlObject rootElement) throws InvalidInputFormatException {
        if (rootElement == null) {
            throw new RequiredArgumentException("rootElement");
        }
        Task resultTask = null;

        requireElement(rootElement, "metadata");

        com.intalio.bpms.workflow.taskManagementServices20051109.Task taskElement = com.intalio.bpms.workflow.taskManagementServices20051109.Task.Factory
                        .newInstance();
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.