cancel
Showing results for 
Search instead for 
Did you mean: 

Getting rule owning nodeRef

mhb
Champ on-the-rise
Champ on-the-rise

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?

8 REPLIES 8

mrks_js1
Star Contributor
Star Contributor

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();

mhb
Champ on-the-rise
Champ on-the-rise

Yes, but this is a shared rule between multiple folders, it has many parents.

mrks_js1
Star Contributor
Star Contributor

well then i don't understand - what are you trying to achieve? and how is your rule configured (screenshot)?

mhb
Champ on-the-rise
Champ on-the-rise

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.