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

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


                            + "rebuilding from given Document");
            return null;
        }

        for (int i = 0; i < condNames.length; i++) {
            WorkflowCondition cond = new WorkflowCondition();
            cond.setConditionId(condIds[i]);
            cond.setConditionInstanceClassName(condClasses[i]);
            cond.setConditionName(condNames[i]);
            cond.setOrder(Integer.parseInt(condOrders[i]));
        }

        return condList;
    }
View Full Code Here


            if (conditionNodes != null && conditionNodes.getLength() > 0) {
                List conditionList = new Vector(conditionNodes.getLength());

                for (int i = 0; i < conditionNodes.getLength(); i++) {
                    Element conditionNode = (Element) conditionNodes.item(i);
                    WorkflowCondition condition = (WorkflowCondition) conditions
                            .get(conditionNode.getAttribute("id"));

                    if (condition != null) {
                        WorkflowCondition workflowCondition = new WorkflowCondition();
                        workflowCondition
                                .setConditionInstanceClassName(condition
                                        .getConditionInstanceClassName());
                        workflowCondition.setConditionId(condition
                                .getConditionId());
                        workflowCondition.setConditionName(condition
                                .getConditionName());
                        workflowCondition.setOrder(i + 1);
                        workflowCondition.setCondConfig(condition.getTaskConfig());
                        conditionList.add(workflowCondition);
                    }
                }

                task.setConditions(conditionList);
View Full Code Here

     */
    public static WorkflowCondition getWorkflowCondition(Node node) {
        Element conditionElement = (Element) node;

        String conditionClassName = conditionElement.getAttribute("class");
        WorkflowCondition condition = new WorkflowCondition();
        condition.setConditionInstanceClassName(conditionClassName);
        condition.setConditionId(conditionElement.getAttribute("id"));
        condition.setConditionName(conditionElement.getAttribute("name"));
       
        // load its configuration
        Element configElement = getFirstElement("configuration", conditionElement);
        if (configElement != null) {
            condition.setCondConfig(new WorkflowConditionConfiguration(getConfiguration(configElement)));
        }
       
        return condition;

    }
View Full Code Here

            boolean setOrder) throws SQLException {

        String conditionClassName = rs.getString("workflow_condition_class");

        if (conditionClassName != null) {
            WorkflowCondition condition = new WorkflowCondition();
            condition.setConditionInstanceClassName(conditionClassName);
            condition.setConditionId(String.valueOf(rs
                    .getInt("workflow_condition_id")));
            condition.setConditionName(rs.getString("workflow_condition_name"));
            if (setOrder) {
                condition.setOrder(rs.getInt("condition_order"));
            }
            return condition;
        } else
            return null;
    }
View Full Code Here

      String taskId = wInst.getCurrentTaskId();
      WorkflowTask task = getTaskById(wInst.getWorkflow(), taskId);
      List conditionList = task.getConditions();
     
        for (Iterator i = conditionList.iterator(); i.hasNext();) {
            WorkflowCondition c = (WorkflowCondition) i.next();
            WorkflowConditionInstance cInst = null;

            // see if we've already cached this condition instance
            if (CONDITION_CACHE.get(taskId) != null) {
                HashMap conditionMap = (HashMap) CONDITION_CACHE.get(taskId);

                /*
                 * okay we have some conditions cached for this task, see if we
                 * have the one we need
                 */
                if (conditionMap.get(c.getConditionId()) != null) {
                    cInst = (WorkflowConditionInstance) conditionMap.get(c
                            .getConditionId());
                }
                /* if not, then go ahead and create it and cache it */
                else {
                    cInst = GenericWorkflowObjectFactory
                            .getConditionObjectFromClassName(c
                                    .getConditionInstanceClassName());
                    conditionMap.put(c.getConditionId(), cInst);
                }
            }
            /* no conditions cached yet, so set everything up */
            else {
                HashMap conditionMap = new HashMap();
                cInst = GenericWorkflowObjectFactory
                        .getConditionObjectFromClassName(c
                                .getConditionInstanceClassName());
                conditionMap.put(c.getConditionId(), cInst);
                CONDITION_CACHE.put(taskId, conditionMap);
            }

            // actually perform the evaluation
            if (!cInst.evaluate(wInst.getSharedContext(), c.getTaskConfig())) {
                return false;
            }
        }

        return true;
View Full Code Here

                    System.out.println("Conditions: ");

                    for (Iterator k = task.getConditions().iterator(); k
                            .hasNext();) {
                        WorkflowCondition condition = (WorkflowCondition) k
                                .next();
                        System.out.println("Condition: ["
                                + condition.getClass().getName() + ", id="
                                + condition.getConditionId() + ", name="
                                + condition.getConditionName() + ", order="
                                + condition.getOrder() + "]");
                    }

                }

            }
View Full Code Here

  public TestXmlRpcWorkflowManagerClient() {

    testWrkInst = new WorkflowInstance();
    testWrkFlw = new Workflow();
    testTask = new WorkflowTask();
    testCond = new WorkflowCondition();
    Metadata sharedContext = new Metadata();

    // to check if the path already exists and to delete if it does exist
    if (new File(catalogPath).exists()) {
      try {
View Full Code Here

    public TestLuceneWorkflowInstanceRepository() {
        testInst = new WorkflowInstance();
        testWkflw = new Workflow();
        testTask = new WorkflowTask();
        testCond = new WorkflowCondition();
        testWkflw.setName("test.workflow");
        testWkflw.setId("test.id");
        List tasks = new Vector();
        List conds = new Vector();
View Full Code Here

   */
  public static WorkflowCondition getWorkflowCondition(Node node) {
    Element conditionElement = (Element) node;

    String conditionClassName = conditionElement.getAttribute("class");
    WorkflowCondition condition = new WorkflowCondition();
    condition.setConditionInstanceClassName(conditionClassName);
    condition.setConditionId(conditionElement.getAttribute("id"));
    condition.setConditionName(conditionElement.getAttribute("name"));
    condition
        .setTimeoutSeconds(Long.valueOf(conditionElement
            .getAttribute("timeout") != null
            && !conditionElement.getAttribute("timeout").equals("") ? conditionElement
            .getAttribute("timeout") : "-1"));
    condition.setOptional(Boolean.valueOf(conditionElement
        .getAttribute("optional")));

    // load its configuration
    Element configElement = getFirstElement("configuration", conditionElement);
    if (configElement != null) {
      condition.setCondConfig(new WorkflowConditionConfiguration(
          getConfiguration(configElement)));
    }

    return condition;

View Full Code Here

    if (conditionNodes != null && conditionNodes.getLength() > 0) {
      conditionList = new Vector<WorkflowCondition>(conditionNodes.getLength());

      for (int i = 0; i < conditionNodes.getLength(); i++) {
        Element conditionNode = (Element) conditionNodes.item(i);
        WorkflowCondition condition = (WorkflowCondition) conditions
            .get(conditionNode.getAttribute("id"));

        if (condition != null) {
          WorkflowCondition workflowCondition = new WorkflowCondition();
          workflowCondition.setConditionInstanceClassName(condition
              .getConditionInstanceClassName());
          workflowCondition.setConditionId(condition.getConditionId());
          workflowCondition.setConditionName(condition.getConditionName());
          workflowCondition.setOrder(i + 1);
          workflowCondition.setTimeoutSeconds(condition.getTimeoutSeconds());
          workflowCondition.setOptional(condition.isOptional());
          workflowCondition.setCondConfig(condition.getCondConfig());
          conditionList.add(workflowCondition);
        }
      }

    }
View Full Code Here

TOP

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

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.