External commands

If you choose to use the RunExternalProgram step template, figure out the command that you want to use before you start to create your step template. Here are some example commands that use Ricoh ProcessDirector symbol notation.

Copy a newer print file to a destination

In this example, the Linux cp command only copies the JobNumber.print.pdf file from the spool directory for the job when the source file is newer than the destination file:
cp -u ${getAbsoluteFileName(print, pdf, read)} /tmp/jobarchives

${getAbsoluteFileName(print, pdf, read)} is the Ricoh ProcessDirector symbol formula that returns the name of the PDF print file in the spool directory. If the PDF print file does not exist in the spool directory when the external program runs, an error occurs.

Update a print file and write it to the spool directory

In this example, the external program myprogram reads the JobNumber.print.pdf file from the spool directory and writes an updated version of the file to the spool directory using redirection:
myprogram -i ${getFileName(print, pdf, read)} > 
${getFileName(print, pdf, write)}

${getFileName(print, pdf, read)} is the Ricoh ProcessDirector symbol formula that returns the name of the PDF print file in the spool directory. If the PDF print file does not exist in the spool directory when the external program runs, Ricoh ProcessDirector returns the name of the input file for the job, which is JobNumber.print.unknown. If that file does not exist in the spool directory, an error occurs.

Read the overrides file for a print job and write a statistics file to the spool directory

In this example, the external program auditstatistics reads the JobNumber.overrides.text file from the spool directory and writes a new statistics file JobNumber.statistics.text to the spool directory:
auditstatistics inputfile=${getFileName(overrides, text, read)} 
outputfile=${getFileName(statistics, text, write)}

Use a separate file to pass property values to an external program with the print file

In this example, the Linux cp command produces a CSV file for which a corresponding Ricoh ProcessDirector control file exists. The control file lists the symbols for nine Ricoh ProcessDirector job properties:
cp ${getControlFileName()} /aiw/aiw1/samples/${Job.ID}.info.csv

${getControlFileName()} is the Ricoh ProcessDirector symbol formula that returns the name of the resolved control file. Ricoh ProcessDirector generates the control file from the control file template that you specify.

The control file can use the getChildFileName method to return the name of a child file so that the external program can write a file to the children subdirectory in the spool directory. The external program must write the file names of child-job files in this format:

JobNumber.UsageType.DataType.n,Job.JobType=JobTypeName
JobTypeName is the name of the workflow that the child job requires. The workflow must exist and it must be enabled.

When you add a step based on the RunExternalProgram step template to a workflow using the Job Types property notebook, the properties that show [Receive] in the job defaults change to reflect the actual phase to which you add the step.

Invoke a command using a full path name

This example uses a full path name to invoke the user-supplied external program mytransform to transform a file to PDF format. mytransform reads the names of the input and output files from a control file:
/opt/myprograms/bin/mytransform -c ${getControlFileName()}

Archive a print file to a Windows system

In this example, the external step uses the Windows copy command to write a copy of the JobNumber.print.pdf file from the spool directory to an archive directory on the Windows system:
copy ${getAbsoluteFileName(print,pdf,read)} d:\archive\pdf
    Note:
  • The Windows system directory must have Ricoh ProcessDirector installed and the Windows application server must be connected to the primary server.
  • Specify the Windows directory by using the native Windows format for the directory name.
  • Use native Windows commands instead of Windows Services for UNIX (SFU) commands where appropriate; for example, use the copy command instead of the cp command. Not all SFU commands are available on Windows systems.
  • Depending on the command, a directory on the Windows system might not need to exist. The command can create the directory on the Windows system.
  • Make sure that you tune the step template to only run on a Windows application server. Because of the different formats for directory names on Linux and AIX, a step based on this step template will fail if Ricoh ProcessDirector tries to run the step on a non-Windows system.