PREP_PROCESS_COMMENTS

Use the PREP_PROCESS_COMMENTS script function to retrieve the timestamp, user and text of a task comment. The script lets you filter for a particular text in the comment. 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 each comment in the task.

Notes:

  • 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.
  • There is no error message if the comment that you are searching does not contain the values that you specify. The :PROCESS script statement does not process the data sequence in this case.

More Information:

Syntax

PREP_PROCESS_COMMENTS ([RunID] [,text] [, user])

Parameters

  • PREP_PROCESS_COMMENTS
    Retrieves text and details of a task comment

  • RunID
    (Optional) RunID of the task whose comments you want to retrieve
    If you do not specify a RunID, the comments of the task that calls the script function are read.
    Format: script literal, script variable, or number

  • text
    (Optional) Filters for a particular text in the comment
    Format: script literal or script variable
    Maximum number of characters: 200
    Default value: *

  • user
    (Optional) Filters for comments added by a particular user
    Specify the name of the user object (NAME/DEPARTMENT).
    Format: script literal or script variable
    Maximum number of characters: 200
    Default value: *

Notes:

  • Filters are case sensitive.
  • Use the wildcard character * to stand for any number of characters, or ? for a single character in a filter.
  • If you specify an empty string for a filter, the script function returns all values.
  • Include both commas in the parameters when you specify a user only, but no RunID or text filter.

Examples

A task has been started, and contains the following comments:

  • User: SMITH/VIE
    Time: 20.05.2018 22:20
    Comment: Successfully restarted file transfer

  • User: BROWN/VIE
    Time: 31.08.2018 11:22
    Comment: File could not be found because of a typing error. Corrected.

  • User: SMITH/VIE
    Time: 01.10.2018 16:25
    Comment: File transfer has aborted. File could not be found. Informed Ms. Brown.

The following script retrieves all comments in the task, and prints the user and the text of the comments in the activation report.

: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 following script retrieves only the comments made by the user called SMITH, and prints them in the activation report, including the timestamp.

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

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

:
CLOSE_PROCESS &HND#

The following example shows a script that is called from a different task. The script retrieves the RunID of the task that contains the comments, and uses the RunID to retrieve all comments in the task which include the word "error".

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

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

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

:
CLOSE_PROCESS &HND#

See also:

seealso

Script Elements for Data Sequences