Custom Business Service
Retrieve the product attributes using API and assign to profile attributes using custom business service GetLinteItemProdData with below function.
function GetLinteItemProdData(Inputs)
{
try{
var Prod_SDataService = "88-31ILGQ" // root product id of S Data Service
var Prod_STVService = "88-31ILXP" // root product id of S TV Service
var inp : PropertySet = null;
var out : PropertySet = null;
var oBS_InMemUDS : Service = null;
TheApplication().Trace("START GetLinteItemProdData method" );
var CurProdId = Inputs.GetProperty("ProductId");
TheApplication().Trace("Current Product Id ::: " + CurProdId );
oBS_InMemUDS = TheApplication().GetService("InMemory Upgrade Data Service");
inp = TheApplication().NewPropertySet();
out = TheApplication().NewPropertySet();
if( CurProdId == Prod_STVService)
{
var DataPlan5GQty = "$.[" + Prod_SDataService + "]#1.[88-31ILHU]#[88-31ILGG]#1.xf[Quantity]"; // get 5G Unlimited Quantity
inp .SetProperty(DataPlan5GQty , "");
var HighSpeedACode = "$.[" + Prod_SDataService + "]#1.[88-31ILHU]#[88-31ILEP]#1.xf[Action Code]"; // High Speed Action Code
inp .SetProperty(HighSpeedACode, "");
oBS_InMemUDS .InvokeMethod( "GetProdInstInfo", inp, out ); // new API for parallel configurator to get product instance data from in-memory
var outSuc = out.GetChild(0); //Success PS
var outErr = out.GetChild(1); //Error PS
if (outErr.GetChildCount() > 0) //Error occurred
{
TheApplication().Trace(" Number of failed paths: " + outErr.GetChildCount());
}
else
{
var Data5Gqty = outSuc.GetProperty(DataPlan5GQty )
if(Data5Gqty == "1")
{
TheApplication().SetProfileAttr("DataSpeed", "5G");
}
else
{
TheApplication().SetProfileAttr("DataSpeed", "");
}
TheApplication().SetProfileAttr("DataActionCode", outSuc.GetProperty(HighSpeedACode ));
TheApplication().Trace("Profile Attribute DataSpeed ::: " + TheApplication().GetProfileAttr("DataSpeed"));
TheApplication().Trace("Profile Attribute DataActionCode ::: " + TheApplication().GetProfileAttr("DataActionCode"));
}
PropertySetToFile(out);
}
}finally{
oBS_InMemUDS = null;
inp = null;
out = null;
TheApplication().Trace("END GetLinteItemProdData method" );
TheApplication().TraceOff();
}
}