Skip to main content

Standard Rendering Service Commands

1. Introduction

The topics described in this document relate to Rendering Service tasks only.

Rendering Service enables processes to perform part of their rendering logic in an application running separately from priint:suite and priint:bpm. Processes can specify one of a number of different commands that instruct the worker what to do, which variable to expect and what outcome variables to add to the variable map as a result.

2. Commands

Supported commands for priint:pdf renderer and Adobe InDesign Server® are as follows (explained later):

CommandExecute ScriptExport Document to PDFGenerate Document's Metadata and PreviewRegister in Database
SCRIPT_PDF_META_DB
SCRIPT_PDF
PDF
SCRIPT_META_DB
SCRIPT_DB
SCRIPT
GRID_ELEMENT_PREVIEW
FIRE_AND_FORGET_SCRIPT_PDF

Only for Adobe InDesign®

CommandAdobe InDesign® packageIncludes Links and Fonts
IN_DESIGN_DOC_EXPORT

3. Assigning task

To assign some Task to a Rendering Service:

Add a Service Task to a diagram and select it.

3.1. General Tab

  • set its Implementation to External (Delegate Expression is not used)
  • set its Topic to priint-rendering
  • Asynchronous Continuations - do not set
  • Documentation is a description for a Service Task

3.2. Definition Tab

In case of priint-rendering Topic user should not use this tab.

3.3. Input/Output Tab

Input/Output parameters differ depending on which Topic user set.

Note:

Parameter forceRefreshComponent set to true is automatically added.

3.4. Input Parameters for priint-rendering

First step is to choose which command is used for the Service Task.

  • set Local Variable Name to renderingWorkerCommand
  • set Variable Assignment Type to String or Expression
  • set Variable Assignment Value equal to one of the five commands of your choosing, for example SCRIPT_META_DB.
Local Variable NameTypeExampleDescription
renderingWorkerCommandString or ExpressionPDFthe command to execute

In the second step, the variable map at that point in the process contains all variables the selected command needs (listed below). If those variables are not set at the start of the process and they are not added by the service and user tasks leading to this point in the process, values can be set directly in the Input/Output -> Input Parameters section.

Parameters set in Input/Output Tab has higher priority and will override parameters incoming from previous steps.

A few are required by all commands:

Local Variable NameTypeExampleDescription
projectString or Expressionaioid of the project for which the process runs

As for the command specific variables, those are:

Command nameLocal Variable NameTypeExampleDescription
SCRIPT_PDF_META_DBrecreateDocumentString or Expressiontrue/falseif true, the document will get recreated
masterdocumentpath String or Expression\userdata\documents\ aio\master_documents\ 902010.w2mla full path to the master document file as perceived by the plannerengine
scriptIdString or Expression2343id of a script to run
pdfProfilesListValue: High, Value: Lowa List of Strings naming the pdf profiles to use for rendering, //
startingPageParameterNameString or Expression pageCountParamID of the parameter name for page countIf set, worker will assume page renumbering takes place in the process and will add a variable holding current document page count to the output
documentPageCountsMapKey: documentId Value: 122541a map of documentIds processed before the current one and their page counts. If it is not passed, the worker simply assumes this is a first document in a sequence
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
SCRIPT_PDFrecreateDocumentString or Expressiontrue/falseif true, the document will get recreated
masterdocumentpath String or Expression\userdata\documents\ aio\master_documents\ 902010.w2mla full path to the master document file as perceived by the plannerengine
pdfProfileslist of stringsValue: High, Value: Lowa List of Strings naming the pdf profiles to use for rendering
scriptIdString or Expression2343id of a script to run
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
PDFpdfProfileslist of stringsValue: High, Value: Lowa List of Strings naming the pdf profiles to use for rendering
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
SCRIPT_META_DBrecreateDocumentString or Expressiontrue/falseif true, the document will get recreated
masterdocumentpathString or Expression\userdata\documents\ aio\master_documents\ 902010.w2mla full path to the master document file as perceived by the plannerengine
scriptIdString or Expression2343id of a script to run
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
SCRIPT_DBrecreateDocumentString or Expressiontrue/falseif true, the document will get recreated
masterdocumentpathString or Expression\userdata\documents\ aio\master_documents\ 902010.w2mla full path to the master document file as perceived by the plannerengine
scriptIdString or Expression2343id of a script to run
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
SCRIPTrecreateDocumentString or Expressiontrue/falseif true, the document will get recreated
masterdocumentpathString or Expression\userdata\documents\ aio\master_documents\ 902010.w2mla full path to the master document file as perceived by the plannerengine
scriptIdString or Expression2343id of a script to run
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
IN_DESIGN_DOC_EXPORTdocumentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
GRID_ELEMENT_PREVIEWrealGridElementIdentifierString or Expressioncb407b95-5a68-499e-a80c-bfdebb5eab21an identifier of the RGE to preview
masterdocumentpathString or Expression\userdata\documents\ aio\master_documents\ 902010.w2mla full path to the master document file as perceived by the plannerengine
scriptIdString or Expression2343id of a script to run
documentIdString or Expression1234567identifying the document to process
documentpathString or Expression\userdata\documents\aio\939668362a full path to the document files as perceived by the plannerengine
realGridElementUpdatedOnTimestampString or Expression2024-02-05 22:28:51.575Last RGE modification date in yyyy-MM-dd HH:mm:ss.SSS format
xTopLeftString or Expression101top left RGE corner X coordinate
yTopLeftString or Expression102top left RGE corner Y coordinate
xBottomRightString or Expression201bottom right RGE corner X coordinate
yBottomRightString or Expression302bottom right RGE corner Y coordinate
FIRE_AND_FORGET_SCRIPT_PDFpdfProfileslist of stringsValue: High, Value: Lowa List of Strings naming the pdf profiles to use for rendering
masterdocumentpathString or Expression\userdata\documents\aio\master_documents\902010.w2mla full path to the master document file as perceived by the plannerengine
scriptIdString or Expression2343id of a script to run
outputFolderString or Expression\userdata\documents\aio\rendering_output_folderfolder rendered PDFs should end up in
outputFilenamePrefixString or Expressionrendered_filename prefix rendered PDFs will use

