Platform Explorer / Nuxeo Platform LTS 2015 7.10

Operation Document.GetParent

Get Parent

Additional documentation

How To  
  • 5.7.2
  • 5.6
  • 5.7-I20130322_1136

If the ’type’ parameter is not used, the first parent is returned

Here a few examples using this operation:

Detecting if a parent was found
  • 5.7.1
  • 5.6
  • 5.7-I20130322_1136

Get Parent returns a Document. It may happen the current document does not have the a parent of the specified type. You can check the return value by comparing This with empty. For example, you could run a chain depending on the fact that a parent was found or not. Here we run the "NoParentFound" chain if Get Parent returned null, and the "ParentFound" chain if a parent was found:

Document > Get Parent
    type: MyDocType

Execution Flow > Run Chain
    id: @{This == null : "NoParentFound" : "ParentFound"}

 

Description

Get the parent document of the input document. The parent document will become the input for the next operation. You can use the 'type' parameter to specify which parent to select from the document ancestors
  • 5.7.2
  • 5.6
  • 5.7-I20130322_1136

If the ’type’ parameter is not used, the first parent is returned

Here a few examples using this operation:

Operation id Document.GetParent
Category Document
Label Get Parent
Requires
Since

Parameters

Name Description Type Required Default value
type string no  

Signature

Inputs document, documents
Outputs document, documents

Implementation information

Implementation class org.nuxeo.ecm.automation.core.operations.document.GetDocumentParent
Contributing component org.nuxeo.ecm.core.automation.coreContrib

JSON definition

{
  "id" : "Document.GetParent",
  "label" : "Get Parent",
  "category" : "Document",
  "requires" : null,
  "description" : "Get the parent document of the input document. The parent document will become the input for the next operation. You can use the 'type' parameter to specify which parent to select from the document ancestors",
  "url" : "Document.GetParent",
  "signature" : [ "document", "document", "documents", "documents" ],
  "params" : [ {
    "name" : "type",
    "description" : "",
    "type" : "string",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  } ]
}