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

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


 
  public static List copyWorkflows(List workflows){
    if(workflows != null){
      List newWorkflows = new Vector(workflows.size());
      for(Iterator i = workflows.iterator(); i.hasNext(); ){
        Workflow w = (Workflow)i.next();
        Workflow newWorkflow = copyWorkflow(w);
        newWorkflows.add(newWorkflow);
      }
     
      return newWorkflows;
    }
View Full Code Here


   *
   * @param w The Workflow object to create a copy of.
   * @return A copy of the specified Workflow.
   */
  public static Workflow copyWorkflow(Workflow w){
    Workflow newWorkflow = null;
   
   
    newWorkflow = getWorkflowObjectFromClassName(w.getClass().getName());
   
   
    //copy through
    newWorkflow.setName(w.getName());
    newWorkflow.setId(w.getId());
    newWorkflow.setTasks(copyTasks(w.getTasks()));
   
    return newWorkflow;
  }
View Full Code Here

        Element workflowRoot = (Element) node;

        String id = workflowRoot.getAttribute("id");
        String name = workflowRoot.getAttribute("name");

        Workflow workflow = new Workflow();
        workflow.setName(name);
        workflow.setId(id);

        Element taskElem = getFirstElement("tasks", workflowRoot);

        NodeList taskList = taskElem.getElementsByTagName("task");

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

            for (int i = 0; i < taskList.getLength(); i++) {
                Element taskElement = (Element) taskList.item(i);

                WorkflowTask t = (WorkflowTask) tasks.get(taskElement
                        .getAttribute("id"));

                if (t != null) {
                    WorkflowTask workflowTask = new WorkflowTask();
                    workflowTask.setTaskInstanceClassName(t
                            .getTaskInstanceClassName());
                    workflowTask.setConditions(t.getConditions());
                    workflowTask.setTaskId(t.getTaskId());
                    workflowTask.setTaskConfig(t.getTaskConfig());
                    workflowTask.setTaskName(t.getTaskName());
                    workflowTask.setOrder(i + 1);
                    workflowTask.setRequiredMetFields(t.getRequiredMetFields());
                    workflowTasks.add(workflowTask);
                }
            }
            workflow.setTasks(workflowTasks);
        }

        return workflow;
    }
View Full Code Here

        inst.setSharedContext(sharedContext);

        // now read all of the workflow info

        Workflow workflow = new Workflow();

        workflow.setId(doc.get("workflow_id"));
        workflow.setName(doc.get("workflow_name"));
        workflow.setTasks(toTasks(doc));

        inst.setWorkflow(workflow);

        return inst;
    }
View Full Code Here

        workflowInst.setEndDateTimeIsoStr(rs.getString("end_date_time"));
        workflowInst.setCurrentTaskStartDateTimeIsoStr(rs
                .getString("current_task_start_date_time"));
        workflowInst.setCurrentTaskEndDateTimeIsoStr(rs
                .getString("current_task_end_date_time"));
        Workflow workflow = new Workflow();
        workflow.setId(rs.getString("workflow_id"));
        workflowInst.setWorkflow(workflow);
        return workflowInst;
    }
View Full Code Here

        workflowInst.setWorkflow(workflow);
        return workflowInst;
    }

    public static Workflow getWorkflow(ResultSet rs) throws SQLException {
        Workflow workflow = new Workflow();
        workflow.setName(rs.getString("workflow_name"));
        workflow.setId(String.valueOf(rs.getInt("workflow_id")));

        return workflow;
    }
View Full Code Here

     */
    public Workflow getWorkflowByName(String workflowName)
            throws RepositoryException {
        for (Iterator i = workflowMap.keySet().iterator(); i.hasNext();) {
            String workflowId = (String) i.next();
            Workflow w = (Workflow) workflowMap.get(workflowId);

            if (w.getName().equals(workflowName)) {
                return w;
            }
        }

        return null;
View Full Code Here

     *
     * @see org.apache.oodt.cas.workflow.repository.WorkflowRepository#getTasksByWorkflowId(java.lang.String)
     */
    public List getTasksByWorkflowId(String workflowId)
            throws RepositoryException {
        Workflow w = getWorkflowById(workflowId);
        return w.getTasks();
    }
View Full Code Here

     *
     * @see org.apache.oodt.cas.workflow.repository.WorkflowRepository#getTasksByWorkflowName(java.lang.String)
     */
    public List getTasksByWorkflowName(String workflowName)
            throws RepositoryException {
        Workflow w = getWorkflowByName(workflowName);
        return w.getTasks();
    }
View Full Code Here

        List workflows = repo.getWorkflows();

        if (workflows != null) {
            for (Iterator i = workflows.iterator(); i.hasNext();) {
                Workflow w = (Workflow) i.next();
                System.out.println("Workflow: [id=" + w.getId() + ", name="
                        + w.getName() + "]");

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

                for (Iterator j = w.getTasks().iterator(); j.hasNext();) {
                    WorkflowTask task = (WorkflowTask) j.next();

                    System.out.println("Task: [class="
                            + task.getTaskInstanceClassName() + ", id="
                            + task.getTaskId() + ", name=" + task.getTaskName()
View Full Code Here

TOP

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

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.