← Back to plugin index

Report Exec Task

Description
This task plug-in iterates over the files in a directory (e.g. rendered reports) and executes an OS command (e.g. print command) with the file.

The task can for example be used to send PDFs to a printer.

Type name
ReportExecTask
Class
com.airlock.iam.servicecontainer.app.application.configuration.task.ReportExecTask
May be used by
Properties
Directory (directory)
Description
Denotes the directory containing the files to be processed.

This may be either an absolute path or relative to the current directory of the running VM.

The directory must be writable (if files are deleted after processing).

Attributes
File/Path
Mandatory
Command (command)
Description
Specifies the command to be executed.

The command may contain the following variables:

  • "${FILE}" is substituted by the file name (no path) being processed.
  • "${DIR}" is substituted by the file path of the directory the file is in (relative to the JVMs current directory). This corresponds to the path of the directory specified by configuration property "directory".
  • "${ABSOLUTE_DIR}" is substituted by the absolute file path of the directory the file is in. This corresponds to the path of the directory specified by configuration property "directory".
The variable names are case-sensitive. The curly braces are mandatory. Each variable may be used more than once.
The command is executed in the directory denoted by the configuration property "directory".

Attributes
String
Mandatory
Example
lp -d myprinter ${FILE}
Example
cp ${FILE} ${DIR}/../otherdir/
Example
cp ${FILE} ${ABSOLUTE_DIR}/../otherdir/
Filename Suffix (filenameSuffix)
Description
A file in the configured directory is only processed if its name matches this suffix.
The suffix is NOT case-sensitive.
Attributes
String
Optional
Example
.pdf
Example
.txt
Filename Prefix (filenamePrefix)
Description
A file in the configured directory is only processed if its name matches this prefix.
The prefix matched against the filename only, i.e. without the path to the folder it is in.
The prefix is NOT case-sensitive.
Attributes
String
Optional
Example
pwd-letter-
Example
matrix-
Delete Processed Files (deleteProcessedFiles)
Description
If set to true (the default), the processed files are deleted after executing the OS command successfully.

Note: Not deleting the file usually means that it gets executed again and again. Setting this property to "false" makes sense if the OS-command removes the file from the directory.

Attributes
Boolean
Optional
Default value
true
Success Return Codes (successReturnCodes)
Description
Defines what return code(s) of the OS command should be interpreted as success.

Multiple return codes may be specified as comma-separted list.

If more than one return code is specified, they are all compared to the result code.

If the return code from the OS command does not match any of the specified return codes, it is considered to be a failure.

The elements must be integers.

Attributes
String-List
Optional
Default value
[0]
Output Pattern (outputPattern)
Description
Regular expression pattern compared against the standard output and the standard error of the OS command to detect successful execution.
The pattern is compared against the whole output, i.e. including line breaks. The "." also matches line breaks ("DOTALL" is enabled).

If defined, this check is done after the result code has been checked (see property "success-return-code".

Multiple patterns may be defined using the group/selector notation.

If the output from the OS command does not match any of the patterns, it is considered to be a failure.

Attributes
RegEx-List
Optional
YAML Template (with default values)

type: ReportExecTask
id: ReportExecTask-xxxxxx
displayName: 
comment: 
properties:
  command:
  deleteProcessedFiles: true
  directory:
  filenamePrefix:
  filenameSuffix:
  outputPattern:
  successReturnCodes: [0]