Getting rule owning nodeRef

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 05:59 AM
Hi,
I create a shared content rule for multiple folders, but I couldn't find a way in the action executor to get the folder in which the rule was executed. Any idea?
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 07:56 AM
i guess the rule should give you the nodeRef of the file and from there you can get the parent (if it is only 1)
https://community.alfresco.com/docs/DOC-5359-noderef-cookbook
ChildAssociationRef childAssociationRef = nodeService.getPrimaryParent(nodeRef);NodeRef parent = childAssociationRef.getParentRef();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 08:02 AM
Yes, but this is a shared rule between multiple folders, it has many parents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 08:11 AM
well then i don't understand - what are you trying to achieve? and how is your rule configured (screenshot)?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 09:00 AM
I define the rule under a static folder, then I link it to another one. this is an example of parent relations between the rule and the rule folders.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2017 09:04 AM
please explain what you are trying to achieve and how the rule is triggered

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2017 02:50 AM
The rule is triggered when an element in the folder is created, deleted or updated. I'm trying to get the NodeRef of this folder in the actionExecuter.(the rule is linked to the folder not created under its ruleFolder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2017 03:10 AM
The actionedUponNodeRef should be the noderef of the newly created File/folder and from there you can geht the Patent - no?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2017 03:17 AM
The actionedNodeRef is not always a direct child of the folder, it can be created in a subfolder.
