.SEMREFS Section

The .SEMREFS section lists all semantic rules in the SEF file, each showing the semantic object that it is attached to.  The semantic objects can be a data segment, composite element or data element that are used within the context of an ASC/X12 Transaction Set or UN/EDIFACT Message.  The state of these semantic objects can dynamically change depending on how the semantic rule that is attached to the object is satisfied.

For an example in ASC/X12, if the following semantic rule states:

if element 309 in segment TAX at 070 is equal to "M" then segment CTP at 090 must be used

The semantic object that is affected by the semantic rule is clearly "segment CTP at 090".  The semantic object  is attached to the semantic rule and, regardless of what the default state is of the semantic object, if the condition "element 309 in segment TAX at 070 is equal to M" is satisfied then the semantic object "segment CTP at 090" inherits the state "must be used".

In the .SEMREFS section, the semantic rule may be represented as follows:

850/8///=[TaxVar'EQ'M:USAGE:0:]

Where:

 

The Semantic Rule Syntax

The syntax of the semantic rule consists of:

  1. A condition clause statement.
  2. An action statement.

The form of the entire semantic rule syntax:

 

The Conditional Clause

The conditional clause is made up of a series of logical statements, the result, if true, would invoke the action statement.   A single logical statement follows the syntax:

logical statement := <Object Variable> <Operator> <Literal Value>

Where:

Using the example above, the following condition of the semantic rule states that the value referenced by the object variable "TaxVar" is equal to the literal value "M".

TaxVar'EQ'M

Where:

 

Multiple Conditional Clause

If multiple logical statements are required in the conditional clause then they are separated by the "&" or "|" boolean type operator for "AND" or "OR" respectively.

<conditional clause> := <logical statement> [ "&" | "|" <conditional clause>]

For example,

TaxVar'EQ'M|CurVar'EQ'U&RefVar'NE'ABC

which means: TaxVar is equal to "M" OR CurVar is equal to "U" AND RefVar is not equal to "ABC".  In a semantic rule, the conditional clause always precedes the action statement.

TaxVar'EQ'M|CurVar'EQ'U&RefVar'NE'ABC:USAGE:0:

 

The Action Statement

The action statement indicates what action to take if the result of the conditional clause is true.  Currently, only the following types of actions are possible:

For USAGE, LOCALCODE or APPVALUE, the type must be specified followed by the setting:

<type> ":" <setting> ":"

Example,

USAGE:0:

LOCALCODE:2:

APPVALUE:DUNS:

Note:  There must be a trailing colon (":").

For COMEXIT, the program name is the program identifier of the interface and the method name to execute, followed by any parameters.

"COMEXIT" ":" <program name> ":" <parameters>

Example,

COMEXIT:FrediTester.Sample.Test:1,2,3,ABC

Where: