cancel
Showing results for 
Search instead for 
Did you mean: 

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

minox
Champ on-the-rise
Champ on-the-rise

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

4 REPLIES 4

angelborroy
Community Manager Community Manager
Community Manager

The node for the action is "actionedUponNodeRef". You may work with it by using NodeService or similar.

Hyland Developer Evangelist

minox
Champ on-the-rise
Champ on-the-rise

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

minox
Champ on-the-rise
Champ on-the-rise

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