Framework EDI Reference. SEFManager Utility | |
.SEMREFS Section |
This topic:
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 syntax of the semantic rule consists of:
The form of the entire semantic rule syntax:
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:
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 indicates what action to take if the result of the conditional clause is true. Currently, only the following types of actions are possible:
CODE | DESCRIPTION |
0 | Used |
1 | Not Used |
2 | Must Use |
3 | Recommended |
4 | Not Recommended |
Syntax:
<type> ":" <setting> ":"
Where
- <type> is USAGE and,
- <setting> is one of the code specified in the table above: 0,1,2,3,4.
For example (note the trailing colon),
850/8///=TaxVar'EQ'M:USAGE:2:
Which means: if the object variable TaxVar is equal to M then
the segment CTP090 must be used. In this example, the
location 850/8/// points to data segment CTP090.
<type> ":" <setting> ":"
Where
- <type> is LOCALCODE and,
- <setting> is the code set ordinal specifying the list of codes.
For example (note the trailing colon),
850/2///1=TaxVar'EQ'M:LOCALCODE:3:
Which means: if the object variable TaxVar is equal to M
then the data element 353 must use the code set at ordinal 3.
In this example, the location 850/2///1 points to data element
353.
<type> ":" <setting> ":"
Where
- <type> is APPVALUE and,
- <setting> is the name of the value list.
For example (note the trailing colon),
850/47///2=TaxVar'EQ'M:APPVALUE:NAMES:
Which means: if the object variable TaxVar is equal to M
then the data element 93 must use the value list NAMES.
In this example, the location 850/47///2 points to data element
93.
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:
- "COMEXIT" is the exit name for the type.
- "FrediTester.Sample.Test" is the program name, which consists of the program identifier "FrediTester.Sample" and the method name to execute "Test".
- "1,2,3,ABC" is the parameter to pass to the routine.
The value of a semantic object is captured by an object variable that is attached to semantic object. 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 in the conditional expression of the semantic rule. The value determined for each of the semantic object is as follows:
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:
The semantic rule also tests for the existence or non-existence of a semantic object. This is the case when the operator "exists" or "does not exist" is present in the conditional clause of the semantic rule. For example,
if data segment REF04 exists then segment MEA must be used
if data segment SAC07 does not exist then segment FOB is not used
The existence or non-existence of an object is interpreted as follows:
See Also