Created
November 17, 2017 03:08
-
-
Save DImuthuUpe/f61851b68b685b8d6744689dc130babd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Workflow.Builder createWorkflow() { | |
List<TaskConfig> downloadDataTasks = new ArrayList<>(); | |
downloadDataTasks.add(new TaskConfig.Builder().setTaskId("Download_Task").setCommand(DataCollectingTask.NAME).build()); | |
List<TaskConfig> commandExecuteTasks = new ArrayList<>(); | |
commandExecuteTasks.add(new TaskConfig.Builder().setTaskId("Command_Task").setCommand(CommandTask.NAME).build()); | |
List<TaskConfig> pushDataTasks = new ArrayList<>(); | |
pushDataTasks.add(new TaskConfig.Builder().setTaskId("Push_Task").setCommand(DataPushingTask.NAME).build()); | |
JobConfig.Builder downloadDataJob = new JobConfig.Builder().addTaskConfigs(downloadDataTasks).setMaxAttemptsPerTask(3); | |
JobConfig.Builder commandExecuteJob = new JobConfig.Builder().addTaskConfigs(commandExecuteTasks).setMaxAttemptsPerTask(3); | |
JobConfig.Builder dataPushJob = new JobConfig.Builder().addTaskConfigs(pushDataTasks).setMaxAttemptsPerTask(3); | |
Workflow.Builder workflow = new Workflow.Builder("Airavata_Workflow").setExpiry(0); | |
workflow.addJob("downloadDataJob", downloadDataJob); | |
workflow.addJob("commandExecuteJob", commandExecuteJob); | |
workflow.addJob("dataPushJob", dataPushJob); | |
workflow.addParentChildDependency("downloadDataJob", "commandExecuteJob"); | |
workflow.addParentChildDependency("commandExecuteJob", "dataPushJob"); | |
return workflow; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment