Is it possible to detect which file triggered an action rule ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2022 03:45 PM
Hi there,
I was looking for by the way ruleAction
in particular in my class that extends ActionExecuterAbstractBase {
executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
I'd like to find somethings refering to the main file that triggered the rule because I have to work whit it.
Many thanks
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 03:17 AM
The node for the action is "actionedUponNodeRef". You may work with it by using NodeService or similar.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 06:09 AM
Thanks angelborroy for your suggestion
I tried with
List<AssociationRef> assocRefs = nodeService.getTargetAssocs(actionedUponNodeRef, ((QNamePattern) QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "replaces")) );
but in this way I find association file
As I told in the post -> I'd like information about file that I manage
Could you suggest a method or a way to reach this
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 10:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 02:27 PM
Thanks one more time angelborroy
looking through the first link I found
String fileName = serviceRegistry.getNodeService (). GetProperty (actionedUponNodeRef, ContentModel.PROP_NAME) .toString ();
in this way I reach the main file of the proper name I was looking for
but by the way my target is the nodeRef of this filename
