summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-09-09 12:13:21 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-09-09 12:13:21 +0200
commitda731d2bb81666b9c697d9099da632e7dfcdc0f7 (patch)
tree567693c3c48f3d15ecbb2dac4f9db03bb6e58c72 /src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java
parentae1e79e33fd30e3d8bcedbef8891a14a048276d7 (diff)
Replaced int sysKey Item identifier with UUID, which is now portable.
ItemPath objects are now used to identify Items throughout the kernel, replacing ints and Integers.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java')
-rw-r--r--src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java b/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java
index 65bd4ba..f5d9432 100644
--- a/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java
+++ b/src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java
@@ -10,6 +10,7 @@ import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.common.PersistencyException;
import com.c2kernel.graph.model.DirectedEdge;
import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.ItemPath;
import com.c2kernel.scripting.ScriptingEngineException;
import com.c2kernel.utils.Logger;
@@ -28,14 +29,14 @@ public class XOrSplit extends Split
}
@Override
- public void runNext(AgentPath agent, int itemSysKey) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException
+ public void runNext(AgentPath agent, ItemPath itemPath) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException
{
ArrayList<DirectedEdge> nextsToFollow = new ArrayList<DirectedEdge>();
String nexts;
String scriptName = (String) getProperties().get("RoutingScriptName");
Integer scriptVersion = getVersionNumberProperty("RoutingScriptVersion");
try {
- nexts = this.evaluateScript(scriptName, scriptVersion, itemSysKey).toString();
+ nexts = this.evaluateScript(scriptName, scriptVersion, itemPath).toString();
} catch (ScriptingEngineException e) {
Logger.error(e);
throw new InvalidDataException("Error running routing script "+scriptName+" v"+scriptVersion, "");
@@ -55,12 +56,12 @@ public class XOrSplit extends Split
if (nextsToFollow.size() != 1)
throw new InvalidDataException("not good number of active next", null);
- followNext((Next)nextsToFollow.get(0), agent, itemSysKey);
+ followNext((Next)nextsToFollow.get(0), agent, itemPath);
}
- public void followNext(Next activeNext, AgentPath agent, int itemSysKey) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException {
- activeNext.getTerminusVertex().run(agent, itemSysKey);
+ public void followNext(Next activeNext, AgentPath agent, ItemPath itemPath) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException {
+ activeNext.getTerminusVertex().run(agent, itemPath);
}
}