-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 7.10, 8.10, 9.1-SNAPSHOT
-
Component/s: Automation
-
Backlog priority:350
-
Sprint:nxNest Sprint 9.1.5
-
Story Points:3
When an automation chain is triggered by an event handler on event beforeDocumentModification, a context variable named Event is injected in the automation context, but the context variable Event in an automation scripting is empty.
How to reproduce:
- create an event handler triggered by event before document modification
- when it executes the following automation chain:
- Context.FetchDocument - Log: level: warn message: "<SUPNXP-18961_printDocumentBeforeModification> Event: @{Event}" category: org.nuxeo - Log: level: warn message: "<SUPNXP-18961_printDocumentBeforeModification> document's title before modification: @{Event.context.getProperty(\"previousDocumentModel\").getPropertyValue('dc:title')}" category: org.nuxeo - Log: level: warn message: "<SUPNXP-18961_printDocumentBeforeModification> document's title after modification: @{Document['dc:title']}" category: org.nuxeo
it generates the following logs:
14:22:49,738 WARN [nuxeo] <SUPNXP-18961_printDocumentBeforeModification> Event: org.nuxeo.ecm.core.event.impl.EventImpl@3f993666 14:22:49,742 WARN [nuxeo] <SUPNXP-18961_printDocumentBeforeModification> document's title before modification: BLANK.pdf 14:22:49,742 WARN [nuxeo] <SUPNXP-18961_printDocumentBeforeModification> document's title after modification: BLANK.pdf2 14:22:49,794 WARN [Console] <logDocumentModified> /default-domain/workspaces/ws1/BLANK.pdf
- when it executes the following automation scripting:
function run(input, params) { Console.warn('<SUPNXP18961_printDocumentBeforeModification> Event: ' + Event); Console.warn('<SUPNXP18961_printDocumentBeforeModification> Event: ' + JSON.stringify(Event)); // EMPTY object, WHY? Console.warn('<SUPNXP18961_printDocumentBeforeModification> Event.context: ' + Event.context); }
it generates the following logs:
14:28:06,176 WARN [Console] <SUPNXP18961_printDocumentBeforeModification> Event: [object Object] 14:28:06,176 WARN [Console] <SUPNXP18961_printDocumentBeforeModification> Event: {} 14:28:06,177 WARN [Console] <SUPNXP18961_printDocumentBeforeModification> Event.context: undefined 14:28:06,248 WARN [Console] <logDocumentModified> /default-domain/workspaces/ws1/BLANK.pdf