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

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


                    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() + ", timeout="
                                + condition.getTimeoutSeconds()+ ", optional="
                                + condition.isOptional()+", order="
                                + condition.getOrder() + "]");
                       
                        System.out.println("Configuration: ");
                        for (String cKeyName : (Set<String>) (Set<?>) condition
                          .getCondConfig().getProperties().keySet()) {
                         System.out.println("[name=" + cKeyName + ", value="
                         + condition.getCondConfig().getProperty(cKeyName) + "]");
                        }
                    }

                }
View Full Code Here

                        if (conditionElemList != null
                                && conditionElemList.getLength() > 0) {
                            for (int j = 0; j < conditionElemList.getLength(); j++) {
                                Element conditionElem = (Element) conditionElemList
                                        .item(j);
                                WorkflowCondition condition = XmlStructFactory
                                        .getWorkflowCondition(conditionElem);
                                if (condition != null) {
                                    conditionMap.put(
                                            condition.getConditionId(),
                                            condition);
                                }
                            }

                        }
View Full Code Here

          || (workflow.getName() != null && workflow.getName().equals(""))) {
        workflow.setName(graph.getExecutionType() + "-" + workflow.getId());
      }
      this.workflows.put(graph.getModelId(), workflow);
    } else if (graph.getExecutionType().equals("condition")) {
      WorkflowCondition cond = null;

      if (graph.getModelIdRef() != null && !graph.getModelIdRef().equals("")) {
        cond = this.conditions.get(graph.getModelIdRef());
      } else {
        cond = new WorkflowCondition();
        cond.setConditionId(graph.getModelId());
        cond.setConditionName(graph.getModelName());
        cond.setConditionInstanceClassName(graph.getClazz());
        cond.setTimeoutSeconds(graph.getTimeout());
        cond.setOptional(graph.isOptional());
        cond.setCondConfig(convertToConditionConfiguration(staticMetadata));

        if (cond.getConditionName() == null
            || (cond.getConditionName() != null && cond.getConditionName()
                .equals(""))) {
          cond.setConditionName(cond.getConditionId());
        }
        this.conditions.put(graph.getModelId(), cond);

      }

      graph.setCond(cond);
      if (graph.getParent() != null) {
        if (graph.getParent().getWorkflow() != null) {
          System.out.println("Adding condition: [" + cond.getConditionName()
              + "] to parent workflow: ["
              + graph.getParent().getWorkflow().getName() + "]");
          graph.getParent().getWorkflow().getConditions().add(cond);
        } else if (graph.getParent().getTask() != null) {
          graph.getParent().getTask().getConditions().add(cond);
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() + "]");
                       
                        System.out.println("Configuration: ");
                        for (String cKeyName : (Set<String>) (Set<?>) condition
                          .getCondConfig().getProperties().keySet()) {
                         System.out.println("[name=" + cKeyName + ", value="
                         + condition.getCondConfig().getProperty(cKeyName) + "]");
                        }
                    }

                }
View Full Code Here

                        if (conditionElemList != null
                                && conditionElemList.getLength() > 0) {
                            for (int j = 0; j < conditionElemList.getLength(); j++) {
                                Element conditionElem = (Element) conditionElemList
                                        .item(j);
                                WorkflowCondition condition = XmlStructFactory
                                        .getWorkflowCondition(conditionElem);
                                if (condition != null) {
                                    conditionMap.put(
                                            condition.getConditionId(),
                                            condition);
                                }
                            }

                        }
View Full Code Here

        if (conditions == null) {
            return wConditions;
        }

        for (Iterator i = conditions.iterator(); i.hasNext();) {
            WorkflowCondition c = (WorkflowCondition) i.next();
            Hashtable condition = getXmlRpcWorkflowCondition(c);
            wConditions.add(condition);
        }

        return wConditions;
View Full Code Here

     *            The Hashtable to turn into a real WorkflowCondition.
     * @return a {@link WorkflowCondition} from an XML-RPC {@link Hashtable}.
     */
    public static WorkflowCondition getWorkflowConditionFromXmlRpc(
            Hashtable cond) {
        WorkflowCondition condition = new WorkflowCondition();
        condition.setConditionInstanceClassName((String) cond.get("class"));
        condition.setConditionId((String) cond.get("id"));
        condition.setConditionName((String) cond.get("name"));
        condition.setOrder(Integer.valueOf((String) cond.get("order"))
                .intValue());
        condition.setCondConfig(getWorkflowConditionConfigurationFromXmlRpc((Hashtable)cond.get("configuration")));
        return condition;
    }
View Full Code Here

    public static List getWorkflowConditionsFromXmlRpc(Vector conds) {
        List conditions = new Vector();

        for (Iterator i = conds.iterator(); i.hasNext();) {
            Hashtable cond = (Hashtable) i.next();
            WorkflowCondition condition = getWorkflowConditionFromXmlRpc(cond);
            conditions.add(condition);
        }

        return conditions;
    }
View Full Code Here

      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

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.