Appendix B: Creating a Semantic Rule Syntax

The following steps demonstrates how to set up a semantic rule in SEFManager from the following statement.

If data element 350 at LIN1800 is equal to "ITEM01" then MEA200 must be used

The statement can be broken down into its conditional clause and action clause:

Following the steps below, the final result of the semantic rule is:

LineItemID'EQ'ITEM01:USAGE:2:

 

Conditional

The conditional clause has a logical statement (data element 350 at LIN1800 is equal to "ITEM01") which must be converted using the following SEF syntax in the semantic rule:

<logical statement> := <object variable> <operator> <literal value>

From which can be determined:

The SEF syntax for the semantic rule then is:

Action

There are only 4 actions that can be done when the conditional clause is true, and are of the following type:

  1. USAGE - Dynamically set the user requirement of a data segment, composite element or data element.
  2. LOCALCODE - Redirect the data element to use a different set of codes.
  3. APPVALUE - Redirect the data element to use a different list of values.
  4. COMEXIT - Run an ActiveX/COM component.  Other exit names are allowed in the SEF standard, but the SEFManager only allows COMEXIT type executable routines, which are ActiveX/COM components only.

From the action statement (MEA200 must be used) the type of modification is USAGE.  The USAGE type can only have the following setting value:

Based on the above list, because this segment "must be used", the setting is determined to be "2".  Therefore, following the SEF syntax:

<setting action> := <type> ":" <setting> ":"

The SEF syntax for the action clause is as follows:

 

Final Result

Finally, following the semantic rule SEF syntax:

  1. <semantic rule> := <conditional clause> ":" <action statement>
  2. <conditional clause> := <logical statement> [ "&" | "|" <conditional clause>]

The entire semantic rule is: