From 9c5d6e82b5ce733cf23e4317e3bafaa42c2221ba Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 1 Oct 2014 21:09:06 +0200 Subject: Collection version support, stored as a new final component of the Collection path. Null version implies "last". --- .../com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java index a482a43..facf7e1 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java @@ -49,8 +49,9 @@ public class AddNewSlot extends PredefinedStep * Creates a new slot in the given aggregation, that holds instances of the given item description * * Params: - * 0 - collection name - * 1 - Item Description key (optional) + *
  1. Collection name
  2. + *
  3. Item Description key (optional)
  4. + *
*/ @Override protected String runActivityLogic(AgentPath agent, ItemPath item, @@ -64,9 +65,10 @@ public class AddNewSlot extends PredefinedStep String[] params = getDataList(requestData); if (Logger.doLog(3)) Logger.msg(3, "AddNewSlot: called by "+agent+" on "+item+" with parameters "+Arrays.toString(params)); + // resolve desc item path and version try { collName = params[0]; - if (params.length > 1 && params[1].length() > 0) descKey = new ItemPath(params[1]); + if (params.length > 1 && params[1].length() > 0) descKey = new ItemPath(params[1]); } catch (Exception e) { throw new InvalidDataException("AddNewSlot: Invalid parameters "+Arrays.toString(params), ""); } @@ -90,7 +92,7 @@ public class AddNewSlot extends PredefinedStep if (descKey != null) { PropertyDescriptionList propList; try { - propList = PropertyUtility.getPropertyDescriptionOutcome(descKey); + propList = PropertyUtility.getPropertyDescriptionOutcome(descKey, "last"); } catch (ObjectNotFoundException e) { throw new InvalidDataException("AddNewSlot: Item "+descKey+" does not contain a PropertyDescription outcome to define a slot", ""); } -- cgit v1.2.3