1 package org
.argeo
.api
.slc
.execution
;
3 import java
.io
.Serializable
;
4 import java
.util
.HashMap
;
9 * Implements both archetype and implementation of a given process.
11 * At specification time, <code>executionSpec</code> represents the spec of the
12 * parameters accepted by the process, with, among others: type, default value
13 * and, optionally, possible values for each parameter. Thus ExecutionSpec might
14 * be a huge object. Note that when marshalling only a reference to a specific
15 * ExecutionSpec is stored in the XML to optimize performance and avoid
16 * redundancy between various ExecutionFlowDesciptor that might have the same
19 * At runtime, we build a RealizedFlow which references an
20 * ExecutionFlowDescriptor. As it happens AFTER marshalling / unmarshalling
21 * process, the ExecutionSpec is null but we manage to retrieve the
22 * ExecutionSpec and store it in the RealizedFlow, whereas set values of the
23 * parameters are stored in the <code>values</code> map.
25 * Generally, values object are either a <code>PrimitiveAccessor</code> or a
26 * <code>RefValue</code> but can be other objects.
28 public class ExecutionFlowDescriptor
implements Serializable
, Cloneable
{
29 private static final long serialVersionUID
= 7101944857038041216L;
31 private String description
;
33 private Map
<String
, Object
> values
;
34 private ExecutionSpec executionSpec
;
36 public ExecutionFlowDescriptor() {
39 public ExecutionFlowDescriptor(String name
, String description
,
40 Map
<String
, Object
> values
, ExecutionSpec executionSpec
) {
43 this.executionSpec
= executionSpec
;
46 /** The referenced {@link ExecutionSpec} is NOT cloned. */
48 protected Object
clone() throws CloneNotSupportedException
{
49 return new ExecutionFlowDescriptor(name
, description
,
50 new HashMap
<String
, Object
>(values
), executionSpec
);
53 public String
getName() {
58 * @deprecated will be removed in SLC 2.x, the path should be the part of
61 public String
getPath() {
66 * @deprecated will be removed in SLC 2.0, the path should be the part of
69 public void setPath(String path
) {
73 public Map
<String
, Object
> getValues() {
77 public ExecutionSpec
getExecutionSpec() {
81 public void setName(String name
) {
85 public void setValues(Map
<String
, Object
> values
) {
89 public void setExecutionSpec(ExecutionSpec executionSpec
) {
90 this.executionSpec
= executionSpec
;
93 public String
getDescription() {
97 public void setDescription(String description
) {
98 this.description
= description
;
102 public boolean equals(Object obj
) {
103 if (obj
instanceof ExecutionFlowDescriptor
)
104 return name
.equals(((ExecutionFlowDescriptor
) obj
).getName());
109 public int hashCode() {
110 return name
.hashCode();
114 public String
toString() {
115 return (path
!= null && !path
.trim().equals("") ? path
+ "/" : "")