Package gri.tasks.workflows

Examples of gri.tasks.workflows.TaskStub


  public Map getWorkflowOutputs(String wkflId, String jobId) throws UnknownWorkflowException, UnknownJobException {
    WorkflowEntry entry = getWorkflowEntry(wkflId);

    Workflow wkfl = entry.getWorkflow();
    TaskStub task = wkfl.getTask(jobId);
   
    return task.getOutputs();
  }
View Full Code Here


      this.wkfl = wkfl;
     
      JobInfo [] jobInfos = new JobInfo[wkfl.getTaskCount()];
      Iterator iTaskStubs = wkfl.taskStubs();
      for (int i=0; i<jobInfos.length; i++) {
        TaskStub stub = (TaskStub)iTaskStubs.next();
        jobInfos[i] = new JobInfo(stub.getId(), stub.getTaskId());
      }
     
      this.wkflInfo = new WorkflowInfo(id, jobInfos);
    }
View Full Code Here

    for (int i=0; i<taskInfoList.size(); i++) {
      TaskInfo taskInfo = (TaskInfo)taskInfoList.get(i);
      String taskId = taskInfo.getTaskId();
      String stubId = String.valueOf(i);
      taskStubs.add(new TaskStub(stubId, taskId));
    }
  }
View Full Code Here

    protected void resolveReferences(List taskStubs) throws Exception {
 
  //load TaskStub's into map, keyed by stub ID:
  Map stubMap = new HashMap(taskStubs.size());
  for (int i=0; i<taskStubs.size(); i++) {
      TaskStub s = (TaskStub)taskStubs.get(i);
      stubMap.put(s.getId(), s);
  }
 
  TaskStub stub;
  for (int i=0; i<taskStubs.size(); i++) {
      stub = (TaskStub)taskStubs.get(i);
      TaskStubSerializer.resolveReferences(stub, stubMap);
  }
    }
View Full Code Here

 
  JobSubmission submission = new JobSubmission("Workflow");
  List tasks = new ArrayList();
 
  TaskStub task1 = new TaskStub("0", "dan.encryption.Digest.md5");
  task1.setInput("message", "dude");
  tasks.add(task1);

  TaskStub task2 = new TaskStub("1", "dan.encryption.Digest.md5");
  task2.setInput("message", new TaskStubOutputReference(task1, "digest"));
  tasks.add(task2);
 
  submission.setInput("inputTasks", tasks);
 
 
View Full Code Here

 
  Element taskElem = elem.getChild("task");
  if (taskElem != null)
      taskId = taskElem.getText();
 
  TaskStub stub = new TaskStub(stubId, taskId);
 
  //parse inputs and outputs:
  Element inputElem = elem.getChild("inputs");
  if (inputElem != null) {
      JDOMSerializer inputSerializer = taskSerializerFactory
        .getTaskSerializerSet(taskId)
        .getInputParameterSerializer(config);
           
      Map inputs = (Map)inputSerializer.read(inputElem);
      stub.setInputs(inputs);
  }
 
  Element outputElem = elem.getChild("outputs");
  if (outputElem != null) {
      JDOMSerializer outputSerializer = taskSerializerFactory
        .getTaskSerializerSet(taskId)
        .getOutputParameterSerializer(config);
           
      Map outputs = (Map)outputSerializer.read(outputElem);
      stub.setOutputs(outputs);
  }
 
  return stub;
    }
View Full Code Here

      Object value = entry.getValue();
      if (value instanceof IdentifiedReference) {
    IdentifiedReference idRef = (IdentifiedReference)value;
 
    TaskStub refStub = (TaskStub)taskStubs.get(idRef.getTaskId());
    if (refStub == null)
        throw new Exception("Referenced task not found: " + idRef.getTaskId());
   
    entry.setValue(new TaskStubOutputReference(refStub, idRef.getOutputName()));
      }
View Full Code Here

      TaskInfo taskInfo = (TaskInfo)taskInfoList.get(i);

      String stubId = String.valueOf(i);
      String taskId = taskInfo.getTaskId();

      TaskStub stub = new TaskStub(stubId, taskId);
      stub.setInputs(inputPanels.getInputs(i));

      taskStubs.add(stub);
    }

    return new WorkflowInputModel(taskInfoList, taskStubs);
View Full Code Here

TOP

Related Classes of gri.tasks.workflows.TaskStub

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.