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

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


      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

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

      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

          || (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

    }

    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

  public static List copyConditions(List conditionList){
    if(conditionList != null){
      List newConditionList = new Vector(conditionList.size());
     
      for(Iterator i = conditionList.iterator(); i.hasNext(); ){
        WorkflowCondition c = (WorkflowCondition)i.next();
        WorkflowCondition newCondition = copyCondition(c);
        newConditionList.add(newCondition);
      }
     
      return newConditionList;
    }
View Full Code Here

    }
    else return null;
  }
 
  public static WorkflowCondition copyCondition(WorkflowCondition c){
    WorkflowCondition newCondition = new WorkflowCondition();
    newCondition.setConditionName(c.getConditionName());
    newCondition.setOrder(c.getOrder());
    newCondition.setConditionInstanceClassName(c.getConditionInstanceClassName());
    return newCondition;
  }
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

            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"));
            condition.setTimeoutSeconds(rs.getLong("workflow_condition_timeout"));
            condition.setOptional(rs.getBoolean("workflow_condition_optional"));
            if (setOrder) {
                condition.setOrder(rs.getInt("condition_order"));
            }
            return condition;
        } else
            return null;
    }
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.