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

cancel
Showing results for 
Search instead for 
Did you mean: 
minox
Member II

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

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
angelborroy
Alfresco Employee

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

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

Hyland Developer Evangelist
minox
Member II

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

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

angelborroy
Alfresco Employee
minox
Member II

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

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