How to reproduce:
- create a workflow with an escalation rule on a node
- start the workflow on a document and make sure a task is running on the node with an escalation rule
- permanently delete the document on which the workflow is running
The following stack trace is repeatedly generated in server.log:
2016-02-29 11:45:00,032 ERROR [Quartz_Worker-1] [org.nuxeo.ecm.core.event.impl.EventServiceImpl] Exception during triggerEsclationRules sync listener execution, continuing to run other listeners org.nuxeo.ecm.core.api.DocumentNotFoundException: 19c8555b-df35-4b8e-9f8d-35361bcda4a5 at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getDocumentByUUID(SQLSession.java:171) at org.nuxeo.ecm.core.api.AbstractSession.resolveReference(AbstractSession.java:326) at org.nuxeo.ecm.core.api.AbstractSession.getDocuments(AbstractSession.java:949) at org.nuxeo.ecm.platform.routing.core.impl.DocumentRouteElementImpl.getAttachedDocuments(DocumentRouteElementImpl.java:64) at org.nuxeo.ecm.platform.routing.core.impl.GraphNodeImpl.getWorkflowContextualInfo(GraphNodeImpl.java:431) at org.nuxeo.ecm.platform.routing.core.impl.GraphNodeImpl.getExecutionContext(GraphNodeImpl.java:411) at org.nuxeo.ecm.platform.routing.core.impl.GraphNodeImpl.evaluateEscalationRules(GraphNodeImpl.java:857) at org.nuxeo.ecm.platform.routing.core.impl.DocumentRoutingEscalationServiceImpl.computeEscalationRulesToExecute(DocumentRoutingEscalationServiceImpl.java:68) at org.nuxeo.ecm.platform.routing.core.listener.DocumentRoutingEscalationListener$1.run(DocumentRoutingEscalationListener.java:63) at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:139) at org.nuxeo.ecm.platform.routing.core.listener.DocumentRoutingEscalationListener.triggerEsclationRulesExecution(DocumentRoutingEscalationListener.java:69) at org.nuxeo.ecm.platform.routing.core.listener.DocumentRoutingEscalationListener.handleEvent(DocumentRoutingEscalationListener.java:49) at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:191) at org.nuxeo.ecm.core.scheduler.EventJob.execute(EventJob.java:117) at org.nuxeo.ecm.core.scheduler.EventJob.execute(EventJob.java:63) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
In method DocumentRouteElementImpl#DocumentRouteElementImpl, we should check if document still exists before putting it into list refs.