ediScmSemanticRule

The ediScmSemanticRule defines a semantic rule.  A semantic rule is a conditional statement that dynamically controls the value or setting of a semantic object based on whether the condition is true or false.  Currently only the following semantic objects can have a semantic rule:

Furthermore, only the following actions can be done as a result of a semantic rule being satisfied.

 

Semantic Rule Syntax

Currently, the conditional statement, that FREDI recognizes, takes the following form:

if <conditional statement> then <action>

Where conditional statement is a string of logical statements that if resolved to being true will execute the action.  For example,

if data element TAX02 is equal to "M" then segment CTP at 0900 is used

The conditional clause itself takes the following form:

<semantic object> <operator> <literal value>

From the example, the clause "data element TAX02" is the semantic object; the clause "is equal to" is the operator; and the literal value is "M".

 

Determining the value.

The semantic object is represented by an object variable referencing an object in the implementation guideline.  The object variable contains a variable name and the location of the object in the implementation guideline.  The value resolved in the object variable is determined by locating the corresponding object in the document and extracting the data.  This value is then used to compare to the literal value.  The value determined for each of the semantic object is as follows:

 

Operators

Currently, only the following operators are recognized:

 

Value Comparisons

When the value in the object variable is compared with the literal value, it either does a string comparison or a numeric comparison.  A string comparison compares the a character in the first value to its corresponding character in the second value in the string starting with the leftmost character.  In a string comparison, the string value "04" is greater than the string value "004".  In a numeric comparison, the numeric value of both string values are compared.  In this case, the value "04" is equal to the value "004".  The inherent nature of data retrieved from the document is always a string, and if a numeric comparison is involved then a string to numeric conversion must takes place.  For a successful numeric conversion, the string must contain only numeric values (0 to 9), but it is possible that a string containing alphabetic character can be involved in the conversion.  If this is the case, starting from the left, a string is converted to a number character by character until a non-numeric character is encountered.  For example, the string "123.1B2" is converted to 123.1; the string "12B3" to 12; the string "B123" to zero; etc.  Note how the alphabet "B" stops the conversion.

The values in the conditional clause are compared depending on the semantic object:

 

Existence and Non-Existence

The semantic rule also tests for the existence or non-existence of a semantic object.  The existence or non-existence of an object is interpreted as follows:

 

Properties