Page tree

Like XML files, CSV files can be used to pass information to Prinergy RBA. If you have not already read about using XML with RBA, you should read about that first before reading this section. The concept and implementation are very similar, so only the differences are documented here.
As with XML files, you must define and import a schema for each type of CSV file you wish to read from RBA. Unlike XML schemas however, there is a predetermined structure that the CSV schema files must conform to. A schema for a CSV file should have one element named table which is a complexType containing an unbounded sequence of complexType elements named row, each containing a sequence of elements for the columns in order.

For example, here is a schema that defines a CSV file containing four columns: Job, Group, Server, and Share.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="table">
<xs:complexType>
<xs:sequence>
<xs:element name="row" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Job" type="xs:string"/>
<xs:element name="Group" type="xs:string"/>
<xs:element name="Server" type="xs:string"/
>
<xs:element name="Share" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>



The CSV schema file is imported into the RBA XML Schema Manager the same way that an XML Schema is imported.

  • To add a new schema, in Rule Set Manager, from the Tools menu, select RBA XML Schema Manager.

Once the schema has been imported to RBA XML Schema Manager, you can use a Read CSV action in a rule set to read the contents of a CSV file. The imported XML schema file should be specified as the action's Schema Name parameter. The CSV file to be read should be specified as the action's File parameter. The action will raise the CSV Parsed OK event when the file has been successfully read. To iterate over the rows in the CSV file, apply a Split action to the row objects in the event's CSV Data property. Each row object will have one property value from each column contained in the CSV file. The value of those row properties can then be used as parameters to subsequent actions.

  • No labels