4. Outcome

Commands differ in their outcome:

CommandOutcome description
SCRIPT_PDF_META_DBRemoves the document file if requested. If the document file or its metadata are missing, it recreates them from the master document provided. If a script id is provided, it executes the script and saves the document. It then exports the document to a pdf for each pdf profile provided (or for no profile if none were given). The outcome files are named using the document identifier and pdf profile name and placed next to the document file. It then recreates the document metadata and previews and registers it in a database. It returns the number of pages the document has, adding them to a map held in a variable documentPageCounts allowing pagination page number adjustments for any subsequent documents.
SCRIPT_PDFRemoves the document file if requested. If the document file or its metadata are missing, it recreates them from the master document provided. If a script id is provided, it executes the script and saves the document. It then exports the document to a pdf for each pdf profile provided (or for no profile if none were given). The outcome files are named using the document identifier and pdf profile name and placed next to the document file.
PDFExports the document to a pdf for each pdf profile provided (or for no profile if none were given). The outcome files are named using the document identifier and pdf profile name and placed next to the document file.
SCRIPT_META_DBRemoves the document file if requested. If the document file or its metadata are missing, it recreates them from a master document provided. If a script id is provided, it executes the script and saves the document. It then recreates the document metadata and previews and registers it in a database.
SCRIPT_DBRemoves the document file if requested. If the document file or its metadata are missing, it recreates them from a master document provided. If a script id is provided, it executes the script and saves the document. It then registers the document in a database.
SCRIPTRemoves the document file if requested. If the document file or its metadata are missing, it recreates them from a master document provided. If a script id is provided, it executes the script and saves the document.
IN_DESIGN_DOC_EXPORTAn Adobe InDesign® package is exported for the document in a form of a zip archive and it is placed next to the .indd document file.
GRID_ELEMENT_PREVIEWIt executes the script specified by scriptId. It then extracts a preview of a comet group returned by that script and saves it in document metadata grid preview folder. It also removes older versions of that real grid element previews.
FIRE_AND_FORGET_SCRIPT_PDFOpens a temporary copy of a document template passed to it. It executes the script specified by scriptId. It then exports the document to a pdf for each pdf profile provided (or for no profile if none were given). The outcome files are placed in an output folder specified in the variables.

5. Error Handling

If everything worked fine, a variable errorCode with a value 0 is set. If there were business errors, a variable errorCode with a non-zero value is set and an additional variable named errorMessage is added with an error description. If a technical error occurs, the process engine is notified with a BPMN error containing code RENDERING_FAILURE and an error description. A process can handle these using Error Boundary Events placed at the service task's boundary.

6. Summary

As all commands add some values to the process variables map, be sure to either:

A. run the rendering-service task once only

B. run the rendering-service task sequentially for documents, not in parallel, by setting the sub-process execution mode to Sequential Multi Instance

C. include all rendering-service task return variable names in sub-processes Input/Output ->Input Parameter section

Option A is most likely fine for single document processes. Options B and C should work for working with whole folders or publications and performing rendering for each document in a sub-process.