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

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


      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


                    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

    }

    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

  private void addConditionsToDoc(String taskId, List conditionList,
      Document doc) {
    if (conditionList != null && conditionList.size() > 0) {
      for (Iterator i = conditionList.iterator(); i.hasNext();) {
        WorkflowCondition cond = (WorkflowCondition) i.next();
        doc.add(new Field(taskId + "_condition_name", cond.getConditionName(),
            Field.Store.YES, Field.Index.NO));
        doc.add(new Field(taskId + "_condition_id", cond.getConditionId(),
            Field.Store.YES, Field.Index.UN_TOKENIZED));
        doc.add(new Field(taskId + "_condition_class", cond
            .getConditionInstanceClassName(), Field.Store.YES, Field.Index.NO));
        doc.add(new Field(taskId + "_condition_order", String.valueOf(cond
            .getOrder()), Field.Store.YES, Field.Index.NO));
        doc.add(new Field(taskId + "_condition_timeout", String.valueOf(cond
            .getTimeoutSeconds()), Field.Store.YES, Field.Index.NO));
        doc.add(new Field(taskId+"_condition_optional", String.valueOf(cond.isOptional()),
            Field.Store.YES, Field.Index.NO));
      }
    }
  }
View Full Code Here

                            + "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]));
            if(condTimeouts != null){
              cond.setTimeoutSeconds(Long.parseLong(condTimeouts[i]));
            }
            if(condOptionals != null){
              cond.setOptional(Boolean.valueOf(condOptionals[i]));
            }
            condList.add(cond);
        }
       
        return condList;
View Full Code Here

   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         WorkflowCondition condition = getClient()
               .getConditionById(conditionId);
         printer.println("Condition: [id=" + condition.getConditionId()
               + ", name=" + condition.getConditionName() + ", order="
               + condition.getOrder() + ", class="
               + condition.getClass().getName() + "]");
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get condition by id for conditionId '" + conditionId
                     + "' : " + e.getMessage(), e);
      }
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

      eventToWorkflowsMap = Maps.newHashMap();
      workflows = Maps.newHashMap();
      tasks = Maps.newHashMap();
      conditions = Maps.newHashMap();

      WorkflowCondition condition1 = new WorkflowCondition();
      condition1.setConditionId(CONDITION1_ID);
      condition1.setConditionName(CONDITION1_NAME);
      condition1.setConditionInstanceClassName("some.class.path");
      condition1.setCondConfig(cConf);
      conditions.put(condition1.getConditionId(), condition1);

      WorkflowCondition condition2 = new WorkflowCondition();
      condition2.setConditionId(CONDITION2_ID);
      condition2.setConditionName(CONDITION2_NAME);
      condition2.setCondConfig(cConf);
      condition2.setConditionInstanceClassName("some.class.path");
      conditions.put(condition2.getConditionId(), condition2);

      WorkflowCondition condition3 = new WorkflowCondition();
      condition3.setConditionId(CONDITION3_ID);
      condition3.setConditionName(CONDITION3_NAME);
      condition3.setCondConfig(cConf);
      condition3.setConditionInstanceClassName("some.class.path");
      conditions.put(condition3.getConditionId(), condition3);

      WorkflowCondition condition4 = new WorkflowCondition();
      condition4.setConditionId(CONDITION4_ID);
      condition4.setConditionName(CONDITION4_NAME);
      condition4.setCondConfig(cConf);
      condition4.setConditionInstanceClassName("some.class.path");
      conditions.put(condition4.getConditionId(), condition4);

      WorkflowTask task1 = new WorkflowTask();
      task1.setTaskId(TASK1_ID);
      task1.setTaskName(TASK1_NAME);
      task1.setTaskConfig(tConf);
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.