Preprocessing and postprocessing of output

The pre-command and post-command properties can contain programming code for commands to be executed before and after the document-style report publishing process.

About this task

You might use the Post-command property to copy the output files, archive the output files, rename the output files based on variables, mail the output files, or invoke third-party applications. Refer to the documentation for your operating system to learn more about the commands you can use. Example: Microsoft Windows Command-line reference


  1. In the Document specification view, click Metadata.
    The Properties view is displayed.
  2. Select the Pre-command or Post-command property and click the Configuration icon Configuration icon.
    The Set values for pre-command or post-command window opens.
  3. Enter the values.
    You can use system variables, such as RPE_HOME, or external template variables in your commands. The format is always ${variable}. Template variables take precedence over system variables when they have the same name. You can also use the output formats as variables to indicate the path specified in the output properties. You must write the variable as its name is displayed in the document specification.
    • ${RPE_HOME}
    • ${Html}
    • ${Word}
    • ${PDF}
    • ${New PDF}
    • ${XslFo}
    • ${ModuleName}
    Important: You cannot use any variations to these names, like ${WORD} or ${word}. These variations cannot be recognized by IBM Engineering Lifecycle Optimization - Publishing.
    For example, only the variable ${Word} inserts the path property value specified for the Microsoft Word output. In the log, the variable displays as the value.
  4. Optional: For the Stop on pre-command failure property, enter true or false.
    When set to true, and the pre-command fails, then the document-style report generation stops running. When set to false or no value is entered, and the pre-command fails, then the document-style report generation continues running.
  5. Click OK.


Windows icon To copy the output to a second location, use the following command:

cmd /c copy ${output_format} D:\path\filename.output_extension

When writing commands in JavaScript, enter //!JavaScript to the beginning of the code to use the internal JavaScript engine to evaluate the commands:
var x = output;
var y = variable;

java.lang.System.out.println( X+Y= + x + y);