Wednesday, March 11, 2009

Business Rules Engine – Conditions with Count Node

I needed to create a condition in the Business Rule Egine as follows:
If Field PDF is repeated more than 5 times, take the 5th record

So I needed in the conditions to count how many times the PDF field is repeated within the Xml file

I did the vfollowing:

1. Create a new vocabulary

2. Add New Definition
3. Select Xml Document Element or Attribute
4. Enter a Definition name, ex PDFCount
5. Browse for the Xsd file and select the Field
6. Update the XPath Field Value
    a. Add count(./  in front
    b. Add ) at the end
7. Select System.Double as Type
8. Select Perform “Get” operation
9. Enter a display name
10. Click Finish
11. Use the definition name in the Rule Conditions

No comments: