]> git.argeo.org Git - gpl/argeo-slc.git/blob - execution/ExecutionCommandProvider.java
Prepare next development cycle
[gpl/argeo-slc.git] / execution / ExecutionCommandProvider.java
1 package org.argeo.slc.execution;
2
3 import java.util.List;
4
5 import org.argeo.slc.process.SlcExecution;
6 import org.eclipse.osgi.framework.console.CommandInterpreter;
7 import org.eclipse.osgi.framework.console.CommandProvider;
8
9 public class ExecutionCommandProvider implements CommandProvider {
10 private List<ExecutionModule> executionModules;
11
12 public Object _slc_execute(CommandInterpreter ci) {
13 String moduleName = ci.nextArgument();
14 String executionName = ci.nextArgument();
15
16 SlcExecution slcExecution = new SlcExecution();
17 slcExecution.getAttributes().put("slc.flows", executionName);
18
19 ExecutionModule module = null;
20 for (ExecutionModule moduleT : executionModules) {
21 if(moduleT.getName().equals(moduleName)){
22 // TODO: check version
23 module = moduleT;
24 break;
25 }
26 }
27
28 if(module!=null)
29 module.execute(slcExecution);
30
31 return null;
32 }
33
34 public String getHelp() {
35 StringBuffer buf = new StringBuffer();
36 buf.append("---SLC Execution Commands---\n");
37 buf.append("\tslc_execute - Execute an execution flow\n");
38 return buf.toString();
39
40 }
41
42 public void setExecutionModules(List<ExecutionModule> executionModules) {
43 this.executionModules = executionModules;
44 }
45
46 }