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

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


public class TestWorkflowLifecycleManager extends TestCase {

  private WorkflowLifecycleManager lifecycle;

  public void testPctCompleteWengineStages(){
    ParentChildWorkflow workflow = new ParentChildWorkflow(new Graph());
    WorkflowState successState = lifecycle.getDefaultLifecycle().createState("Success", "done", "All done.");
    WorkflowInstance instance = new WorkflowInstance();
    instance.setState(successState);
    instance.setParentChildWorkflow(workflow);
    double pct = lifecycle.getPercentageComplete(instance);
View Full Code Here


    this.lifecycle = new WorkflowLifecycleManager("./src/main/resources"
        + "/examples/workflow-lifecycle.xml");
    assertNotNull(this.lifecycle);
    assertNotNull(this.lifecycle.getDefaultLifecycle());
    assertNotNull(this.lifecycle.getDefaultLifecycle().getStages());
    ParentChildWorkflow workflow = new ParentChildWorkflow(new Graph());
    WorkflowState successState = lifecycle.getDefaultLifecycle().createState("FINISHED", "done", "All done.");
    WorkflowInstance instance = new WorkflowInstance();
    instance.setState(successState);
    instance.setParentChildWorkflow(workflow);
    double pct = lifecycle.getPercentageComplete(instance);
View Full Code Here

    // recast it as a parent/child workflow
    String workflowId = UUID.randomUUID().toString();
    workflow.setId(workflowId);

    Graph graph = new Graph();
    graph.setExecutionType("sequential");
    ParentChildWorkflow pcw = new ParentChildWorkflow(graph);
    pcw.setName(workflow.getName());
    pcw.setTasks(workflow.getTasks());
    pcw.setId(workflow.getId());
    this.workflows.put(pcw.getId(), pcw);
View Full Code Here

        rootElements.add(parser.parse(file).getDocumentElement());
      for (Element root : rootElements) {
        Metadata staticMetadata = new Metadata();
        loadConfiguration(rootElements, root, staticMetadata);
        loadTaskAndConditionDefinitions(rootElements, root, staticMetadata);
        loadGraphs(rootElements, root, new Graph(), staticMetadata);
        computeEvents();
        computeWorkflowConditions();
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      LOG.log(Level.FINER, "Loading: [" + conditionBlocks.size()
          + "] conditions from: ["
          + rootElem.getOwnerDocument().getDocumentURI() + "]");

      for (Element condElem : conditionBlocks) {
        loadGraphs(rootElements, condElem, new Graph(), staticMetadata);
      }

    }

    if (taskBlocks != null && taskBlocks.size() > 0) {
      LOG.log(Level.FINER, "Loading: [" + taskBlocks.size() + "] tasks from: ["
          + rootElem.getOwnerDocument().getDocumentURI() + "]");
      for (Element taskElem : taskBlocks) {
        loadGraphs(rootElements, taskElem, new Graph(), staticMetadata);
      }
    }
  }
View Full Code Here

  private void loadGraphs(List<Element> rootElements, Element graphElem,
      Graph parent, Metadata staticMetadata) throws Exception {

    LOG.log(Level.FINEST, "Visiting node: [" + graphElem.getNodeName() + "]");
    loadConfiguration(rootElements, graphElem, staticMetadata);
    Graph graph = !graphElem.getNodeName().equals("cas:workflows") ? new Graph(
        graphElem, staticMetadata) : new Graph();
    parent.getChildren().add(graph);
    graph.setParent(parent);
    if (!graphElem.getNodeName().equals("cas:workflows")) {
      expandWorkflowTasksAndConditions(graph, staticMetadata);
    }

    for (String processorType : Graph.processorIds) {
View Full Code Here

    }

  }

  private ParentChildWorkflow getDynamicWorkflow(WorkflowTask task) {
    Graph graph = new Graph();
    graph.setExecutionType("sequential");
    ParentChildWorkflow workflow = new ParentChildWorkflow(graph);
    workflow.setId("parallel-" + UUID.randomUUID().toString());
    workflow.setName("Parallel Single Task " + task.getTaskName());
    workflow.getTasks().add(task);
    this.workflows.put(workflow.getId(), workflow);
View Full Code Here

    // recast it as a parent/child workflow
    String workflowId = UUID.randomUUID().toString();
    workflow.setId(workflowId);

    Graph graph = new Graph();
    graph.setExecutionType("sequential");
    ParentChildWorkflow pcw = new ParentChildWorkflow(graph);
    pcw.setName(workflow.getName());
    pcw.setTasks(workflow.getTasks());
    pcw.setId(workflow.getId());
    this.workflows.put(pcw.getId(), pcw);
View Full Code Here

        rootElements.add(parser.parse(file).getDocumentElement());
      for (Element root : rootElements) {
        Metadata staticMetadata = new Metadata();
        loadConfiguration(rootElements, root, staticMetadata);
        loadTaskAndConditionDefinitions(rootElements, root, staticMetadata);
        loadGraphs(rootElements, root, new Graph(), staticMetadata);
        computeEvents();
        computeWorkflowConditions();
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      LOG.log(Level.FINER, "Loading: [" + conditionBlocks.size()
          + "] conditions from: ["
          + rootElem.getOwnerDocument().getDocumentURI() + "]");

      for (Element condElem : conditionBlocks) {
        loadGraphs(rootElements, condElem, new Graph(), staticMetadata);
      }

    }

    if (taskBlocks != null && taskBlocks.size() > 0) {
      LOG.log(Level.FINER, "Loading: [" + taskBlocks.size() + "] tasks from: ["
          + rootElem.getOwnerDocument().getDocumentURI() + "]");
      for (Element taskElem : taskBlocks) {
        loadGraphs(rootElements, taskElem, new Graph(), staticMetadata);
      }
    }
  }
View Full Code Here

TOP

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

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.