How to schedule an automation-chain

Hi :) I want to schedule an automation chain . I have created the operation which deletes the trash .Then i used the following extension to set up a scheduler to be executed every 1 minute but nothing happens.This is the extension:

<schedule id="trashDelete">
  <cronExpression>0 1 0 * * ?</cronExpression>

0 votes

1 answers



You need to setup an event handler that will catch the event you created (DeleteTrash) and call your automation chain (DeleteTrashOperation)

<extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="event-handlers">
<handler chainId="DeleteTrashOperation" postCommit="true">
0 votes

I dont understand this

Now it recognises the Scheduler..It turned out that the problem was Cron Expression..But now i have another problem.It throws an exception saying :Cannot find any valid path in operation chain-no method found for operation "DeleteTrash" and for first input type "void". I dont get it..The automation chain is allright

Can you show us your custom operation DeleteTrashOperation ?

@Operation(id = DeleteTrash.ID, category = Constants.CAT_DOCUMENT, label = "DeleteTrash", description = "") public class DeleteTrash {

public static final String ID = &quot;DeleteTrash&quot;;
private static final Log log = LogFactory.getLog(DeleteTrash.class);

protected CoreSession session;

@OperationMethod(collector = DocumentModelCollector.class)
public DocumentModel run(DocumentModel input) {
    DocumentModelList documentModelList = session
            .query(&quot;SELECT * FROM Document WHERE ecm:currentLifeCycleState=&apos;deleted&apos;&quot;);
    Iterator&lt;DocumentModel&gt; iterator = documentModelList.iterator();
    while (iterator.hasNext()) {
        DocumentModel document =;
        log.warn(document.getTitle()+&quot; WAS REMOVED FROM TRASH&quot;);
    return null;




I test it with a user Action so the code is fine..i dont understand why it doesnt work with the scheduler

Not sure if OP's problem was solved. If not, the reason why it wasn't working was because CoreSession is not injected when using Schedulers as mentioned in here:

The solution is to use Login As operation as first operation