Differences

This shows you the differences between two versions of the page.

adminhelp:appendixa:xwstag [2011/11/22 11:13]
aquandt [See Also]
adminhelp:appendixa:xwstag [2018/06/19 03:27] (current)
mnikolic [XWS Tag]
Line 1: Line 1:
 +====== XWS Tag ======
  
 +XWS tag may have one or more parameters. First parameter is function name. Other parameters are optional and represent parameters passed to the specified function. Beside that it supports several standard functions it is a gateway from configurator to external resources like web services from another systems.
 +
 +**Standard XWS functions**
 +
 +**Candy**
 +<*XWS(Candy)*>
 +Always returns the same constant. 
 +**Parameters**
 +- none
 +**Returns **
 +100
 +
 +**GetProductPrice**
 +<*XWS(GetProductPrice, ProductName)*>
 +Applies current product configuration to the specified product and returns its price. 
 +**Parameters**
 +- ProductName – a name of the product that’s price is queried
 +**Returns **
 +Price of the specified product after current configuration has been applied to it.
 +
 +
 +**GetProductCatCode**
 +<*XWS(GetProductCatCode, ProductName)*>
 +Applies current product configuration to the specified product and returns its catalogue code. 
 +**Parameters**
 +- ProductName – a name of the product that’s catalogue code is queried
 +**Returns **
 +Catalogue code of the specified product after current configuration has been applied to it.
 +
 +
 +**GetProductDescription**
 +<*XWS(GetProductDescription, ProductName)*>
 +Applies current product configuration to the specified product and returns its description. 
 +**Parameters**
 +- ProductName – a name of the product that’s description is queried
 +**Returns **
 +Description of the specified product after current configuration has been applied to it.
 +
 +
 +**Iterate**
 +<*XWS(Iterate, Data, Formula)*>
 +Applies formula expression from the hint of the "Formula" attribute to each part of the comma separated values (CSV) in the value of the "Data" attribute and returns sum of all evaluations.
 +**Parameters**
 +- Data – name of the attribute that in its value contains the data that needs to be iterated
 +- Formula – name of the attribute that in its hint contains the formula that needs to be evaluated on each CSV value from Data attribute. Formula may contain all standard tags and new special tag <nowiki>{{CurrentValue}}</nowiki> that will be replaced by the current iteration value.
 +**Returns **
 +Sum of all evaluated formulas
 +
 +** Example 1** 
 +<*XWS(Iterate, Data, Formula)*>
 +Value of attribute Data is 1,2,3,4,5
 +Hint of attribute Formula is <nowiki>{{CurrentValue}}</nowiki>
 +Will return 15
 +Sum = 0
 +Iteration 1 -       Sum = Sum + 1 = 0 + 1 = 1
 +Iteration 2 -       Sum = Sum + 2 = 1 + 2 = 3
 +Iteration 3 -       Sum = Sum + 3 = 3 + 3 = 6
 +Iteration 4 -       Sum = Sum + 4 = 6 + 4 = 10
 +Iteration 5 -       Sum = Sum + 5 = 10 + 5 = 15
 +
 +**Example 2**
 +<*XWS(Iterate, Data, Formula)*>
 +Value of attribute Data is 1,2,3,4,5
 +Hint of attribute Formula is <*eval(<nowiki>{{CurrentValue}}</nowiki>+1)*>
 +Will return 20
 +Sum = 0
 +Iteration 1 -       Sum = Sum + <*eval(1+1)*> = 0 + 2 = 2
 +Iteration 2 -       Sum = Sum + <*eval(2+1)*> = 2 + 3 = 5
 +Iteration 3 -       Sum = Sum + <*eval(3+1)*> = 5 + 4 = 9
 +Iteration 4 -       Sum = Sum + <*eval(4+1)*> = 9 + 5 = 14
 +Iteration 5 -       Sum = Sum + <*eval(5+1)*> = 14 + 6 = 20
 +
 +**Example 3**
 +<*XWS(Iterate, Data, Formula)*>
 +Value of attribute Data is 09/01/2008,09/03/2008,09/08/2008
 +Hint of attribute Formula is 
 +
 +<*Table(select top 1 Price from Table where StartDate<=‘<nowiki>{{CurrentValue}}</nowiki>’ and EndDate>=‘<nowiki>{{CurrentValue}}</nowiki>’)*>
 +
 +Will return sum of prices for selected dates in Data attribute.
 +===== See Also =====
 +
 +[[appendixd:externalwebservice:upsshipping]]
You are here: CallidusCloud SAP CPQ Online HelpAdmin Page HelpCPQ TagsXWS Tag