Java Client SDK 3.13


Updated: October 18, 2022

This section is about how to run automation with Nuxeo Java Client.

Operation manager is instantiated for each automation to run, this gives us high isolation for each request to automation.

Automation input can be anything you want, Blob, Blobs, Document, Documents or primitive type. To give a document reference as input to automation, you need to use DocRef or DocRefs.

Automation output is dynamic and leverage marshaller capabilities in order to return proper Java Client object, if marshaller is not found client will return a plain string.


Let's create a file:

Document file = client.operation("Document.Create")
                      .param("name", "file001")
                      .param("type", "File")
                      .param("properties", "dc:title=My File\ndc:description=A short description")
                      .input(new DocRef("/"))


Let's update it:

file = client.operation("Document.Update")
             .param("properties", "dc:nature=card")

Document as Input
We can directly give the Document as input to automation but this serialize the whole document. This has impact on performance regarding usage of DocRef.

We can also do:

Document file = client.operation("Document.Update")
                      .param("properties", "dc:nature=card")
                      .input(new DocRef("/file001"))


Let's attach a blob to our file:

      .param("document", "/file001")
      .param("xpath", "file:content")
      .input(new FileBlob(File))
      .voidOperation(true) // allows to not download blob in response


Let's download our blob:

Blob blob = client.operation("Blob.Get")
                  .param("xpath", "file:content")
                  .input(new DocRef("/file001"))


Let's get versions of our file:

Documents versions = client.operation("Document.GetVersions")
                           .input(new DocRef("/file001"))

We'd love to hear your thoughts!

All fields required