Siebel Advisor API Reference > Siebel-Specific Functions for Siebel Advisor >

BuildProductStr


Usage

In cases where the customizable product string cannot be automatically generated from the model, construct the string programmatically using BuildProductStr and the supporting cell functions documented in this section.

The function may be called in cell functions or as part of a button/link/javascript that executes after the configuration engine has run.

Syntax

ISS.BuildProductStr(id, qty, AttrStr[] attrs, ProdStr[] children, relationshipName)

Argument
Description

id

A string for the product ID.

qty

Optional argument. Integer value for the quantity. Defaults to 1.

attrs

Optional argument. Array of attribute strings.

children

Optional argument. Array of customizable product strings.

relationshipName

Optional argument. String for the relationship name defined in the creation of the customizable product.

Example
Example 1

var myChildStr = "relationship=ChildSlot&*prodID=ARS-625&*qty
=1&*attributes={}&*children={}";

ISS.BuildProductStr("TRS-525",1,ISS.BuildAttributeList("Color
=Yellow", "Texture=Coarse"), ISS.BuildChildList(myChildStr), "Slot1");

Returns:

"relationship=Slot1&*prodID=TRS-525&*qty=1&*attributes
={Color=Yellow&*Texture=Coarse}&*children
={relationship=ChildSlot&*prodID=ARS-625&*qty=1&*attributes
={}&*children={}}"

Example 2

var child1 = ISS.BuildProductStr(ISS.GetBusCompID("CDPLAYER.PARTNUM"), 1, null, null, "CD_PLAYER");

var child2Attrs = ISS.BuildAttributeList(ISS.GetAttribute("SPEAKERS.WATT"));

var child2 = ISS.BuildProductStr(ISS.GetBusCompID("SPEAKERS.PARTNUM"),4, child2Attrs, null, "SPEAKERS");

var rootPart = ISS.BuildProductStr(ISS.GetBusCompID("ROOT"),1, null, ISS.BuildChildList(child1, child2));

rootPart has value:

"relationship=null&*prodID=KJR-157&*qty=1&*attributes={}&*children={relationship
=CD_PLAYER&*prodID=AFT-157&*qty=1&*attributes
={}&*children={}|*relationship=SPEAKERS&*prodID=HGT-697&*qty
=4&*attributes={Watts=60}&*children={}}"

Supporting Cell Functions

Table 9 lists the supporting cell functions to use when constructing a product string by hand.

Table 9. Supporting Cell Functions
Function
Description

ISS.AddAttributeToProductStr
(ProdStr, newAttr)

Given a customizable product string and an attribute string, this function adds the attribute to the customizable product string, and returns the constructed string. The passed-in strings are unchanged.

ISS.AddChildToProductStr
(ProdStr, newChild)

Given a customizable product string and a child customizable product string, this function adds the child string as a child of the customizable product string and returns the constructed string. The passed in strings are unchanged.

ISS.AddProdIDToProductStr
(BuildProductStr, prodID)

Given a customizable product string and a product ID, this function changes the product ID of the customizable product string and returns the constructed string. The passed in strings are unchanged.

ISS.AddQuantityToProductSt
(ProdStr, qty)

Given a customizable product string and a quantity, this function changes the quantity of the customizable product string and returns the constructed string. The passed in strings are unchanged.

ISS.AddRelationshipNameToProductStr
(BuildProductStr, relationshipName)

Given a customizable product string and a relationship name, this function adds the relationship name to the customizable product string and returns the constructed string. The passed in strings are unchanged.

ISS.GetAttribute(col)

Given a column name, this function constructs an attribute string representing the attribute name and value associated with that column. Note that the value is dependent on the selected row, and this function should only be called from points after the engine has run.

Example:

ISS.GetAttribute("COLOR.ATTR");

Returns:

"Model color=Red"

GetBusCompID(col)

Given a column name, this function returns the value of the business component ID associated with that column. Note that the ID is dependent on the selected row, and this function should only be called from points after the engine has run.

Example:

ISS.GetBusCompID("MODEL.DESC");

Returns:

"L523"

Siebel Advisor API Reference