exists()


Verify the existence of a PSL object

Syntax

 

exists(object,[inherit])

Parameters

Parameter

Definition

object

alphanumeric identifier for the object whose existence is being verified The object is assigned when the object is created.

inherit

boolean expression controls whether exists will search the inheritance hierarchy to verify the existence of object

*Valid Values*

  • TRUE- do not search the inheritance hierarchy
  • FALSE-search the inheritance hierarchy if object is not a reference to an absolute object

Description

The exists() function returns TRUE if object exists, FALSE otherwise. The exists() function is useful in application discovery procedures that determine whether a discovered instance has previously been discovered and instantiated in the object hierarchy.

The exists() function searches for any PSL object that matches object, including PSL variables, even if the object was not created with the create() function.

Example

This example checks to see if the user name "jsmith" has already been created:

name = "jsmith";
if (exists(name)) {
print(name);
} else {
print("User name does not exist");
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*