Rulesets

A Ruleset is a collection of rules that govern the way Clarify transforms one business document into another.

There are two types of Ruleset in Clarify: Transformation and Data Analysis.

Transformation Ruleset

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.

Note: You cannot express relationships using spreadsheet worksheets or areas. You can only perform an operation involving cells.

Clarify performs data-type checking on the inputs and outputs of all rules to ensure the transformation produces a valid target document. For example, Clarify 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."

Business Use

You must use a Ruleset if you want to transform or analyze data.

For a transformation example, suppose you store your data in a spreadsheet, and your trading partner requires EDI documents. You receive 850 purchase orders and send 810 invoices. You would create two Spreadsheet Schemas (one for 850, one for 810) and two EDI Schemas. You would then create two Rulesets:
  • 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.
Note: If you use identical spreadsheets, just with different data, to send and receive similar 850s and 810s with other trading partners, you could use the same Ruleset for those trading partners as well.

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

Clarify 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.

Process Summary

To use a Ruleset, you must:
  • Define source and target Schemas (Data Analysis Rulesets do not require a target Schema).
    Note: 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. See Schemas for more information.
  • 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.