public static void monitorWorkflow( final String experimentId, AiravataAPI airavataAPI, MonitorListener monitorListener) throws AiravataAPIInvocationException, URISyntaxException, IOException { Monitor experimentMonitor = airavataAPI.getExecutionManager().getExperimentMonitor(experimentId, monitorListener); experimentMonitor.startMonitoring(); airavataAPI.getExecutionManager().waitForExperimentTermination(experimentId); experimentMonitor.stopMonitoring(); }
// TODO this method is already using in another class (correct it) - // WorkflowExecutionServlet.java public void monitor(final String experimentId, AiravataAPI airavataAPI) throws AiravataAPIInvocationException, URISyntaxException { MonitorListener monitorListener = new MonitorListener(); Monitor experimentMonitor = airavataAPI.getExecutionManager().getExperimentMonitor(experimentId, monitorListener); log.info("Started the Workflow monitor"); experimentMonitor.startMonitoring(); }