Examples of WorkflowCondition


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

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

            WorkflowCondition condition = null;

            try {
                condition = client.getConditionById(conditionId);
                System.out.println("Condition: [id="
                        + condition.getConditionId() + ", name="
                        + condition.getConditionName() + ", order="
                        + condition.getOrder() + ", class="
                        + condition.getClass().getName() + "]");
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        } else if (operation.equals("--getWorkflowById")) {
View Full Code Here

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

    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
        if (new File(catalogPath).exists()) {
View Full Code Here

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

    }

    public Hashtable getConditionById(String conditionId)
            throws RepositoryException {
        try {
            WorkflowCondition c = repo.getWorkflowConditionById(conditionId);
            return XmlRpcStructFactory.getXmlRpcWorkflowCondition(c);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RepositoryException(
                    "Exception getting condition by id: Message: "
View Full Code Here

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

        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")) {
                gotFalseCond = true;
            }
        }

        assertTrue(gotTrueCond && gotFalseCond);
View Full Code Here

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

        assertTrue(gotTrueCond && gotFalseCond);
    }
   
    public void testConditionsConfiguration() {
        WorkflowCondition condition = null;

        try {
            condition = workflowRepository
                    .getWorkflowConditionById("urn:oodt:CheckForMetadataKeys");
        } catch (Exception e) {
            fail(e.getMessage());
        }

        assertNotNull(condition);
        assertNotNull(condition.getTaskConfig());

        Metadata m = new Metadata();
        m.addMetadata("Met1", "Val1");
        m.addMetadata("Met2", "Val2");
        m.addMetadata("Met3", "Val3");
        GenericWorkflowObjectFactory.getConditionObjectFromClassName(
                condition.getConditionInstanceClassName()).evaluate(m,
                condition.getTaskConfig());
    }
View Full Code Here

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

    }

    private void validateTaskCondition(List conditions) {
        assertNotNull(conditions);
        assertEquals(1, conditions.size());
        WorkflowCondition c = (WorkflowCondition) conditions.get(0);
        assertEquals("urn:oodt:TrueCondition", c.getConditionId());
        assertEquals("True Condition", c.getConditionName());
        assertEquals(1, c.getOrder());
    }
View Full Code Here

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

   
    public void testDataSourceRepo() throws SQLException, RepositoryException {
        DataSourceWorkflowRepository repo = new DataSourceWorkflowRepository(ds);
       
        //test id 1
        WorkflowCondition wc = repo.getWorkflowConditionById("1");
        assertEquals(wc.getConditionName(), "CheckCond");
        WorkflowConditionInstance condInst = GenericWorkflowObjectFactory.getConditionObjectFromClassName(wc.getConditionInstanceClassName());
        Metadata m = new Metadata();
        m.addMetadata("Met1", "Val1");
        m.addMetadata("Met2", "Val2");
        m.addMetadata("Met3", "Val3");
        assertTrue(condInst.evaluate(m, wc.getTaskConfig()));
       
        //test id 2
        wc = repo.getWorkflowConditionById("2");
        assertEquals(wc.getConditionName(), "FalseCond");
        condInst = GenericWorkflowObjectFactory.getConditionObjectFromClassName(wc.getConditionInstanceClassName());
        assertFalse(condInst.evaluate(m, wc.getTaskConfig()));
       
        //test id 3
        wc = repo.getWorkflowConditionById("3");
        assertEquals(wc.getConditionName(), "TrueCond");
        condInst = GenericWorkflowObjectFactory.getConditionObjectFromClassName(wc.getConditionInstanceClassName());
        assertTrue(condInst.evaluate(m, wc.getTaskConfig()));
    }
View Full Code Here

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

            rs = statement.executeQuery(getConditionsSql);
            conditions = new Vector();

            while (rs.next()) {
                // get an instance of the class name
                WorkflowCondition condition = DbStructFactory
                        .getWorkflowCondition(rs, true);
                conditions.add(condition);
            }

            if (conditions.size() == 0) {
View Full Code Here

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

            rs = statement.executeQuery(getConditionsSql);
            conditions = new Vector();

            while (rs.next()) {
                // get an instance of the class name
                WorkflowCondition condition = DbStructFactory
                        .getWorkflowCondition(rs, true);
                conditions.add(condition);
            }

            if (conditions.size() == 0) {
View Full Code Here

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

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

        WorkflowCondition condition = null;

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

            String getConditionsSql = "SELECT * FROM workflow_conditions WHERE workflow_condition_id = "
                    + conditionId;

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

            while (rs.next()) {
                // get an instance of the class name
                condition = DbStructFactory.getWorkflowCondition(rs, false);
                condition.setCondConfig(getConfigurationByConditionId(conditionId));
            }

        } catch (Exception e) {
            e.printStackTrace();
            LOG.log(Level.WARNING,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.