From da731d2bb81666b9c697d9099da632e7dfcdc0f7 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 9 Sep 2014 12:13:21 +0200 Subject: 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. --- src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/XOrSplit.java') 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 nextsToFollow = new ArrayList(); 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); } } -- cgit v1.2.3