}
public static void test1() throws Exception {
TaskProvider provider = loadTaskProvider();
//JobManager jobManager = createLocalSystem(provider);
JobManager jobManager = createRemoteJobManager(provider);
/*
System.out.println("Tasks:");
String [] taskIds = jobManager.getTaskList();
for (int i=0; i<taskIds.length; i++)
System.out.println(taskIds[i]);
*/
//prepare job:
/*
JobSubmission submission = new JobSubmission("dan.encryption.Digest.md5");
submission.setInput("message", "dude");
*/
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);
//submit job:
String jobId = jobManager.submitJob(submission);
while (jobManager.getJobStatus(jobId) != JobManager.COMPLETE) {
try {
Thread.sleep(1000);
}
catch(Exception e) {};
}
System.out.println();
System.out.println("Job Complete!");
System.out.println();
System.out.println("Outputs:");
System.out.println(String.valueOf(jobManager.getJobOutputs(jobId)));
jobManager.freeJob(jobId);
}