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. --- .../java/com/c2kernel/lifecycle/instance/WfVertex.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/WfVertex.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/WfVertex.java b/src/main/java/com/c2kernel/lifecycle/instance/WfVertex.java index 2f0ef0d..c2596f8 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/WfVertex.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/WfVertex.java @@ -35,7 +35,7 @@ public abstract class WfVertex extends GraphableVertex * @throws AccessRightsException * @throws InvalidTransitionException * @throws PersistencyException */ - public abstract void runFirst(AgentPath agent, int itemSysKey) throws ScriptingEngineException, InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, ObjectAlreadyExistsException, PersistencyException; + public abstract void runFirst(AgentPath agent, ItemPath itemPath) throws ScriptingEngineException, InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, ObjectAlreadyExistsException, PersistencyException; /** * @see java.lang.Object#Object() @@ -56,11 +56,11 @@ public abstract class WfVertex extends GraphableVertex * @throws PersistencyException * @throws ObjectAlreadyExistsException */ - 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 { try { - ((CompositeActivity)getParent()).request(agent, itemSysKey, CompositeActivity.COMPLETE, null); + ((CompositeActivity)getParent()).request(agent, itemPath, CompositeActivity.COMPLETE, null); } catch (Exception e) { @@ -98,7 +98,7 @@ public abstract class WfVertex extends GraphableVertex * @throws InvalidTransitionException * @throws PersistencyException */ - public abstract void run(AgentPath agent, int itemSysKey) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException; + public abstract void run(AgentPath agent, ItemPath itemPath) throws InvalidDataException, InvalidTransitionException, AccessRightsException, ObjectNotFoundException, PersistencyException; /** * Method loop. @@ -112,7 +112,7 @@ public abstract class WfVertex extends GraphableVertex */ public abstract Next addNext(WfVertex vertex); - protected Object evaluateScript(String scriptName, Integer scriptVersion, int itemSysKey) throws ScriptingEngineException + protected Object evaluateScript(String scriptName, Integer scriptVersion, ItemPath itemPath) throws ScriptingEngineException { try @@ -131,7 +131,7 @@ public abstract class WfVertex extends GraphableVertex { value = value.substring(11); if (value.startsWith(".")) - value = itemSysKey + value.substring(1); + value = itemPath.getUUID() + value.substring(1); try { inputParam = ViewpointDataHelper.get(value)[0]; } catch (ArrayIndexOutOfBoundsException ex) { @@ -142,7 +142,7 @@ public abstract class WfVertex extends GraphableVertex { value = value.substring(10); try { - inputParam = Gateway.getStorage().get(itemSysKey, ClusterStorage.PROPERTY+"/"+value, null); + inputParam = Gateway.getStorage().get(itemPath, ClusterStorage.PROPERTY+"/"+value, null); } catch (ObjectNotFoundException ex) { inputParam = null; } @@ -154,7 +154,7 @@ public abstract class WfVertex extends GraphableVertex //TODO: is this right? if (requiredInput.containsKey("item")) { - script.setInputParamValue("item", Gateway.getProxyManager().getProxy(new ItemPath(itemSysKey))); + script.setInputParamValue("item", Gateway.getProxyManager().getProxy(itemPath)); } if (requiredInput.containsKey("agent")) { AgentPath systemAgent = Gateway.getLookup().getAgentPath("system"); -- cgit v1.2.3