PREP_PROCESS_REPORT
Use the PREP_PROCESS_REPORT script function to retrieve the report lines of executable objects from the database. The script function lets you filter by type and content of the reports. The script function returns a reference to a data sequence that you can use for further processing by assigning the return code to the :PROCESS script statement. Use the GET_PROCESS_LINE script function to access a particular line in the report.
Tip: Analyze the job report of the task itself in the Post Process page. Depending on the result, use :MODIFY_STATE to specify the definitive end of the job.
Syntax
PREP_PROCESS_REPORT ([Object type], [RunID], [Report type] [, Filter] [, "COL=Definition1 [, Definition2]"])
Parameters
| Parameter | Description | Format | Allowed Values |
|---|---|---|---|
| Object type |
(Optional) Short name of the object type. More information: Understanding the Object Types in Automic Automation Notes:
|
AE name, script literal or script variable | n.a. |
| RunID |
(Optional) RunID of the task whose reports to retrieve. Note: You do not need to specify a RunID for Client reports. Important! If you are retrieving the report of a predecessor of a Workflow task, activate the Generate Task at: Runtime option in the Attributes tab of the Workflow object. The report is not available yet during activation time. |
Script variable or number | n.a. |
| Report type |
(Optional) Short name of the report type. More information: Understanding the Reports Note: If you do not specify a report type, the script function accesses the job report (REP) for Job objects, and the activation report (ACT) for other types of tasks. |
AE name, script literal or script variable | n.a. |
| Filter |
(Optional) Filters for particular content of a line. Default value: * Notes:
|
Script literal or script variable | n.a. |
| COL |
(Optional) Defines whether and how to split the data sequence lines into columns. Use the following format: COL=Definition1[, Definition2]. For more information, see Defining Columns. |
Script literal or script variable | n.a. |
Defining Columns
To split the data sequence lines into columns, specify the column separation as follows:
COL=Definition1[, Definition2]
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| COL | Keyword for column separation. | Keyword | n.a. | n.a. |
| Definition1 | Defines whether the data sequence lines are split into columns. | Script literal or script variable |
|
NONE |
| Definition2 | (Optional) Defines column sizes and names, or the delimiter. | Script literal or script variable |
|
n.a. |
Important Considerations
Keep the following behaviors and rules in mind when constructing the script function:
- The report is saved in the same language as the Automation Engine logging.
- You cannot assign a new value to the script variable that contains the reference to the data sequence. Use :CLOSE_PROCESS to discard the existing data sequence, and then assign a new value.
- This script function automatically commits all open script transactions to the AE database. For more information, see Script Processing.
- No error message is displayed if the data sequence does not contain the indicated content. In this case, the data sequence that is defined between :PROCESS and :ENDPROCESS is not processed.
- You do not need to specify the RunID and Report Type when you use PREP_PROCESS_REPORT to access the report of the task that contains the script itself. The script function retrieves the RunID in this case.
- Set the commas of parameters that you omit.
- If a task has already ended, but the report is still incomplete, the script function waits for the report to be complete.
Return Codes
The script function returns a reference to a data sequence that you can use for further processing by assigning the return code to the :PROCESS script statement.
Examples
The following example searches for all lines of a job report that refer to drive C:. The script prints those lines in the activation report.
:SET &HND# = PREP_PROCESS_REPORT("JOBS",, "REP", "*C:\*")
:PROCESS &HND#
:SET &RET# = GET_PROCESS_LINE(&HND#)
:PRINT &RET#
:ENDPROCESS
A Job called MM.DAY prompts the user for file names. The file names are printed in the activation report of the Job. The following script in a different task reads the file names from the activation report of the Job, and prints them in the activation report of the task that contains the script.
:SET &RUNNR# = GET_UC_OBJECT_NR("MM.DAY")
:SET &HND# = PREP_PROCESS_REPORT(, &RUNNR#, "ACT",, "COL=DELIMITER",
"DELIMITER=*'*")
:PROCESS &HND#
:SET &RET# = GET_PROCESS_LINE(&HND#, 1)
:PRINT &RET#
:ENDPROCESS
The following script on the Post Process page of a Job retrieves lines which contain "file not found" in the job report of the Job itself. The script sends a message to the user logged in to the Automic Web Interface to inform them that an error occurred while copying.
:SET &HND# = PREP_PROCESS_REPORT(,,, "*file not found*")
:PROCESS &HND#
:SEND_MSG BU,BU, "Error occurred while copying."
:MODIFY_STATE RETCODE=50
:ENDPROCESS
Related Topics
See also: