summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java')
-rw-r--r--src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java
index 66df3b2..60e63f1 100644
--- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java
+++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/ClearSlot.java
@@ -14,12 +14,9 @@ package com.c2kernel.lifecycle.instance.predefined;
import com.c2kernel.collection.Aggregation;
import com.c2kernel.collection.AggregationMember;
-import com.c2kernel.common.AccessRightsException;
import com.c2kernel.common.InvalidDataException;
-import com.c2kernel.common.InvalidTransitionException;
import com.c2kernel.common.ObjectNotFoundException;
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;
@@ -47,23 +44,17 @@ public class ClearSlot extends PredefinedStep
* 1 - slot number
*/
@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 slotNo;
Aggregation agg;
Logger.msg(1, "ClearSlot::request() - Starting.");
- checkAccessRights(agent);
-
// extract parameters
try {
- entityPath = getItemEntityPath();
String[] params = getDataList(requestData);
collName = params[0];
slotNo = Integer.parseInt(params[1]);
@@ -73,7 +64,7 @@ public class ClearSlot extends PredefinedStep
// load collection
try {
- agg = (Aggregation)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
+ agg = (Aggregation)Gateway.getStorage().get(itemSysKey, ClusterStorage.COLLECTION+"/"+collName, null);
} catch (ObjectNotFoundException ex) {
throw new InvalidDataException("Collection '"+collName+"' not found in this Item", "");
} catch (ClusterStorageException ex) {
@@ -98,13 +89,12 @@ public class ClearSlot extends PredefinedStep
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, "ClearSlot::request() - DONE.");
+ return requestData;
}
}