Package gri.tasks.managers.workflows

Examples of gri.tasks.managers.workflows.WorkflowSubmission


    public WorkflowSubmission readWorkflow(Element elem) throws IOException {
  Element jobsElem = elem.getChild("jobs");
  if (jobsElem == null)
      throw new MissingElementException("jobs");
 
  WorkflowSubmission submission = new WorkflowSubmission();
 
  List children = jobsElem.getChildren();
  int jobIndex = 0;
 
  for (int i=0; i<children.size(); i++) {
      Element child = (Element)children.get(i);
      String name = child.getName();
     
      if (name.equals("job")) {
    String taskId = JobSubmissionSerializer.readTaskId(child);
    JobSubmissionSerializer serializer = serializers.
      getJobSubmissionSerializer(jobIndex, taskId, config);
    JobSubmission job = serializer.readJob(child);
    submission.addJob(job);
   
    jobIndex++;
      }
  }
 
View Full Code Here


  //WorkflowManager wkflManager = createLocalWorkflowManager(taskProvider);
  WorkflowManager wkflManager = createRemoteWorkflowManager(taskProvider);
 
  //Define workflow:
  //WorkflowSubmission wkfl = createSimpleWorkflow();
  WorkflowSubmission wkfl = createFileWorkflow();
 
  //Execute:
  String id = wkflManager.submitWorkflow(wkfl);
  while (wkflManager.getWorkflowInfo(id).getStatus() != JobManager.COMPLETE) {
      System.out.println("Running...");
View Full Code Here

 
    }
   
    protected static WorkflowSubmission createSimpleWorkflow() {
 
  WorkflowSubmission wkfl = new WorkflowSubmission();
 
  JobSubmission job1 = new JobSubmission("dan.encryption.Digest.md5");
  job1.setInput("message", "dude");
  wkfl.addJob(job1);

  JobSubmission job2 = new JobSubmission("dan.encryption.Digest.md5");
  job2.setInput("message", "dude");
  job2.setInput("message", new WorkflowOutputReference(0, "digest"));
  wkfl.addJob(job2);
 
  return wkfl;
    }
View Full Code Here

 
  return wkfl;
    }
   
    protected static WorkflowSubmission createFileWorkflow() {
  WorkflowSubmission wkfl = new WorkflowSubmission();
 
  JobSubmission job1 = new JobSubmission("dan.encryption.Digest.digestToHex");
  job1.setInput("file", new TextMemFile("input1.txt", "dude"));
  job1.setInput("algorithm", "MD5");
  wkfl.addJob(job1);
 
  JobSubmission job2 = new JobSubmission("dan.encryption.Digest.digestToHex");
  job2.setInput("file", new TextMemFile("input2.txt", "dude"));
  job2.setInput("algorithm", "MD5");
  wkfl.addJob(job2);
 
  return wkfl;
    }
View Full Code Here

                  
            WorkflowSubmissionSerializer wkflSerializer = serializers
                .getWorkflowSerializerSet(wkflManager)
                .getWorkflowSubmissionSerializer(config);
           
            WorkflowSubmission wkfl = wkflSerializer.readWorkflow(rootElem);
            wkfl.setContextParam("WORKING_DIRECTORY", workDir);

            List jobs = wkfl.getJobs();
            for (int i=0; i<jobs.size(); i++) {
          JobSubmission job = (JobSubmission)jobs.get(i);
         
          String jobId = "job_" + (i+1);
          File subWorkDir = new File(workDir, jobId);
View Full Code Here

TOP

Related Classes of gri.tasks.managers.workflows.WorkflowSubmission

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.