EBIFour.com > Training > Clarify Tips > Cleo Clarify Ruleset Actions M Thru Z

Cleo Clarify Ruleset Actions M Thru Z

23rd February 2017

Cleo Clarify users that interface with rulesets are commonly looking for a definition of the actions. From Cleo Clarify’s on-line help, below are the Clarify 4.6+ actions from M to Z.

Cleo Clarify A thru E actions can be FOUND HERE.

Cleo Clarify F thru L actions can be FOUND HERE.

Matches

Definition: Returns true if the text matches the specified regular expression

Input Properties:

  • Pattern: Regular expression
  • Text

Max

Definition: Returns the maximum number of two numbers (Number1 and Number2). For example: Max: [Number1=4, Number2=3] → [Returns] =4.

Input Properties:

  • Number1: The first number
  • Number2: The second number

Min

Definition: Compares two numbers (Number1 and Number2) and returns the lowest (minimum) number.

Move

Definition: Moves data from source to target

Move and the new Transformation Engine

As part of the evolving engine, improved Move rule functionality reduces the need for manual manipulation of your data during transformation by better inspecting and adhering to source and target Schemas. It is more consistent when reading and writing data; whether moving source data into a Ruleset variable, or directly to target, the Move rule respects the data type and other properties set in the Schema.

Trimming and padding of non-essential characters such as zeros and white spaces

Move automatically executes certain trimming, padding, and spacing behavior when moving data. This can be especially helpful when transforming fixed-length Flat Files. For example:

A field in your Flat File Schema has a starting position of “1” with a Length of “10”. The actual data being moved is “xxxxxxxabc”. (“x” represents 7 empty spaces in front of the data). In the old engine, you would need to use the Move Trim rule to handle these spaces. The new Move recognizes these spaces and automatically removes them for you. The target value in this case is “abc”.

Formatting implied decimals in both source and target data

Move also formats implied decimals with less manual intervention. The decimal position is defined in either the source or target Schema for the particular syntax category (Flat File, EDI, or Database, etc). For example:

  • For Fixed-length Flat Files, the Move rule uses the Flat File Schema properties Length and Fractional Digits when reading from and writing to implied decimals.
  • For delimited Flat Files, Move uses the Flat File Schema property Fractional Digits to read implied decimals.
  • When writing implied decimals, Move uses Fractional Digits and Total Digits.
  • For target, when the length of data is less than Total Digits, the engine automatically pads the output with zeros. However when data length is greater than Total Digits, an exception will be thrown.
  • For EDI (X12), the Move rule uses the EDI Schema settings Min Length and Max Length for implied decimals in source and target. Source numeric data values not containing a decimal will have the decimal point added at the implied position. Target numeric values containing decimal positions equal to the implied value have their decimals removed.
  • For Database, the Move rule uses the Database Schema property Fractional Digits and Length when working with ImpliedDecimal JDBC type. Values that contain commas (,) or brackets ([]) will not conflict with keywords and delimiters. The engine removes trailing NULL values at the end of the record.

Converting dates into the new DateTime data type

Move now automatically converts a date into the new DateTime data type. It is also capable of reading dates with values not well-formed.

Better error messages provided when moving incompatible data types or violating other Schema properties.

Below are some examples of error messages that may appear when the engine prevents data from being moved.

Errors:

  • String exceeds maxLength in target: InvalidDataFormatException: Length of value ‘ABCDEFGHIJ’ is greater than max length '9’ specified in the field 'StringLength10_Max9’
  • String exceeds maxLength in target: InvalidDataFormatException: Length of value 'ABCDEFGHIJ’ is greater than max length '9’ specified in the field 'StringLength10_Max9’
  • String exceeds maxLength in target: InvalidDataFormatException: Length of value 'ABCDEFGHIJ’ is greater than max length '9’ specified in the field 'StringLength10_Max9’

Multiply

Definition: Multiplies two values (Factor1 and Factor2) and returns a numeric result.

Input Properties:

  • Factor1: First Value
  • Factor2: Second Value
  • RoundingDecimalPositions: Rounds the result of “Half Up” if roundingDecimalPosition is not null and >=0.

Negate

Definition: Returns the negated value of a number.

Input Properties:

  • Factor1: The number to be negated.
  • RoundingDecimalPositions: Rounds the result “Half Up” if roundingDecimalPositions is mot null and >=0.  If null then returns Factor1.

Normalize

Definition: Returns a new String replacing all multiple occurrences of white space with a single occurrence. It also trims the original text.

Not

Definition: Changes a Boolean value from false to true, or true to false.

  • If Boolean is null, then returns False
  • If Boolean is false, then returns True
  • If Boolean is True, then returns False

NotStartsWith

Definition: Returns Boolean of false if text starts with prefix, otherwise returns true.  If both strings are null returns false.

Input Properties:

  • text
  • prefix

NumberEquals

Definition: Returns boolean result of true two numbers are equal (or both are null).

NumberOfMatches

Definition: Returns a number.

Input Properties:

  • Pattern: Regular expression. If null, then returns null.
  • Text: If null, then returns null.

NumberNotequals

Definition: Returns boolean result of false when two numbers are equal (or both are null).

NumberToString

Definition: Takes a number from source and converts it to a string so that automatic trimming of leading zeros is prevented

Input Properties:

  • Number: the source number to be grabbed.
  • PaddingDigits: The total number of digits expected in output. (For example: the source value needs to be padded in the output to be “000001”. In this case “6” would be the paddingDigits.
  • CountSign: Count or not count the minus sign. Default is true.

Or

Definition: Checks whether properties are True, and returns Boolean

  • Returns False only when all are parameters are false.
  • If all values are null then returns null.
  • Returns the Boolean result Or for all non null Booleans

RawMove

Definition: RawMove transfers data at face value. Unlike Move, it does not facilitate automatic trimming/padding/spacing behavior.

Raw move gets around the new move rule’s automatic formatting by moving data literally and regardless of Schema settings. It allows you to retain data intact as it is moved; it can prove helpful when default Move rule formatting is not the desired result.

In this example, the underscore represents empty spaces. RawMove()[_ _ _ _ xyz] -> [_ _ _ _ xyz]

Here the four empty spaces have moved and are intact. Compared to…

Move()[_ _ _ _xyx] -> [xyz] 

Note now that the four empty spaced were trimmed when moving to target.

If you are accustomed to the functionality associated with the Move rule for the older transformation engine (in the version 1 Ruleset ), the RawMove can be used instead of Move.

Remainder

Definition: Returns the remainder of a division.

Input Properties:

  • Addend1: Dividend
  • Addend2: Divisor
  • RoundingDecimalPositions: Rounds the result “Half Up” if property is not null and >=0. If null then returns value.

ReplaceAll

Definition: Replaces occurences of str in text and returns a new string.

Input Properties:

  • Text
  • Str
  • Replacement

RestoreContext

Definition: A context is used to pass RDO and ENV variables between a Business Process and a Ruleset, or to backup and restore the data within the Ruleset. Restore is the way to update the variables and the RDO in the Ruleset with the data that is in the Storage Node. This Action is used in conjunction with the AssembleContext action.

RetrieveScriptIDFromRoute

Definition: Used in conjunction with the ExecuteMessageBusinessProcess and ExecuteRouteBusinessProcess Actions to return the script ID from a Route.

Split

Definition: Returns a new list of strings after splitting the specified text into sub-strings based on a regular expression.

Input Properties:

  • Pattern: Regular expression
  • String: String to be split.

StringEquals

Definition: Compares two strings for inequality and returns a Boolean.

Input Properties:

  • SourceString1: First string
  • SourceString2: Second string

StringEqualsNormalized

Definition: Returns true if both strings are equal after normalizing them. If both strings are null returns true. If one is null and the other is not returns false.

Input Properties:

  • SourceString1
  • SourceString2

StringEqualsNotNormalized

Definition: Returns Boolean of true if both strings are equal after normalizing them. If both strings are null then returns true. If one is null then returns false.

Input Properties:

  • SourceString1
  • SourceString2

StringNotEquals

Definition: Compares two strings for inequality and returns a Boolean

Input Properties:

  • SourceString1
  • SourceString2

Substring

Definition: Returns a substring of this string. (Used with SubstringReplace)

Input Properties:

  • Text: Returns null if text is null.  Returns an empty string if the text is empty or only has spaces.
  • Start Position: The position index starts a 1.  Defaults to 1 if textStartPosition is null
  • Length: Defaults length to the end of the string if it is null.

Subtract

Definition: Subtracts the first number (subtrahend) from the second number (minuend) and returns a numeric result.

Input Properties:

  • SourceNumber1: Subtrahend (number to be subtracted from another).
  • SourceNumber2: Minuend (number from which another is to be subtracted).
  • RoundingDecimalPositions: Round the result “Half Up” if roundingDecimalPositions is not nill and >=0.  Defaults both numbers to zero if null.

SubtractDateTime

Definition: Subtracts two DateTimes and returns a new DateTime

Input Properties:

  • Minuend: The DateTime from which another is to be subtracted
  • Subtrahend: The DateTime to be subtracted from another.

SubtractDateTimeWithFields

Definition: Subtracts the specified values from the DateTime and returns a new DateTime.

Input Properties:

  • DateTime
  • Year
  • MonthOfYear
  • DayOfMonth
  • HourOfDay
  • MinuteOfHour
  • SecondOfMinute

SubstringReplace

Definition: Replaces a substring within a string

Input Properties:

  • Text: Returns null if text is null
  • Text Start Position: The position index starts at 1. Defaults to 1 if textStartPosition is null
  • Text Length: Defaults to the end of the string if the TextLength is null
  • Replacement: Defaults to empty string if replacement is null
  • Replacement Start Position: Defaults to zero if start position is null
  • Replacement Length: Defualts to the remaining length of the replacement if replancementLength is null

ToLowerCase

Definition: Returns a new string after converting all characters to lower case.

ToUpperCase

Definition: Returns a new string after converting all characters to upper case.

Trim

Definition: Returns a new string with leading and trailing spaces removed.

TrimLeft

Definition: Returns a new string with leading spaces removed.

TrimRight

Definition: Returns a new string with trailing spaces removed.


By: on