1 package org
.argeo
.slc
.execution
;
3 import java
.util
.ArrayList
;
7 import org
.argeo
.slc
.SlcException
;
8 import org
.argeo
.slc
.deploy
.ModuleDescriptor
;
10 /** Describes the information required to launch a flow */
11 public class ExecutionModuleDescriptor
extends ModuleDescriptor
{
12 /** Metadata header identifying an SLC execution module */
13 public final static String SLC_EXECUTION_MODULE
= "SLC-ExecutionModule";
15 private static final long serialVersionUID
= -2394473464513029512L;
16 private List
<ExecutionSpec
> executionSpecs
= new ArrayList
<ExecutionSpec
>();
17 private List
<ExecutionFlowDescriptor
> executionFlows
= new ArrayList
<ExecutionFlowDescriptor
>();
19 public List
<ExecutionSpec
> getExecutionSpecs() {
20 return executionSpecs
;
23 public List
<ExecutionFlowDescriptor
> getExecutionFlows() {
24 return executionFlows
;
28 * Returns a new {@link ExecutionModuleDescriptor} that can be used to build
29 * a {@link RealizedFlow}.
31 public ExecutionFlowDescriptor
cloneFlowDescriptor(String name
) {
32 ExecutionFlowDescriptor res
= null;
33 for (ExecutionFlowDescriptor efd
: executionFlows
) {
34 if (efd
.getName().equals(name
)
35 || ("/" + efd
.getName()).equals(name
)) {
37 res
= (ExecutionFlowDescriptor
) efd
.clone();
38 } catch (CloneNotSupportedException e
) {
39 throw new SlcException("Cannot clone " + efd
, e
);
44 throw new SlcException("Flow " + name
+ " not found.");
48 public RealizedFlow
asRealizedFlow(String flow
, Map
<String
, Object
> values
) {
49 RealizedFlow realizedFlow
= new RealizedFlow();
50 realizedFlow
.setFlowDescriptor(cloneFlowDescriptor(flow
));
51 realizedFlow
.setModuleName(getName());
52 realizedFlow
.setModuleVersion(getVersion());
53 realizedFlow
.getFlowDescriptor().getValues().putAll(values
);
57 public void setExecutionSpecs(List
<ExecutionSpec
> executionSpecs
) {
58 this.executionSpecs
= executionSpecs
;
61 public void setExecutionFlows(List
<ExecutionFlowDescriptor
> executionFlows
) {
62 this.executionFlows
= executionFlows
;