EBIFour.com > Training > Clarify QRGs > Using Clarify Methods to Repeat Logic in a Ruleset

Using Clarify Methods to Repeat Logic in a Ruleset

15th July 2021

In Cleo Clarify Rulesets (Version 2), users are able to create Methods to repeat logic multiple times, but only code once for it.

In our example below we have a Clarify Ruleset that we need to remove control characters that might cause problems when we import the data, into our database

In our example we will use the Clarify ReplaceAll task to remove the following characters

unicode - decimal - description
\u0009 - 09 - horizontal tab
\u0011 - 17 - device control 1
\u0026 - 38 - ampersand
\u00a0 - 0160 - non breaking space
\u00c2 - 0194 - Latin Capital letter A with circumflex
\u00bf - 0191 - Inverted Question Mark
\u00ae - 0174 - Registered sign
\u0021 - 33 - Exclamation mark
\u002a - 42 - Asterisk
\u003c - 60 - Less-than sign
\u003e - 62 - Greater-than sign
\u002c - 44 - Comma
\u003f - 63 - Question mark

STEP 1: Set-up Ruleset Rules

In our ruleset, we will create 2 variables

  • vInput
  • vOutput

With these 2 Ruleset variables we perform the following:

  • pass our alpha data into vInput
  • Call textClean
  • pass vOutput to the Target field: ItemDescription
Cleo Clarify Ruleset ruleset screenshot


STEP 2: Calling the Ruleset Method

In our ruleset screenshot (above), we are calling the method. In the exampple, we will be calling the Parent record group.

When we originally set-up the Ruleset Method, we defined the Record Group, as the trigger for the method.


Cleo Clarify Ruleset call textClean Method screenshot

STEP 3: Method Access

To create/access the Ruleset Method, we will choose the Methods tab.

Cleo Clarify Ruleset ruleset Methods Tab  screenshot


STEP 4: Create/Access Method

The Ruleset Method can be created below.

When creating the Ruleset Method, we will need to define a trigger. In our example we used the parent record group

Cleo Clarify Ruleset TextClean Method Set-up  screenshot


STEP 5: Ruleset Method Rules

Once we access the Ruleset Method

Cleo Clarify Ruleset Defining method rules screenshot


STEP 6: ReplaceAll Rule

In the ReplaceAll Ruleset rule, we pass-in the vInput variable (from Step 1) and output the resultant to the vOutput variable (from Step 2).

Cleo Clarify Ruleset ReplaceAll rule screenshot


In Conclusion:

The Cleo Clarify Ruleset Method can look intimidating, and nuanced, at 1st, however they can be a great time-saver when implemented.

Our team at the Sean Hoppe Consulting Group, can assist end-users with setting up their implementation.


By: on