Important

   

This documentation space contains information about PATROL Agents when deployed in a TrueSight Operations Management environment. If you are a BMC Helix Operations Management user, see PATROL Agent 22.1 for BMC Helix Operations Management. Open link

PslExecute()

Start a PSL process.

Syntax

PslExecute(name,PslScript,[errorlist],[warninglist])

Parameter

ParameterDefinition

name

text string that provides a descriptive identifier for the new PSL process

PslScript

text string containing the PSL commands that should be executed

errorlist

optional variable to which the PSL interpreter/compiler will return text string error messages created while compiling PslScript*Default* 
PslExecute() function does not return compilation error messages

warninglist

optional variable to which the PSL interpreter/compiler will return text string warning messages generated while compiling PslScript*Default* 
PslExecute() function does not return compilation warning messages

Description

The PslExecute() function compiles and executes the statements in PslScript and runs them in the PATROL Agent as the PSL script name. If errorlist and warninglist are specified, the PSL interpreter/compiler will return any error or warning messages that it generates to those variables. 

The PslExecute() function returns the following values:

  • 0 if name has been successfully created and is executing
  • 1 if name has experienced a compilation errors
  • 2 if name has experienced a process creation error

Non-Blocking Feature

The PslExecute() function works with a parent and child PSL script. The parent script is the code that executes PslExecute(), and the child script is executed by PslExecute(). The child script is also known as the PslScript parameter. 

The non-blocking feature is that the child script does not block the progress of the parent script. Another way to describe this feature is that the parent script does not wait for the child script to finish its work.

Example

The following example uses the PslExecute() function to create the PSL process called myscript to print the messageHello world:

PslExecute("myscript","print(\"Hello world\\n\");",errors,warnings);
printf("compilation errors for myscript :\n%s\n",errors);
printf("compilation warnings for myscript :\n%s\n",warnings);

The following example shows the non-blocking feature ( Non-Blocking Feature) of PslExecute():

print("1\n");
PslExecute("pkolTest","print(\"2\\n\");",x,y);
print("3\n");

The following output is the result of the previous example:

1
3
2

The previous output is nonsequential because of the non-blocking feature of PslExecute().

Was this page helpful? Yes No Submitting... Thank you

Comments