xmlparser v1.2x Probe Documentation

15
Nimsoft Documentation: xmlparser v1.2x 1 Nimsoft Documentation Nimsoft Probes Technical Description xmlparser v1.2x Probe Documentation Last Update: 08 December 2010 Copyright© 1998-2010, Nimsoft Corporation www.nimsoft.com

Transcript of xmlparser v1.2x Probe Documentation

Nimsoft Documentation: xmlparser v1.2x 1

Nimsoft Documentation

Nimsoft Probes – Technical Description

xmlparser v1.2x Probe Documentation

Last Update: 08 December 2010

Copyright© 1998-2010, Nimsoft Corporation

www.nimsoft.com

Nimsoft Documentation: xmlparser v1.2x 2

Contents

xmlparser ............................................................................................................................................................... 3

Configuring the xmlparser probe ................................................................................................................ 3 Configuring Profile ..................................................................................................................................... 4

Profile Management ................................................................................................................................ 5 Input Source ............................................................................................................................................ 6 Processing Rule ....................................................................................................................................... 8 Output Fields ........................................................................................................................................... 9 Result To ............................................................................................................................................... 11

Creating Processing Rule .......................................................................................................................... 11 Operation ............................................................................................................................................... 11 Examples ............................................................................................................................................... 12

XML Profile Processing ............................................................................................................................ 12 File System Listener .............................................................................................................................. 12 BUS Queue Listener.............................................................................................................................. 12 Output.................................................................................................................................................... 12

Post-Processing Operations ....................................................................................................................... 14 Header File Format (.hdr).......................................................................................................................... 15

Nimsoft Documentation: xmlparser v1.2x 3

xmlparser

This description applies to xmlparser probe version 1.2x

The basic purpose of xmlparser probe is to process an XML file against the

rule specified in the profile, and perform action as configured in the profile.

After processing, the status is sent back to the calling probe (as configured in

the profile) along with information preconfigured in the profile as an XPath

expression.

Currently, the xmlparser probe supports the following four ways to provide

the XML file:

File name at specified location on local file system

BUS Queue name specified on any robot in the same domain.

URL

Webservice

Configuring the xmlparser probe

In the Infrastructure Manager, double-click the xmlparser probe. The probe

GUI opens. Configure the basic parameters of the probe as described below.

Nimsoft Documentation: xmlparser v1.2x 4

The Available Profiles section displays the profiles currently available in

the configuration (cfg) file. You can create, update or delete the profiles

using the following buttons:

Add New Profile

Edit Profile

Delete Profile

Configuring Profile

To create a new profile, click the Add New Profile button in the xmlparser

probe GUI. The Manage Profile dialog opens. Enter the details required for

profile configuration as described below:

Nimsoft Documentation: xmlparser v1.2x 5

Profile Management

Field Description

Profile Name Enter a name for the profile

Active? Select the checkbox to set the current profile as active

Inherit Master Header

Select the checkbox to allow inheriting the content of the master header file, in case individual XML header file is not present, or some of its content is missing.

Use Master Header Select the checkbox to allow specifying the location of the master header file. This field is mandatory if the “Inherit Master Header” is selected.

When Rule Fails Specifies the action to be performed by the xmlparser probe in case the rule of xml processing fails. The probe can either raise the alarm (select the Raise alarm checkbox) or generate the QOS (select the Generate QoS checkbox), or perform both the actions.

On selecting the checkbox(es), the respective drop-down lists become active. Select the appropriate condition from the drop-down list (Legal data found or Legal data not found) based on which alarm/QoS should be generated.

Input Source

Select one of the following options and click the Settings button.

File System

Queue

URL

Webservice

When you click the Settings button, respective dialog box opens. Configure the parameters as described below.

Nimsoft Documentation: xmlparser v1.2x 6

Input Source

File System

Click the Browse button opens a File Open dialog, which enables you to

navigate to the folder where the input XML file is located. Select the XML

file and click the OK button.

Queue

Enter the queue name and the subscriber‟s machine name (or IP address) in

the respective fields, and click the OK button.

URL

Enter the URL of the location where the input XML file is located. Click the

OK button.

Nimsoft Documentation: xmlparser v1.2x 7

Webservice

Configure the Webservice parameters as described below:

Field Description

Webservice details

Endpoint URL Enter the location URL to access the webservice

Wsdl URL Enter the URL to retrieve the list of methods defined in the webservice

List Methods Click this button to display a list of methods defined in the webservice

Webservice Methods

When you click List Method button, the drop-down displays list of methods defined in the webservice

Get Request Envelope

Click this button to retrieve the contents of the Get Request query.

Soap Request When you click the Get Request Envelope button, the field displays the contents of the Get Request query.

A question mark indicates the fields for which you need to enter the necessary details (For example, IncidentID in the above example).

Soap Action Enter the alias for the method. This field is not mandatory

Nimsoft Documentation: xmlparser v1.2x 8

Authentication Details

Username and Password

Enter the Username and password, if required. These two fields are not mandatory.

After entering the required details, click the Test Request button to verify the

validity of the query. On proper configuration, Soap Response dialog

appears, as shown below.

Processing Rule

This field enables you to specify rule to process the input XML file. Click

the Add/Modify button either to create a new processing rule, or to modify an

existing processing rule.

XML Processing Rule dialog appears. Configure its parameters as described

below:

Nimsoft Documentation: xmlparser v1.2x 9

