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

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


        myMet = new Metadata();
        myMet.addMetadata("Args", "Faranak");
        myMet.addMetadata("Args", "Davoodi");
        assertNotNull(myMet);
        WorkflowTaskConfiguration myConfig = new WorkflowTaskConfiguration();
        myConfig.addConfigProperty("PathToScript", testScriptPath);
        myConfig.addConfigProperty("ShellType", "/bin/bash");
        assertNotNull(myConfig);
        myIns.run(myMet, myConfig);
        String outputFileStr = null;
        try {
            outputFileStr = FileUtils.readFileToString(new File(
View Full Code Here


        testCond.setConditionInstanceClassName("test.class");
        testCond.setConditionName("test.cond.name");
        testCond.setOrder(1);
        conds.add(testCond);

        testTask.setTaskConfig(new WorkflowTaskConfiguration());
        testTask.setTaskId("test.task.id");
        testTask.setConditions(conds);
        testTask.setOrder(1);
        testTask.setTaskInstanceClassName("test.class");
        testTask.setTaskName("test.task.name");
View Full Code Here

        validateTaskCondition(conditions);
    }

    public void testGetConfigurationByTaskId() {
        WorkflowTaskConfiguration config = null;

        try {
            config = workflowRepository
                    .getConfigurationByTaskId("urn:oodt:GoodbyeWorld");
        } catch (RepositoryException e) {
View Full Code Here

        validateTaskConfiguration(config);
    }

    public void testEnvVarReplaceConfigProperties() {
        WorkflowTaskConfiguration config = null;

        try {
            config = workflowRepository
                    .getConfigurationByTaskId("urn:oodt:PropReplaceTask");
        } catch (RepositoryException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }

        assertNotNull(config);
        String replacedPath = config.getProperty("PathToReplace");
        String expectedValue = System.getenv("HOME") + "/my/path";
        assertEquals("The path: [" + replacedPath
                + "] does not equal the expected" + "path: [" + expectedValue
                + "]", replacedPath, expectedValue);

        String notReplacedPath = config.getProperty("DontReplaceMe");
        String notReplacedPathNoSpec = config
                .getProperty("DontReplaceMeNoSpec");

        assertNotNull(notReplacedPath);
        assertNotNull(notReplacedPathNoSpec);
        assertEquals(notReplacedPath, notReplacedPathNoSpec);
View Full Code Here

        return taskList;
    }

    private WorkflowTaskConfiguration toTaskConfig(String taskId, Document doc) {
        WorkflowTaskConfiguration taskConfig = new WorkflowTaskConfiguration();

        String[] propNames = doc.getValues(taskId + "_config_property_name");
        String[] propValues = doc.getValues(taskId + "_config_property_value");

        if (propNames == null) {
            return taskConfig;
        }

        if (propNames.length != propValues.length) {
            LOG.log(Level.WARNING,
                    "Task Config prop name and value arrays are not "
                            + "of same size!");
            return null;
        }

        for (int i = 0; i < propNames.length; i++) {
            taskConfig.addConfigProperty(propNames[i], propValues[i]);
        }

        return taskConfig;
    }
View Full Code Here

            throws RepositoryException {
        Connection conn = null;
        Statement statement = null;
        ResultSet rs = null;

        WorkflowTaskConfiguration config = null;

        try {
            conn = dataSource.getConnection();
            statement = conn.createStatement();

            String getConfigurationSql = "SELECT * from workflow_task_configuration WHERE workflow_task_id = "
                    + taskId;

            LOG.log(Level.FINE, "getConfigurationByTaskId: Executing: "
                    + getConfigurationSql);
            rs = statement.executeQuery(getConfigurationSql);

            config = new WorkflowTaskConfiguration();
            while (rs.next()) {
                config.getProperties().put(rs.getString("property_name"),
                        rs.getString("property_value"));
            }

            if (config.getProperties().keySet().size() == 0) {
                config = null;
            }

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

     * @return A {@link WorkflowTaskConfiguration} from an XML-RPC
     *         {@link Hashtable}.
     */
    public static WorkflowTaskConfiguration getWorkflowTaskConfigurationFromXmlRpc(
            Hashtable config) {
        WorkflowTaskConfiguration configuration = new WorkflowTaskConfiguration();

        for (Iterator i = config.keySet().iterator(); i.hasNext();) {
            String name = (String) i.next();
            String value = (String) config.get(name);

            configuration.getProperties().put(name, value);
        }

        return configuration;
    }
View Full Code Here

        }

        // load its configuration
        Element configElement = getFirstElement("configuration", taskNode);
        if (configElement != null) {
            task.setTaskConfig(new WorkflowTaskConfiguration(getConfiguration(configElement)));
        }

        return task;
    }
View Full Code Here

    super.setUp();
    task = new FilterTask();
    dynMet = new Metadata();
    dynMet.addMetadata("Filename", filename);
    dynMet.addMetadata("ProductionDateTime", prodDateTime);
    config = new WorkflowTaskConfiguration();
  }
View Full Code Here

    testCond.setConditionInstanceClassName("test.class");
    testCond.setConditionName("test.cond.name");
    testCond.setOrder(1);
    conds.add(testCond);

    testTask.setTaskConfig(new WorkflowTaskConfiguration());
    testTask.setTaskId("test.task.id");
    testTask.setConditions(conds);
    testTask.setOrder(1);
    testTask.setTaskInstanceClassName("test.class");
    testTask.setTaskName("test.task.name");
View Full Code Here

TOP

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

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.