Package org.apache.oodt.cas.workflow.lifecycle

Examples of org.apache.oodt.cas.workflow.lifecycle.WorkflowLifecycleManager


    assertEquals(9.0, candidates.get(2).getWorkflowInstance().getPriority()
        .getValue());
  }

  private WorkflowProcessor getProcessor(double priority) throws InstantiationException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager("./src/main/resources/examples/wengine/wengine-lifecycle.xml");
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime()+(this.dateGen*5000));
    this.dateGen++;
    inst.setStartDate(sd);
View Full Code Here


    assertEquals(2.0, candidates.get(1).getWorkflowInstance().getPriority()
        .getValue());
  }

  private WorkflowProcessor getProcessor(double priority) throws InstantiationException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager("./src/main/resources/examples/wengine/wengine-lifecycle.xml");   
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime()+(this.dateGen*5000));
    this.dateGen++;
    inst.setStartDate(new Date());
View Full Code Here

    assertEquals(2.0, candidates.get(1).getWorkflowInstance().getPriority()
        .getValue());
  }

  private WorkflowProcessor getProcessor(double priority) throws InstantiationException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager("./src/main/resources/examples/wengine/wengine-lifecycle.xml");   
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime()+(this.dateGen*5000));
    this.dateGen++;
    inst.setStartDate(new Date());
View Full Code Here

        .getProperty(ENGINE_RUNNER_CLASS));
  }

  protected WorkflowLifecycleManager getWorkflowLifecycle()
      throws InstantiationException {
    return new WorkflowLifecycleManager(PathUtils.replaceEnvVariables(System
        .getProperty(LIFECYCLES_FILE_PATH_PROPERTY)));
  }
View Full Code Here

  }

  public WorkflowProcessor getProcessor(double priority, String stateName,
      String categoryName) throws InstantiationException,
      IllegalAccessException, IOException, IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager(
        "./src/main/resources/examples/wengine/wengine-lifecycle.xml");
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime() + (this.dateGen * 5000));
    this.dateGen++;
    inst.setStartDate(sd);
    inst.setId("task-winst-" + priority);
    ParentChildWorkflow workflow = new ParentChildWorkflow(new Graph());
    workflow.getTasks().add(getTask(getTmpPath()));
    inst.setParentChildWorkflow(workflow);
    inst.setPriority(Priority.getPriority(priority));
    inst.setCurrentTaskId(workflow.getTasks().get(0).getTaskId());
    inst.setParentChildWorkflow(workflow);
    WorkflowProcessorBuilder builder = WorkflowProcessorBuilder
        .aWorkflowProcessor().withLifecycleManager(lifecycleManager)
        .withPriority(priority).withInstance(inst);
    TaskProcessor taskProcessor = (TaskProcessor) builder
        .build(TaskProcessor.class);
    taskProcessor.getWorkflowInstance().setState(lifecycleManager.getDefaultLifecycle().createState(
        stateName, categoryName, ""));   
    return taskProcessor;
  }
View Full Code Here

    fn.setMinimumFractionDigits(2);
    return fn.format(wallClockMins);
  }

  private String getPctComplete(WorkflowInstance inst, String lifecycleFilePath) {
    WorkflowLifecycleManager lifecycleMgr = null;
    try {
      lifecycleMgr = new WorkflowLifecycleManager(lifecycleFilePath);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return lifecycleMgr
        .formatPct(lifecycleMgr.getPercentageComplete(inst) * 100.0);
  }
View Full Code Here

    assertEquals(9.0, candidates.get(2).getWorkflowInstance().getPriority()
        .getValue());
  }

  private WorkflowProcessor getProcessor(double priority) throws InstantiationException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager("./src/main/resources/examples/wengine/wengine-lifecycle.xml");
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime()+(this.dateGen*5000));
    this.dateGen++;
    inst.setStartDate(sd);
View Full Code Here

    assertEquals(2.0, candidates.get(1).getWorkflowInstance().getPriority()
        .getValue());
  }

  private WorkflowProcessor getProcessor(double priority) throws InstantiationException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager("./src/main/resources/examples/wengine/wengine-lifecycle.xml");   
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime()+(this.dateGen*5000));
    this.dateGen++;
    inst.setStartDate(new Date());
View Full Code Here

    assertEquals(2.0, candidates.get(1).getWorkflowInstance().getPriority()
        .getValue());
  }

  private WorkflowProcessor getProcessor(double priority) throws InstantiationException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager("./src/main/resources/examples/wengine/wengine-lifecycle.xml");   
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime()+(this.dateGen*5000));
    this.dateGen++;
    inst.setStartDate(new Date());
View Full Code Here

  }

  private WorkflowProcessor getProcessor(double priority, String stateName,
      String categoryName) throws InstantiationException, IllegalAccessException {
    WorkflowLifecycleManager lifecycleManager = new WorkflowLifecycleManager(
        "./src/main/resources/examples/wengine/wengine-lifecycle.xml");
    WorkflowInstance inst = new WorkflowInstance();
    Date sd = new Date();
    sd.setTime(sd.getTime() + (this.dateGen * 5000));
    this.dateGen++;
    inst.setStartDate(sd);
    inst.setId("winst-" + priority);
    Workflow workflow = new Workflow();
    workflow.setTasks(Collections.EMPTY_LIST);
    inst.setWorkflow(workflow);
    inst.setPriority(Priority.getPriority(priority));
    WorkflowProcessorBuilder builder = WorkflowProcessorBuilder.aWorkflowProcessor()
    .withLifecycleManager(lifecycleManager)
    .withPriority(priority);
    SequentialProcessor processor = (SequentialProcessor)builder.build(SequentialProcessor.class);
    processor.setWorkflowInstance(inst);
    processor.setState(lifecycleManager.getDefaultLifecycle().createState(
        stateName, categoryName, ""));
    assertNotNull(processor.getState());
    assertNotNull(processor.getState().getCategory());
    assertNotNull(processor.getState().getCategory().getName());
    List<WorkflowProcessor> runnables = new Vector<WorkflowProcessor>();
    TaskProcessor taskProcessor = (TaskProcessor)builder.build(TaskProcessor.class);
    taskProcessor.setState(lifecycleManager.getDefaultLifecycle().createState(
        "Queued", "waiting", ""));
    runnables.add(taskProcessor);
    processor.setSubProcessors(runnables);   
    return processor;
  }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.lifecycle.WorkflowLifecycleManager

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.