This article is relevant for the Geneva and later releases.
Execution context methods
There are several execution methods of the CTX objects in Pattern Designer:
- getCommandManager(): This method returns a Command Manager object (see details on this object below).
- getAttribute(name): This method uses the attribute name as its input and returns its value. If the attribute is scalar, it returns an object of String type. If it is a table, it returns a Java object of the List type <Map<String,String>. Each object in the List is a row in the table. Each row is Map<String,String>, where the key is the column name and the value is the field value.
- setAttribute(name, Object):This method sets an attribute in the context. The first argument is the attribute name. The second can be a String, in case of scalar attribute, or Java object of type List<Map<String,String>>, in case of table attribute.
- CommandManager.shellCommand: This method executes a command on a target host. On UNIX machines or network devices, this command is using SSH. On Windows machines, it runs commands using the 'cmd'.
- Command: string containing the command to be executed
- superUser: Boolean argument defining if the command needs to be executed with elevated rights like sudo
- executionMode: put null here
- commandParams: put null here
- executionContext: put CTX here
- Create a new pattern or select an existing pattern to customize as described in the product documentation.
- Navigate to the Identification section or Connection section.
- Add a new step or select a step you want to customize.
- Select Set Variable from the Operation list.
- Click OK.
- Enter the relevant entry that in the Parameter field.
- Click Save.