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

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


        testCond.setConditionInstanceClassName("test.class");
        testCond.setConditionName("test.cond.name");
        testCond.setOrder(1);
        conds.add(testCond);

        testTask.setTaskConfig(new WorkflowTaskConfiguration());
        testTask.setTaskId("test.task.id");
        testTask.setConditions(conds);
        testTask.setOrder(1);
        testTask.setTaskInstanceClassName("test.class");
        testTask.setTaskName("test.task.name");
View Full Code Here


    }

    // load its configuration
    Element configElement = getFirstElement("configuration", taskNode);
    if (configElement != null) {
      task.setTaskConfig(new WorkflowTaskConfiguration(
          getConfiguration(configElement)));
    }

    return task;
  }
View Full Code Here

   * @return A {@link WorkflowTaskConfiguration} from an XML-RPC
   *         {@link Hashtable}.
   */
  public static WorkflowTaskConfiguration getWorkflowTaskConfigurationFromXmlRpc(
      Hashtable config) {
    WorkflowTaskConfiguration configuration = new WorkflowTaskConfiguration();

    for (Iterator i = config.keySet().iterator(); i.hasNext();) {
      String name = (String) i.next();
      String value = (String) config.get(name);

      configuration.getProperties().put(name, value);
    }

    return configuration;
  }
View Full Code Here

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

    WorkflowTaskConfiguration config = null;

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

      String getConfigurationSql = "SELECT * from workflow_task_configuration WHERE workflow_task_id = "
          + taskId;

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

      config = new WorkflowTaskConfiguration();
      while (rs.next()) {
        config.getProperties().put(rs.getString("property_name"),
            rs.getString("property_value"));
      }

      if (config.getProperties().keySet().size() == 0) {
        config = null;
      }

    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  private WorkflowTask getGlobalWorkflowConditionsTask(Workflow workflow,
      List<WorkflowCondition> conditions) throws RepositoryException {
    WorkflowTask task = new WorkflowTask();
    task.setConditions(conditions);
    task.setTaskConfig(new WorkflowTaskConfiguration());
    task.setTaskId(workflow.getId() + "-global-conditions-eval");
    task.setTaskName(workflow.getName() + "-global-conditions-eval");
    task.setTaskInstanceClassName(NoOpTask.class.getName());
    task.setTaskId(this.commitTask(workflow, task));
    return task;
View Full Code Here

    }
   
    private WorkflowTask getGlobalWorkflowConditionsTask(String workflowName, String workflowId, List<WorkflowCondition> conditions){
      WorkflowTask task = new WorkflowTask();
      task.setConditions(conditions);
      task.setTaskConfig(new WorkflowTaskConfiguration());
      task.setTaskId(workflowId+"-global-conditions-eval");
      task.setTaskName(workflowName+"-global-conditions-eval");
      task.setTaskInstanceClassName(NoOpTask.class.getName());
      this.taskMap.put(task.getTaskId(), task);
      return task;
View Full Code Here

    if(condTask != null) return condTask;
    condTask = new WorkflowTask();
    condTask.setTaskId(taskId);
    condTask.setTaskInstanceClassName(ConditionTaskInstance.class.getCanonicalName());
    condTask.setTaskName(cond.getConditionName()+" Task");
    WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
    config.getProperties().putAll(cond.getCondConfig().getProperties());
    // this one is a special one that will be removed by the ConditionTaskInstance class
    config.addConfigProperty("ConditionClassName", cond.getConditionInstanceClassName());
    condTask.setTaskConfig(config);
    this.addTaskToModelRepo(condTask);
    return condTask;
  }
View Full Code Here

        return taskList;
    }

    private WorkflowTaskConfiguration toTaskConfig(String taskId, Document doc) {
        WorkflowTaskConfiguration taskConfig = new WorkflowTaskConfiguration();

        String[] propNames = doc.getValues(taskId + "_config_property_name");
        String[] propValues = doc.getValues(taskId + "_config_property_value");

        if (propNames == null) {
            return taskConfig;
        }

        if (propNames.length != propValues.length) {
            LOG.log(Level.WARNING,
                    "Task Config prop name and value arrays are not "
                            + "of same size!");
            return null;
        }

        for (int i = 0; i < propNames.length; i++) {
            taskConfig.addConfigProperty(propNames[i], propValues[i]);
        }

        return taskConfig;
    }
View Full Code Here

    return workflow;
  }

  private WorkflowTask generateRedirector(String eventName) {
    WorkflowTask task = new WorkflowTask();
    WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
    config.addConfigProperty("eventName", eventName);
    task.setTaskId("redirector-" + UUID.randomUUID().toString());
    task.setTaskName("Redirector Task");
    task.setTaskInstanceClassName(BranchRedirector.class.getName());
    this.tasks.put(task.getTaskId(), task);
    return task;
View Full Code Here

    this.tasks.put(task.getTaskId(), task);
    return task;
  }

  private WorkflowTaskConfiguration convertToTaskConfiguration(Metadata met) {
    WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
    for (String key : met.getAllKeys()) {
      config.addConfigProperty(key, met.getMetadata(key));
    }
    return config;
  }
View Full Code Here

TOP

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

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.