diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
| commit | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch) | |
| tree | 5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/lifecycle/ActivitySlotDef.java | |
| parent | 036cbdba66f804743c4c838ed598d6972c4b3e17 (diff) | |
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better
Rewrote RemoteMap to use TreeMap instead of the internal array for
order. It now sorts its keys by number if they parse, else as strings.
Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/lifecycle/ActivitySlotDef.java')
| -rw-r--r--[-rwxr-xr-x] | source/com/c2kernel/lifecycle/ActivitySlotDef.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/source/com/c2kernel/lifecycle/ActivitySlotDef.java b/source/com/c2kernel/lifecycle/ActivitySlotDef.java index 10f6778..74d8305 100755..100644 --- a/source/com/c2kernel/lifecycle/ActivitySlotDef.java +++ b/source/com/c2kernel/lifecycle/ActivitySlotDef.java @@ -14,10 +14,10 @@ import com.c2kernel.utils.LocalObjectLoader; public class ActivitySlotDef extends WfVertexDef
{
private String activityDef;
-
+
/**
* Method setActivityDef.
- *
+ *
* @param oActivityDef
*/
public void setActivityDef(String oActivityDef)
@@ -26,7 +26,7 @@ public class ActivitySlotDef extends WfVertexDef }
/**
* Method getActivityDef.
- *
+ *
* @return String
*/
public String getActivityDef()
@@ -42,7 +42,7 @@ public class ActivitySlotDef extends WfVertexDef getProperties().put("Version", "last");
}
- public ActivityDef getTheActivityDef() throws ObjectNotFoundException, InvalidDataException
+ public ActivityDef getTheActivityDef() throws ObjectNotFoundException, InvalidDataException
{
ActivityDef actDef = LocalObjectLoader.getActDef(getActivityDef(), getActVersion());
if (actDef instanceof CompositeActivityDef)
@@ -53,6 +53,7 @@ public class ActivitySlotDef extends WfVertexDef * @see com.c2kernel.lifecycle.WfVertexDef#verify()
*/
/** launch the verification of the ActivityDef */
+ @Override
public boolean verify()
{
mErrors.removeAllElements();
@@ -87,10 +88,9 @@ public class ActivitySlotDef extends WfVertexDef Vertex[] outV = getOutGraphables();
Vertex[] anteVertices = GraphTraversal.getTraversal(getParent().getChildrenGraphModel(), this, GraphTraversal.kUp, false);
boolean errInLoop = false;
- for (int i = 0; i < outV.length; i++)
- {
- for (int j = 0; j < anteVertices.length; j++)
- if (!loop() && outV[i].getID() == anteVertices[j].getID())
+ for (Vertex element : outV) {
+ for (Vertex anteVertice : anteVertices)
+ if (!loop() && element.getID() == anteVertice.getID())
errInLoop = true;
}
if (errInLoop)
@@ -103,7 +103,7 @@ public class ActivitySlotDef extends WfVertexDef }
/**
* Method getNextWfVertices.
- *
+ *
* @return WfVertexDef[]
*/
public WfVertexDef[] getNextWfVertices()
@@ -122,21 +122,21 @@ public class ActivitySlotDef extends WfVertexDef }
/**
* Method getInfo.
- *
+ *
* @return CastorHashMap
*/
public void configureInstance(Activity act)
{
KeyValuePair[] k = getProperties().getKeyValuePairs();
- for (int i = 0; i < k.length; i++)
- act.getProperties().put(k[i].getKey(), k[i].getValue());
+ for (KeyValuePair element : k)
+ act.getProperties().put(element.getKey(), element.getValue());
act.setCentrePoint(getCentrePoint());
act.setOutlinePoints(getOutlinePoints());
act.setInEdgeIds(getInEdgeIds());
act.setOutEdgeIds(getOutEdgeIds());
act.setName(getActName());
act.setID(getID());
- }
+ }
public String getActName()
{
@@ -145,8 +145,9 @@ public class ActivitySlotDef extends WfVertexDef public String getActVersion()
{
return (String) getProperties().get("Version");
- }
-
+ }
+
+ @Override
public WfVertex instantiate() throws ObjectNotFoundException, InvalidDataException {
Activity newActivity = (Activity)getTheActivityDef().instantiate();
configureInstance(newActivity);
|
