Siebel Product Administration Guide > Siebel Configurator Scripts > Siebel Configurator Script Events and Methods >

BatchRequest Method


This method is used to stack multiple configuration requests into a single request, improves performance because it is not necessary to initialize the constraint engine for each request.

For example, when a user exits Siebel Configurator, you want to automatically add items A, B, remove item C and set attribute values for newly added items A and B. Without the BatchRequest method, the constraint engine is called for each configuration request such as AddItem, RemoveItem and SetAttribute. With the BatchRequest method, you can write a script that makes a single call to the constraint engine to compute the solution, which improves performance.

Syntax

BatchRequest (InputArgs, OutputArgs)

Argument
Description

InputArgs

A collection of property sets. Each child property set contains a Siebel Configurator script request along with its required set of parameters.

Optionally, each child property set can contain alias properties that may be used as a replacement for product paths. There are two type of alias properties:

  • OutItemAlias. User can give any name value as an Alias. Applies only to "AddItem" script requests.
  • ItemAlias. This can be any one of the given values for OutItemAlias.

Optionally, any child request can use the ItemAlias property instead of the product path. The user can use any name as the value of the alias.

OutputArgs

A property set that contains the Integration IDs returned by the AddItem script request and any errors that might have occurred during this BatchRequest execution.

Example

This example shows one way that you can use batch request. It assumes the product is set up as follows:

T-Shirt

|_Team T-Shirt (relationship)

|_Short sleeve shirt (component product) with Attribute: Color (dropdown values: Please Specify, Red, Blue)

| |_Accessories (relationship)

| |_Matching Hat (component product)

| |_Matching Bag (component product) with Attribute: Type (dropdown value: Please Specify, Duffel, Tote)

|_Long Sleeve Shirt (component product)

The following script adds 10 red short sleeve shirts along with 10 matching hats and 15 blue short sleeve shirts along with one matching duffel bag

function Cfg_InstInitialize (RootProduct)

{

var parentPropset = TheApplication().NewPropertySet();

var outPropset = TheApplication().NewPropertySet();

var childPropset1 = TheApplication().NewPropertySet();

var childPropset2 = TheApplication().NewPropertySet();

var childPropset3 = TheApplication().NewPropertySet();

var childPropset4 = TheApplication().NewPropertySet();

var childPropset5 = TheApplication().NewPropertySet();

var childPropset6 = TheApplication().NewPropertySet();

var childPropset7 = TheApplication().NewPropertySet();

//Add 10 short sleeve shirts

childPropset1.SetProperty("RequestType", "AddItem");

childPropset1.SetProperty("OutItemAlias","RedShirtAlias");

childPropset1.SetProperty("Parent Path","$.[T-Shirt]#1");

childPropset1.SetProperty("PortName","Team T-Shirt");

childPropset1.SetProperty("Name","Short sleeve shirt");

childPropset1.SetProperty("Quantity","10");

parentPropset.AddChild(childPropset1);

//set Red color

childPropset2.SetProperty("RequestType","SetAttribute");

childPropset2.SetProperty("ItemAlias","RedShirtAlias"); // picks particular instance

//childPropset2.SetProperty("Path","$.[T-Shirt]#1.[Team T-Shirt]#[Short sleeve shirt]"); // picks random instance

childPropset2.SetProperty("Name","Color");

childPropset2.SetProperty("Value","Red");

parentPropset.AddChild(childPropset2);

//Add 10 Matching Hats

childPropset3.SetProperty("RequestType", "AddItem");

childPropset3.SetProperty("ItemAlias","RedShirtAlias"); // picks particular instance

//childPropset3.SetProperty("Parent Path","$.[T-Shirt]#1.[Team T-Shirt]#[Short sleeve shirt] "); // picks random instance

childPropset3.SetProperty("PortName","Accessories");

childPropset3.SetProperty("Name","Matching Hat");

childPropset3.SetProperty("Quantity","10");

parentPropset.AddChild(childPropset3);

//Add 15 short sleeve shirts

childPropset4.SetProperty("RequestType", "AddItem");

childPropset4.SetProperty("OutItemAlias","BlueShirtAlias");

childPropset4.SetProperty("Parent Path","$.[T-Shirt]#1");

childPropset4.SetProperty("PortName","Team T-Shirt");

childPropset4.SetProperty("Name","Short sleeve shirt");

childPropset4.SetProperty("Quantity","15");

parentPropset.AddChild(childPropset4);

//set Blue color

childPropset5.SetProperty("RequestType","SetAttribute");

childPropset5.SetProperty("ItemAlias","BlueShirtAlias"); // picks particular instance

//childPropset5.SetProperty("Path","$.[T-Shirt]#1.[Team T-Shirt]#[Short sleeve shirt]"); // picks random instance

childPropset5.SetProperty("Name","Color");

childPropset5.SetProperty("Value","Blue");

parentPropset.AddChild(childPropset5);

//Add 1 Matching Bag

childPropset6.SetProperty("RequestType", "AddItem");

childPropset6.SetProperty("ItemAlias","BlueShirtAlias"); // picks particular instance

//childPropset6.SetProperty("Parent Path","$.[T-Shirt]#1.[Team T-Shirt]#[Short sleeve shirt] "); // picks random instance

childPropset6.SetProperty("OutItemAlias","BlueDuffelBag");

childPropset6.SetProperty("PortName","Accessories");

childPropset6.SetProperty("Name","Matching Bag");

childPropset6.SetProperty("Quantity","1");

parentPropset.AddChild(childPropset6);

//Set Bag Type = Duffel

childPropset7.SetProperty("RequestType","SetAttribute");

childPropset7.SetProperty("ItemAlias","BlueDuffelBag"); // picks particular instance

//childPropset7.SetProperty("Path","$.[T-Shirt]#1.[Team T-Shirt]#[Short sleeve shirt].[Accessories]#[Matching Bag]") // picks random instance

childPropset7.SetProperty("Name","Type");

childPropset7.SetProperty("Value","Duffel");

parentPropset.AddChild(childPropset7);

BatchRequest(parentPropset, outPropset) ;

}

Siebel Product Administration Guide Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices.