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/instance/XOrSplit.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/instance/XOrSplit.java')
| -rw-r--r-- | source/com/c2kernel/lifecycle/instance/XOrSplit.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/com/c2kernel/lifecycle/instance/XOrSplit.java b/source/com/c2kernel/lifecycle/instance/XOrSplit.java index 108aa61..25baf0b 100644 --- a/source/com/c2kernel/lifecycle/instance/XOrSplit.java +++ b/source/com/c2kernel/lifecycle/instance/XOrSplit.java @@ -21,32 +21,32 @@ public class XOrSplit extends Split super();
}
- public void runNext(AgentPath agent) throws ScriptingEngineException
+ @Override
+ public void runNext(AgentPath agent) throws ScriptingEngineException
{
ArrayList<DirectedEdge> nextsToFollow = new ArrayList<DirectedEdge>();
String nexts = this.evaluateScript(
- (String) getProperties().get("RoutingScriptName"),
+ (String) getProperties().get("RoutingScriptName"),
(String) getProperties().get("RoutingScriptVersion")).toString();
-
+
StringTokenizer tok = new StringTokenizer(nexts,",");
String[] nextsTab = new String[tok.countTokens()];
for (int i=0;i<nextsTab.length;i++)
- nextsTab[i] = tok.nextToken();
+ nextsTab[i] = tok.nextToken();
DirectedEdge[] outEdges = getOutEdges();
- for (int i = 0; i < outEdges.length; i++)
- {
- if (isInTable((String)((Next)outEdges[i]).getProperties().get("Alias"), nextsTab))
- nextsToFollow.add(outEdges[i]);
+ for (DirectedEdge outEdge : outEdges) {
+ if (isInTable((String)((Next)outEdge).getProperties().get("Alias"), nextsTab))
+ nextsToFollow.add(outEdge);
}
// Logger.debug(0, getID()+" following "+nexts);
if (nextsToFollow.size() != 1)
throw new ScriptingEngineException("not good number of active next");
-
+
followNext((Next)nextsToFollow.get(0), agent);
-
+
}
-
+
public void followNext(Next activeNext, AgentPath agent) throws ScriptingEngineException {
activeNext.getTerminusVertex().run(agent);
}
|
