How to modify node property in CronJob without changing "modifier"?

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

How to modify node property in CronJob without changing "modifier"?

Jump to solution
If I change some property (add aspect for example) in a scheduled Job, I get "modifier" property changed to "System".

public class
ExampleCronJob implements StatefulJob {

public void execute(JobExecutionContext ctx) throws JobExecutionException {
...
nodeService.addAspect(ref, ASPECT_EXAMPLE);

         ...
}
Is it possible to do this and leave "modifier" parameter unchanged?
1 Solution

Accepted Solutions
janv
Alfresco Employee

Re: How to modify node property in CronJob without changing "modifier"?

Jump to solution

You should be able to disable the behaviour of the auditable aspect. See for example:

http://dev.alfresco.com/resource/AlfrescoOne/5.2/PublicAPI/index.html?org/alfresco/repo/policy/Behav...

Regards,

Jan

ps. you should be able to find examples within the core code (repository or open source extensions), eg.

https://github.com/Alfresco/records-management/blob/master/rm-community/rm-community-repo/source/jav...

... etc

or search web for more general discussions, eg.

https://stackoverflow.com/questions/46809388/how-to-edit-modified-and-modifier-properties-in-alfresc...

... etc

View solution in original post

1 Reply
janv
Alfresco Employee

Re: How to modify node property in CronJob without changing "modifier"?

Jump to solution

You should be able to disable the behaviour of the auditable aspect. See for example:

http://dev.alfresco.com/resource/AlfrescoOne/5.2/PublicAPI/index.html?org/alfresco/repo/policy/Behav...

Regards,

Jan

ps. you should be able to find examples within the core code (repository or open source extensions), eg.

https://github.com/Alfresco/records-management/blob/master/rm-community/rm-community-repo/source/jav...

... etc

or search web for more general discussions, eg.

https://stackoverflow.com/questions/46809388/how-to-edit-modified-and-modifier-properties-in-alfresc...

... etc