Field Description

Select XML

Select XML File Displays the path of the selected XML file for which the rule

is being created or edited

Select XSD file Click the Browse button to navigate to the XSD file against which the selected XML needs to be validated

Validate Click this button to validate the XML file against the XSD document. Result is displayed below Validate button

Create Processing Rule

Enter the processing rule. The processing rule is from the XML file whose location is specified in the “Select Xml File” field. For more details on the format of the processing rule, please refer the section “Creating Processing Rule” in this document.

Test Rule Click this button to check the validity of the processing rule before saving it.

Click the Save button to save your changes.

Output Fields

The Output Fields indicate that the XML file will be processed against the

specified output fields. Click the Add/Modify button either to create a new

output field, or to modify an existing output field.

Select Result Fields dialog appears. Configure its parameters as described

below:

Nimsoft Documentation: xmlparser v1.2x 10

Field Description

Result Handling

Return Field Name

Enter the name of the output field

Output Expression

Enter the expression for output field. This is the name of the PDS key which will have the processed data

Add Click this button to add the new result field to the “Result Fields” list box

Result Fields

Displays the currently added Result fields

Double-clicking on a entry opens a dialog that enables you to configure the parameters for that result field. Using this dialog, you can choose whether to generate an alarm and/or generate a QoS, and also specify the value, operator and message string to be displayed.

Click Ok button to save the changes.

Remove Click this button to remove the selected Result Field

Clear Click this button to remove all the results fields

Click the Save button to save your changes.

Nimsoft Documentation: xmlparser v1.2x 11

Result To This field displays the name of the calling probe (that is, the probe to which

the processed data will be sent).

In case the calling probe is on same robot, you can only the name of robot;

otherwise, the fully qualified robot name along with probe name is required

in the following format: /domain/hub/robot/probename

Creating Processing Rule

The processing rules consist of a single or multiple operations. The

operations contain a valid XPath expression. In case of multiple operations,

each operation must be separated using one of the following operators:

AND

OR

Operation

Each operation consists of three parts, as described below:

Valid XPath expression:

Any valid XPath expression means the valid syntax of XPath expression

enclosed in a square bracket to indicate an element in XML file.

In case operand is attribute type, then the attribute name can be specified

after enclosed square brackets separated by „@‟ sign.

Example: ([/result/actors/actor]@id = 20

Condition:

The condition can be any one of following comparison mechanism

Equality Operator : =

Greater than : >

Less than : <

Less than or equals : <=

Greater than or equals: >=

Like comparison: Like (Internally this checks if the source contains any of the character specified in target.)

Not equals: !=

Target:

The target can be either a numeric or a string constant).

The target may also contains regular expressions, these must be enclosed

within two “/” sign to indicate as a regular expression.

E.g. ([/result/actors/actor]@id = “/c.*/”

Nimsoft Documentation: xmlparser v1.2x 12

Note: Every Operation must be specified using round brackets () and each of

these brackets should be separated by operator “AND”, “OR”

Examples

(([/result/actors/actor]@id = “/c.*/”) AND ([/result/actors]@name Like „Alex‟))

((([/Employee/Salary]@basic<20000) AND ([/Employee/Salary]@Designation = Developer)) OR ([Employee/Salary]@NetSalary < 25000))

XML Profile Processing

On restart, the probe will start listening to the inputs configured in all given

profiles, and will process them as and when new input is available.

File System Listener

This listener performs the input availability check (if the profile is active)

after a regular interval specified as check_interval key in configuration.

BUS Queue Listener

In case the listener type is selected as BUS Queue listener and profile is

active, a subscription is made to the given queue name on given machine

name. Therefore, the processing will start as soon as xmlparser received new

input notification.

In this case, the queue must be in the following format.

The PDS in the queue should have one PDS with name “nimQueueData”.

This nimQueueData PDS should contain following three keys all with string values:

xml – Indicates input xml as string value.

hdr – Indicate per xml header file as string value (format is specified at the end of this document)

profileName – Name of the profile to be used for processing

In case information required is incorrect or insufficient, then this request will not be processed, and xmlparser will wait for next item in the queue.

Output In order to view the processed output of a specific profile for recent execution

cycle, the probe utility can also be used, the output of getProcessData call-

back as shown in the figure below by entering the name of the active profile.

Nimsoft Documentation: xmlparser v1.2x 13

The getProcessData callback returns a PDS xmlResult, which in turn contains

two more PDS, as described below:

alarmDetails pds contains the status of alarm.

xmlOutput pds contains the result of the output field and the profile name.

Nimsoft Documentation: xmlparser v1.2x 14

Post-Processing Operations

After each processing, the status (success/failure) is logged.

In case of File System as Input Source: If the archiving is enabled, the

processed input file is archived to the pre-configured location and deleted

from the original location.

If the archiving is not enabled, then the file will be deleted from the original

location and no backup will be taken.

In case of BUS Queue as Input Source: The result PDS is sent back to the

probe specified in “Result To” field.

Nimsoft Documentation: xmlparser v1.2x 15

Header File Format (.hdr)

The header file is a pre-requisite for a profile in case any of following options

is selected:

Raise alarm

Generate QOS

The format of the header file is as shown below:

Note: Here, the elements „mandatory’ and „optional’ indicate the fields that

will be used for alarm generation and the „qos‟ element values are used for

QOS generation.

-DOCUMENT END-