Package org.apache.oodt.cas.workflow.structs

Examples of org.apache.oodt.cas.workflow.structs.WorkflowTask


            // create the client
            XmlRpcWorkflowManagerClient client = new XmlRpcWorkflowManagerClient(
                    new URL(url));

            WorkflowTask task = null;

            try {
                task = client.getTaskById(taskId);
                System.out.println("Task: [id=" + task.getTaskId() + ", name="
                        + task.getTaskName() + ", order=" + task.getOrder()
                        + ", class=" + task.getClass().getName()
                        + ", numConditions=" + task.getConditions().size()
                        + ", configuration="
                        + task.getTaskConfig().getProperties() + "]");
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
View Full Code Here


    private static final int defaultPgSz = 20;

    public TestLuceneWorkflowInstanceRepository() {
        testInst = new WorkflowInstance();
        testWkflw = new Workflow();
        testTask = new WorkflowTask();
        testCond = new WorkflowCondition();

        // check to see if catalog path exists: (it may b/c
        // the user may run many unit tests)
        // if it exists, blow it away
View Full Code Here

    }

    public Hashtable getTaskById(String taskId) throws RepositoryException {
        try {
            WorkflowTask t = repo.getWorkflowTaskById(taskId);
            return XmlRpcStructFactory.getXmlRpcWorkflowTask(t);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RepositoryException(
                    "Exception getting task by id: Message: " + e.getMessage());
View Full Code Here

                notReplacedPath);

    }

    public void testMultipleConditions() {
        WorkflowTask multiTask = null;

        try {
            multiTask = workflowRepository
                    .getWorkflowTaskById("urn:oodt:TestMultiConditionTask");
        } catch (Exception e) {
            fail(e.getMessage());
        }

        assertNotNull(multiTask);
        assertNotNull(multiTask.getConditions());
        assertEquals(2, multiTask.getConditions().size());

        boolean gotTrueCond = false, gotFalseCond = false;

        for (int i = 0; i < multiTask.getConditions().size(); i++) {
            WorkflowCondition c = (WorkflowCondition) multiTask.getConditions()
                    .get(i);
            assertNotNull(c);
            if (c.getConditionName().equals("True Condition")) {
                gotTrueCond = true;
            } else if (c.getConditionName().equals("False Condition")) {
View Full Code Here

    private void validateBackwardsWorkflowTasks(List tasks) {
        assertNotNull(tasks);
        assertEquals(2, tasks.size());

        WorkflowTask t1 = (WorkflowTask) tasks.get(0);
        assertEquals("Goodbye World", t1.getTaskName());
        assertEquals("urn:oodt:GoodbyeWorld", t1.getTaskId());
        assertEquals(1, t1.getOrder());
        validateTaskConfiguration(t1.getTaskConfig());
        validateTaskCondition(t1.getConditions());

        WorkflowTask t2 = (WorkflowTask) tasks.get(1);
        assertEquals("Hello World", t2.getTaskName());
        assertEquals("urn:oodt:HelloWorld", t2.getTaskId());
        assertEquals(2, t2.getOrder());
        validateTaskConfiguration(t2.getTaskConfig());
        validateTaskCondition(t2.getConditions());

    }
View Full Code Here

    public static String getTaskNameFromTaskId(WorkflowInstance w, String taskId) {
        if (w.getWorkflow() != null && w.getWorkflow().getTasks() != null
                && w.getWorkflow().getTasks().size() > 0) {
            for (Iterator i = w.getWorkflow().getTasks().iterator(); i
                    .hasNext();) {
                WorkflowTask task = (WorkflowTask) i.next();
                if (task.getTaskId().equals(taskId)) {
                    return task.getTaskName();
                }
            }

            return null;
        } else
View Full Code Here

    }

    private void addTasksToDoc(Document doc, List tasks) {
        if (tasks != null && tasks.size() > 0) {
            for (Iterator i = tasks.iterator(); i.hasNext();) {
                WorkflowTask task = (WorkflowTask) i.next();
                doc.add(new Field("task_id", task.getTaskId(), Field.Store.YES,
                        Field.Index.UN_TOKENIZED));
                doc.add(new Field("task_name", task.getTaskName(),
                        Field.Store.YES, Field.Index.NO));
                doc.add(new Field("task_order",
                        String.valueOf(task.getOrder()), Field.Store.YES,
                        Field.Index.NO));
                doc.add(new Field("task_class",
                        task.getTaskInstanceClassName(), Field.Store.YES,
                        Field.Index.NO));

                addConditionsToDoc(task.getTaskId(), task.getConditions(), doc);
                addTaskConfigToDoc(task.getTaskId(), task.getTaskConfig(), doc);
            }
        }
    }
View Full Code Here

                            + "task list from Document!");
            return null;
        }

        for (int i = 0; i < taskIds.length; i++) {
            WorkflowTask task = new WorkflowTask();
            task.setOrder(Integer.parseInt(taskOrders[i]));
            task.setTaskName(taskNames[i]);
            task.setTaskId(taskIds[i]);
            task.setTaskInstanceClassName(taskClasses[i]);

            task.setConditions(toConditions(task.getTaskId(), doc));
            task.setTaskConfig(toTaskConfig(task.getTaskId(), doc));
            taskList.add(task);
        }

        return taskList;
    }
View Full Code Here

            tasks = new Vector();

            while (rs.next()) {
                // get an instance of the class name

                WorkflowTask task = DbStructFactory.getWorkflowTask(rs, true);

                if (task != null) {
                    task.setConditions(getConditionsByTaskId(task.getTaskId()));
                    task.setTaskConfig(getConfigurationByTaskId(task
                            .getTaskId()));
                    tasks.add(task);
                }
            }
View Full Code Here

            rs = statement.executeQuery(getTasksSql);
            tasks = new Vector();

            while (rs.next()) {
                // get an instance of the class name
                WorkflowTask task = DbStructFactory.getWorkflowTask(rs, true);

                if (task != null) {
                    task.setConditions(getConditionsByTaskId(task.getTaskId()));
                    task.setTaskConfig(getConfigurationByTaskId(task
                            .getTaskId()));
                    tasks.add(task);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.structs.WorkflowTask

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.