diff options
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java | 21 |
1 files changed, 6 insertions, 15 deletions
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 1bc13ef..e38f71d 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddNewSlot.java @@ -13,13 +13,10 @@ package com.c2kernel.lifecycle.instance.predefined; import com.c2kernel.collection.Aggregation;
-import com.c2kernel.common.AccessRightsException;
import com.c2kernel.common.InvalidDataException;
-import com.c2kernel.common.InvalidTransitionException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.lookup.AgentPath;
-import com.c2kernel.lookup.EntityPath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.ClusterStorageException;
import com.c2kernel.process.Gateway;
@@ -53,23 +50,17 @@ public class AddNewSlot extends PredefinedStep * 1 - Item Description key (optional)
*/
@Override
- public void request(AgentPath agent, int transitionID, String requestData)
- throws AccessRightsException,
- InvalidTransitionException,
- InvalidDataException
- {
- EntityPath entityPath = getItemEntityPath();
+ protected String runActivityLogic(AgentPath agent, int itemSysKey,
+ int transitionID, String requestData) throws InvalidDataException {
+
String collName;
int descKey=-1;
Aggregation agg;
Logger.msg(1, "AddNewSlot::request() - Starting.");
- checkAccessRights(agent);
-
// extract parameters
try {
- entityPath = getItemEntityPath();
String[] params = getDataList(requestData);
collName = params[0];
if (params.length > 1) descKey = Integer.parseInt(params[1]);
@@ -80,7 +71,7 @@ public class AddNewSlot extends PredefinedStep // load collection
C2KLocalObject collObj;
try {
- collObj = Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
+ collObj = Gateway.getStorage().get(itemSysKey, ClusterStorage.COLLECTION+"/"+collName, null);
} catch (ObjectNotFoundException ex) {
throw new InvalidDataException("Collection '"+collName+"' not found in this Item", "");
} catch (ClusterStorageException ex) {
@@ -110,13 +101,13 @@ public class AddNewSlot extends PredefinedStep agg.addSlot(props, classProps.toString());
try {
- Gateway.getStorage().put(entityPath.getSysKey(), agg, null);
+ Gateway.getStorage().put(itemSysKey, agg, null);
} catch (ClusterStorageException e) {
Logger.error(e);
throw new InvalidDataException("Error storing collection", "");
}
- sendEventStoreOutcome(transitionID, requestData, agent);
Logger.msg(1, "AddNewSlot::request() - DONE.");
+ return requestData;
}
}
|
