X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.specs%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fexecution%2FExecutionFlowDescriptor.java;h=f4329309996bc9fd6ee855be9731415953bcf446;hb=58efbefd4194e7b3b9da463964bd791a759702f2;hp=f63703c88e45f27c760083ad441dc5a49bad2f55;hpb=1535eecc68ecbda4e67e158de6bcecd074db2545;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java index f63703c88..f43293099 100644 --- a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java +++ b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java @@ -1,8 +1,51 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.argeo.slc.execution; +import java.io.Serializable; import java.util.Map; -public class ExecutionFlowDescriptor { +/** + * + * Implements both archetype and implementation of a given process. + * + * At specification time, executionSpec represents the spec of the + * parameters accepted by the process, with, among others: type, default value + * and, optionally, possible values for each parameter. Thus ExecutionSpec might + * be a huge object. Note that when marshalling only a reference to a specific + * ExecutionSpec is stored in the XML to optimize performance and avoid + * redundancy between various ExecutionFlowDesciptor that might have the same + * ExecutionSpec. + * + * At runtime, we build a RealizedFlow which references an + * ExecutionFlowDescriptor. As it happens AFTER marshalling / unmarshalling + * process, the ExecutionSpec is null but we manage to retrieve the + * ExecutionSpec and store it in the RealizedFlow, whereas set values of the + * parameters are stored in the values map. + * + * Generally, values object are either a PrimitiveAccessor or a + * RefValue but can be other objects. + * + * @author bsinou + * + * + */ +public class ExecutionFlowDescriptor implements Serializable { + private static final long serialVersionUID = 7101944857038041216L; private String name; private String description; private String path; @@ -59,4 +102,22 @@ public class ExecutionFlowDescriptor { this.description = description; } + @Override + public boolean equals(Object obj) { + if (obj instanceof ExecutionFlowDescriptor) + return name.equals(((ExecutionFlowDescriptor) obj).getName()); + return false; + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public String toString() { + return (path != null && !path.trim().equals("") ? path + "/" : "") + + name; + } + }