A Ruleset is a collection of rules that govern the way one business document is transformed into another. There are two types of Ruleset: Transformation and Data Analysis.
Transformation Rulesets describe, in a hierarchical format, how source data is used to populate corresponding (but not necessarily analogous) target structures. The syntax of the sources and targets may be the same or different. (For example: flat file to flat file or EDI to XML)
Transformation Rulesets are composed of a set of rules. A rule can express the relationship between larger structures (for example: EDI segments to database rows, or an XML element to a flat file record). A rule can also perform operations (move, add, substring) on lower-level data elements (attributes, fields, columns, or cells). Rules can be set up to execute (or not execute) based on conditions.
Data-type checking takes place on the inputs and outputs of all rules to ensure the transformation produces a valid target document. For example, the transformation engine will make sure the numeric data in a source field can be moved to a numeric field in a target cell.
Transformation Rulesets are compiled and executed by the Transformation Engine as tasks in a Business Process.
Data Analysis Ruleset
Data Analysis Rulesets analyze source data to determine the next step in the data integration process, or to perform a specific action. Typically, this type of Ruleset acts as a data router; as data is analyzed, individual rules are looking for pieces of data and make decisions about what work to perform (such as calling a Business Process or a Web Service).A Data Analysis Ruleset includes rules that group data based on user-specified criteria (trading partner, message ID, etc.), and activate the Business Processes that will handle the sorted data. The passing of Ruleset variable data is called "context point processing." Data Analysis Rulesets require special types of rules to be implemented so that way the Integration Engine can distinguish what data it needs to group on versus what values it needs to match on to complete an outbound process flow. It's easy to confuse regular Ruleset rules with Data Analysis Data Group Rules because much more time is spent within the Studio developing transformation Rulesets. One thing to remember is that every DARS needs the following:
- A Data Group Composite Rule
- The Source parameter should be the record/field you want to group on and should have 'For Each' once the value is assigned
- Data Group Start Rule
- This Rule will be the parent for an area where you move source data to a local variable for route matching
- Data Group End Rule
- This Rule will be the parent for an area where you create a context point that the Integration Engine uses to tie the data grouping steps to the Route's Transformation Ruleset.
- It will also have an Application Interface called so that way the data can be routed against Outbound EDI Routes or Application Routes
You must use a Ruleset if you want to transform or analyze data.
- The incoming Ruleset would use the 850 EDI Schema as the source and the purchase order Spreadsheet Schema as the target. You create rules to move data from EDI elements into spreadsheet cells.
- The outgoing Ruleset would use the invoice Spreadsheet Schema as the source and the 810 EDI Schema as the target. You would create rules to move data from spreadsheet cells into EDI elements.
For an analysis example, suppose you need to send invoices to various trading partners. A Data Analysis Ruleset would include rules that group data into documents, sort which documents belong to the same trading partners, and activate the Business Processes that will transform the data and package the documents for each trading partner.
How the Object Works
The transformation engine relies on the rules in a Ruleset to transform or analyze documents. It uses the format defined in a Schema to create nodes that can be the source(s) or target(s) of each rule.
Each Rule is defined by an Action; the Actions can be one of the Cleo-supplied Actions, or Actions based on user-created objects.
You must create a Rule for each piece of data you want to appear in the target document.
- Define source and target Schemas (Data Analysis Rulesets do not require a target Schema).
It is best to understand how a Schema works before approaching the Ruleset, as you must have a source and (if transforming data) target Schemas created and defined before creating a Ruleset.
- In the Ruleset editor, create and define individual rules to control the transformation or analysis.
- Set any necessary conditions to control if rules execute.
- If using a Flat File Schema, specify its Connectors in the Ruleset Runtime tab.
- Call the Ruleset as a task in a Business Process.