// Run the Runtime Plan public void runExecutionPlan(RuntimePlan rplan, ServletContext context) { synchronized (WriteLock.Lock) { PlanExecutionEngine engine = config.getDomainExecutionEngine(); engine.getExecutionLogger().setWriterLock(WriteLock.Lock); // "execute" below is an asynchronous call engine.execute(rplan); // Save the engine for an abort if needed context.setAttribute("plan_" + rplan.getID(), rplan); context.setAttribute("engine_" + rplan.getID(), engine); } }
public boolean stopRun(String runid, ServletContext context) { ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); if (monitor.getRunDetails(runid).getRuntimeInfo().getStatus() == RuntimeInfo.Status.RUNNING) { PlanExecutionEngine engine = (PlanExecutionEngine) context.getAttribute("engine_" + runid); RuntimePlan rplan = (RuntimePlan) context.getAttribute("plan_" + runid); if (engine != null && rplan != null) { engine.abort(rplan); return true; } } return false; }