Siebel Order Management Guide Addendum for Industry Applications > Setting Up Network Ordering > Creating Custom Rule Checkers >

PreValidate Method


The PreValidate method determines the list of fields and attributes that the rules checker requires and returns them to the Compound Product Validation Engine. It may optionally use the product Id to retrieve product specific data related to the rule, or other parameters that may influence the list of fields and attributes.

Arguments
Argument
Description

Product Id

[in] Row Id of the compound product. (Required)

Parameter

[in] Property set of parameters that can be used to influence the list of required fields and attributes returned by the method. The parameters are defined in the Compound Product Rules Admin View. (Optional)

Field

[out] Property set of fields that are required by the rules checker to validate the Projected Asset cache.

Attribute

[out] Property set of fields that are required by the rules checker to validate the Projected Asset cache.

Example

The Port Over-Subscription Checker business service checks that the sum of the bandwidths of the connections going into or out of a node does not exceed the bandwidth of the node. The checker has two parameters that specify the name of the Bandwidth attribute of the Node product and the name of the bandwidth of the Connection product. The rules checker requires the Network Element Type, Product Name, Node and To Node fields and the Bandwidth attributes to evaluate the rule. The method returns a property set of type Field and a property set of type Attribute containing the list of fields and attributes required by the rules checker.

NOTE:  This sample code is provided for instructional purposes only. Different code may be needed, depending on how your system is configured.

function PreValidate (Inputs, Outputs)

{

// Retrieve input arguments

var productId = Inputs.GetProperty("Product Id");

var parameter;

// Retrieve the rules checker specific parameters

// These parameter

for (var i = 0; i < Inputs.GetChildCount(); i++)

{

var child = Inputs.GetChild(i);

switch (child.GetType())

{

case 'Parameter':

parameter = child;

break;

default:

throw "Unknown argument: " + child.GetType();

break;

}

}

if (parameter == undefined)

{

throw "Missing input argument 'Parameter'";

}

var connectionAttrib = parameter.GetProperty("Connection Attribute");

var nodeAttrib = parameter.GetProperty("Node Attribute");

// Define the fields used by this rules checker

var field = TheApplication().NewPropertySet();

field.SetType("Field");

field.SetProperty("Network Element Type", "");

field.SetProperty("Product Name", "");

field.SetProperty("Node", "");

field.SetProperty("To Node", "");

// Define the attributes used by this rules checker

var attribute = TheApplication().NewPropertySet();

attribute.SetType("Attribute");

attribute.SetProperty(connectionAttrib, "");

attribute.SetProperty(nodeAttrib, "");

// Return the required fields and attributes

Outputs.AddChild(attribute);

Outputs.AddChild(field);

}

See Also

Validate Method.

Siebel Order Management Guide Addendum for Industry Applications Copyright © 2007, Oracle. All rights reserved.