Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27776

GetParent operation should work in a about to create event handler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: None
    • Component/s: Automation

      Description

      Step to reproduce

      • in studio create an event handler on the type File for the event about to create
      • link it to an automation script
      function run(input, params) {
        Document.GetParent(input, {});
      }
      
      • deploy
      • try to create a new file object
        ==> it fails because the new document does not exist yet in the DB
      Caused by: org.nuxeo.ecm.core.api.DocumentNotFoundException: Failed to invoke operation Document.GetParent, /default-domain/content/TeamAwesome/TheRequest/NatGeo11.jpg
      nuxeo_1  |      at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.resolvePath(SQLSession.java:201) ~[nuxeo-core-storage-sql-10.10-HF10.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.core.api.AbstractSession.resolveReference(AbstractSession.java:334) ~[nuxeo-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.core.api.AbstractSession.getParentDocument(AbstractSession.java:1032) ~[nuxeo-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.core.operations.document.GetDocumentParent.run(GetDocumentParent.java:48) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
      nuxeo_1  |      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
      nuxeo_1  |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      nuxeo_1  |      at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      nuxeo_1  |      at org.nuxeo.ecm.automation.core.impl.InvokableMethod.doInvoke(InvokableMethod.java:174) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:179) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$OperationMethod.invoke(OperationChainCompiler.java:151) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.lambda$invoke$0(OperationChainCompiler.java:218) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:326) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:291) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.invoke(OperationChainCompiler.java:215) ~[nuxeo-automation-core-10.10-HF08.jar:?]
      nuxeo_1  |      at org.nuxeo.automation.scripting.internals.AutomationMapper.executeOperation(AutomationMapper.java:116) ~[nuxeo-automation-scripting-10.10.jar:?]
      nuxeo_1  |      at jdk.nashorn.internal.scripts.Script$Recompilation$75$8083AA$\^eval\_.GetParent(<eval>:196) ~[?:?]
      nuxeo_1  |      at jdk.nashorn.internal.scripts.Script$Recompilation$74$28AA$\^eval\_.run(<eval>:3) ~[?:?]
      nuxeo_1  |      at org.nuxeo.automation.scripting.internals.ScriptingOperationImpl$Runnable$$NashornJavaAdapter.run(Unknown Source) ~[?:?]
      

      expected behavior: the parent document exist in the repository and the new document being created has a path so the operation should be able to retrieve the parent doc

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.