sergehuber commented on code in PR #720:
URL: https://github.com/apache/unomi/pull/720#discussion_r2217294160


##########
extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/impl/GroovyActionsServiceImpl.java:
##########
@@ -209,48 +328,182 @@ private void saveActionType(Action action) {
         definitionsService.setActionType(actionType);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public void remove(String id) {
-        if (groovyCodeSourceMap.containsKey(id)) {
-            try {
-                definitionsService.removeActionType(
-                        
groovyShell.parse(groovyCodeSourceMap.get(id)).getClass().getMethod("execute").getAnnotation(Action.class).id());
-            } catch (NoSuchMethodException e) {
-                LOGGER.error("Failed to delete the action type for the id {}", 
id, e);
+        validateNotEmpty(id, "Script ID");
+
+        LOGGER.info("Removing script: {}", id);
+
+        ScriptMetadata removedMetadata = scriptMetadataCache.remove(id);

Review Comment:
   I've now adjusted the API to use the actionName in all method parameters 
while keeping the id for the annotations since I didn't want to break it. 
Ideally we should refactor this later to only use names but in the meantime I 
think this is already better.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to