Automation Engine Script Guide > Ordered by Function > Data Sequences > PREP_PROCESS_COMMENTS

PREP_PROCESS_COMMENTS

Script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,…: Uses filter settings to retrieve the time stamp, userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management. and text of taskAn executable object that is running. Tasks are also referred to as activities. comments, and provides the result for further processing in the form of an internal listShows entities in a grid view (data sequenceAn internal listing of Console outputs or lines of Variable objects, etc. The lines of a data sequence can be accessed by using a PROCESS loop or the script element GET_PROCESS_LINE. The script elements PREP_PROCESS* generate data sequences.).

Syntax

PREP_PROCESS_COMMENTS([RunID], [Text], [User])

Syntax

Description/Format

RunIDShort for "run number". It is a number that provides unique information about a task's execution. The RunID can include 7 to 10 digits. It is assigned by the Automation Engine component .

Run number (RunID) of the task whose comments should be read.
Format: script literal, script variable or number

If no RunID has been specified, the comments of the task which calls this scriptA particular Automation Engine object type. statement are read.

Text

Filter for a particular text used in the comment
Format: script literal or script variableA placeholder for a value within a script.
Maximal 200 characters
Default value: "*"

The wildcard charactersThese are placeholders for characters when you specify filters. ? stands for exactly one character, * for any number of characters. "*" and "?" can be used. "*" stands for any characters, "?" for exactly one character.

User

Filter for the name of a User objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task
Format: script literal or script variable
Maximal 200 characters
Default value: "*"

The wildcard characters "*" and "?" can be used. "*" stands for any characters, "?" for exactly one character.

The first colon is also required if you only filter by the user. See the following example:

:SET &HND# = PREP_PROCESS_COMMENTS(,,"SMITH/AE")


Return code

Reference to the data sequence of comments

Comments

This script function reads a task's comments. The result may be limited using the parameters Text and User.

Upper and lower case are considered in the filter specifications.

Keep in mind that an empty string ("") used as a filter specification has the same effect as "*" - all values are returned.

The return codeThe value that represents the result of tasks and script functions. of this script function is the reference to a data sequence which is assigned to the script statements :PROCESS and :ENDPROCESS as a start parameter. Each of a task's comments may now be accessed using the script function GET_PROCESS_LINE.

No error message is sent if the values that are searched for are not included in the comment. The processing of the data sequence that is defined between :PROCESS and :ENDPROCESS simply does not take place.

No new value can be assigned to the script variable containing the data sequence reference. The data sequence must first be discarded with the script statement CLOSE_PROCESS and then the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. can be re-used.

Examples

The following comments have already been started:

The first example retrieves all comments and :PRINT supplies the user and the text.

:SET &HND# = PREP_PROCESS_COMMENTS()

:
PROCESS &HND#
:   
SET &USER# = GET_PROCESS_LINE(&HND#,2)
:   
SET &TEXT# = GET_PROCESS_LINE(&HND#,3)
:   
PRINT "&USER#:  &TEXT#"
:
ENDPROCESS

:
CLOSE_PROCESS &HND#

The second example only reads the entries of Mr. Smith and prints them including the time stamp.

:SET &HND# = PREP_PROCESS_COMMENTS(,,"SMITH/AE")

:
PROCESS &HND#
:   
SET  &TIME# = GET_PROCESS_LINE(&HND#,1)
:   
SET &TEXT# = GET_PROCESS_LINE(&HND#,3)
:   
PRINT "&TIME#:  &TEXT#"
:
ENDPROCESS

:
CLOSE_PROCESS &HND#

In the third example, the script function is called from a different task, hence the RunID. The result supplies all texts of the comment which include the word "file".

:SET &RunID = GET_UC_OBJECT_NR(MM.RETRIEVE.FILES)

:SET &HND# = PREP_PROCESS_COMMENTS(&RunID,"*file*")

:
PROCESS &HND#
:   
SET &TEXT# = GET_PROCESS_LINE(&HND#,3)
:   
PRINT "Comment: &TEXT#"
:
ENDPROCESS

:
CLOSE_PROCESS &HND#

 

See also:

Script element Description

:ADD_COMMENT

Adds a comment to a task

:CLOSE_PROCESS

Discards an unnecessary data sequence

:PROCESS... :TERM_PROCESS... :ENDPROCESS

Loop for line-by-line processing of a data sequence - a sequential file or a command result, for example

GET_PROCESS_LINE

This is used to retrieve content from the current line of a data sequence.

Script Elements - Data Sequences

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH