Formula - Matches With

startsWith & endsWith :

The names are self explanatory ,both are used to check if a certain text matches our expression.content parameter is flexible as well , could be like "body/context(key)" or any Formula plugin function

startsWith

Description:

The core functionality of startsWith( ) is to check if text(string) starts with a specific letter or word. the result is true if it matches otherwise return nothing.

Syntax

On the Message Body :

startsWith('Expression',body)

On the Message Context :

startsWith('Expression',context('MessageContextKey'))

Some operations on the Message Body :

1.Simple startsWith( ) content parameter

Example: if "GMT" is the body content , and 'T' is the Expression(match Expression), the result will be "true". 

Test Expression

e.g. startsWith('G',body)

startsWith


2.Nested regex( ) as content parameter

Example: Regex function used as content parameter of startsWith function to check if certain text matches our expression.In the example below the expression to check is "U" and the content parameter is regex function(Formula specification) applied to a certain text(body) , the text is "GMT UTC", the unique result wil be "True". 

Test Expression

e.g. startsWith('U,regex('GMT|UTC',body))

startsWith_Regex

Some operations on the Message Context :

1.Simple startsWith content parameter

Example: if "GMT" is the Message context value and the key is "id" , the result will be "true" where the expression is "G". 	

Test Expression

e.g. startsWith('G',context('id'))

Simple startsWith_MessageContext


2.Nested regex( ) as content parameter

Example: Regex function could be used as a content parameter of startsWith function to extract the desired content from the context value(Using any valid Regular Expression on keys)and check if the expression parameter matches with specific text.

Test Expression

e.g. startsWith('U',context(regex('id.*')))

_startsWithMessageContext_Regex


endsWith

Description

endsWith( ) function is identical to startsWith function. However , endsWith is used to check if the end of text(string) is matches the provided expression.

Syntax

On the Message Body :

endsWith(body)

On the Message Context :

endsWith(context('MessageContextKey'))

Some operations on the Message Body and Message Context :

Resemble the implementation of endsWith( ) , same syntax and same content parameter structure.


equal & notEqual :

Simple, powerful functions used to evaluate a specific given text(string) against a body content text.   

equal

Description:

equal('Expression',Content) , used to check whether two text(string) are equal or not, this function return true when both strings are matches 100%.

Syntax

On the Message Body :

equal('Expression',body)

On the Message Context :

equal('Expression',context('MessageContextKey'))

Some operations on the Message Body :

1.Simple equal content parameter

Example: if "GMT" is the body content , and 'GMT' is the Expression, the result will be "true". 

Test Expression

e.g. equal('GMT',body)

equal_simpleParameter


2.Nested regex( ) as content parameter.

Example: Regex function has been used as a content parameter for equal function to check if certain text equal the given expression.In the example below the expression to check is "UTC" and the content parameter is regex function(Formula specification) applied on a certain text(body) , the body text is "GMT UTC", the  result wil be "true" as we have used "|" which means OR in regular expression syntax. 

Test Expression

e.g. equal('UTC',regex('GMT|UTC',body))

equal_nested_body

Some operations On the Message Context :

1.Simple equal content parameter

Example: if "GMT" is the Message context value and the key is "id" , the result will be "true" where the expression is "GMT". 	

Test Expression

e.g. equal('GMT', context('id'))

Simple equal_MessageContext


2.Nested regex( ) as content parameter.

Example: Regex function could be used as a Content parameter of equal function to extract the desired content from the context value(Using any valid Regular Expression on keys),then check if the expression parameter equal the extracted text. In the test expression below we have two keys "id" and "id2" with two different values "GMT" and "UTC" respectively , we have applied regex function on both keys to get their values in order to check if its equal the given expression "UTC". it returns true when it matches and nothing when it doesn't. 

Test Expression

e.g. equal('UTC',context(regex('id.*')))

NestedEqual_MessageContext_Regex


notEqual

Description:

notEqual('Expression',Content) , used to check if two strings (text) are different.

Syntax

On the Message Body :

notEqual('Expression', body)

On the Message Context :

notEqual('Expression',context('MessageContextKey'))

Some operations On the Message Body and Message Context :

Resemble the implementation of equal( ) , same syntax and same body parameters structure.