Framework EDI Reference. Methods and Properties
ediDocument. WriteTreeHierarchy

Writes out the hierarchy structure of the data segments that makes up the EDI document into an external file.

Syntax:

Parameters:

Returns

Returns 1 if the operation is successful; otherwise the operation returns zero.

Remarks

In the EDI standard, the relationship between the semantic entities have a hierarchical tree structure. The implementation guideline schema represents this tree hierarchy that the EDI document should follow. When FREDI reads the EDI document using the implementation guideline schema specified for the EDI document, it builds the internal structure in the same hierarchical tree structure. The WriteTreeHierarchy exposes this tree structure to the user.

An example of a hierarchical tree structure is shown below for an 850 (Purchase Order) document.

** DOCUMENT

ISA: id=2 (RAM), Use=0, Instance=0, Area=0, Position=0, Repeat=0

GS: id=3 (RAM), Use=0, Instance=0, Area=0, Position=0, Repeat=0

ST: id=4 (RAM), Use=0, Instance=0, Area=1, Position=10, Repeat=0

BEG: id=5 (RAM), Use=0, Instance=0, Area=1, Position=20, Repeat=0

CUR: id=6 (RAM), Use=0, Instance=0, Area=1, Position=40, Repeat=0

REF: id=7 (RAM), Use=0, Instance=0, Area=1, Position=50, Repeat=0

PER: id=8 (RAM), Use=0, Instance=0, Area=1, Position=60, Repeat=0

PER: id=9 (RAM), Use=1, Instance=0, Area=1, Position=60, Repeat=0

FOB: id=10 (RAM), Use=0, Instance=0, Area=1, Position=80, Repeat=0

N1: id=11 (RAM), Use=0, Instance=0, Area=1, Position=310, Repeat=200

N3: id=12 (RAM), Use=0, Instance=0, Area=1, Position=330, Repeat=0

N4: id=13 (RAM), Use=0, Instance=0, Area=1, Position=340, Repeat=0

N1: id=14 (RAM), Use=0, Instance=1, Area=1, Position=310, Repeat=200

N3: id=15 (RAM), Use=0, Instance=1, Area=1, Position=330, Repeat=0

N4: id=16 (RAM), Use=0, Instance=1, Area=1, Position=340, Repeat=0

N1: id=17 (RAM), Use=0, Instance=2, Area=1, Position=310, Repeat=200

N3: id=18 (RAM), Use=0, Instance=2, Area=1, Position=330, Repeat=0

N4: id=19 (RAM), Use=0, Instance=2, Area=1, Position=340, Repeat=0

PO1: id=20 (RAM), Use=0, Instance=0, Area=2, Position=10, Repeat=100000

PID: id=21 (RAM), Use=0, Instance=0, Area=2, Position=50, Repeat=1000

QTY: id=22 (RAM), Use=0, Instance=0, Area=2, Position=293, Repeat=99999999

PKG: id=23 (RAM), Use=0, Instance=0, Area=2, Position=305, Repeat=200

SLN: id=24 (RAM), Use=0, Instance=0, Area=2, Position=470, Repeat=1000

CTT: id=25 (RAM), Use=0, Instance=0, Area=3, Position=10, Repeat=1

SE: id=26 (RAM), Use=0, Instance=0, Area=3, Position=30, Repeat=0

GE: id=27 (RAM), Use=0, Instance=0, Area=0, Position=0, Repeat=0

IEA: id=28 (RAM), Use=0, Instance=0, Area=0, Position=0, Repeat=0

Each line represents a data segment in the tree hierarchy, which is also called a node. The indentation represents the data segment as a child of the preceding data segment. Data segments that have the same depth indentation are siblings. Example,

ISA: id=2 (RAM), Use=0, Instance=0, Area=0, Position=0, Repeat=0

GS: id=3 (RAM), Use=0, Instance=0, Area=0, Position=0, Repeat=0

ST: id=4 (RAM), Use=0, Instance=0, Area=1, Position=10, Repeat=0

BEG: id=5 (RAM), Use=0, Instance=0, Area=1, Position=20, Repeat=0

Data segment GS is a child of ISA. ST is a child of GS. BEG is a sibling of ST.

Each line has the following information from left to right: data segment id, internal node id, state of the node, data segment use instance, data segment area/table, position of data segment, and loop repeat. Example,

SLN: id=24 (RAM), Use=0, Instance=0, Area=2, Position=470, Repeat=1000

Data segment id is SLN.

Internal node is 24.

State of the node is RAM, which indicates if this node has been stored to disk or if it is in memory.

Data segment use instance is 0, which indicates that this is the only instance of the data segment used in the same position.

Data segment area/table is 2, which indicates the area/table that this data segment maps to the implementation guideline.

Position of data segment is 470, which indicates the position number of the data segment as it maps to the implementation guideline.

Loop repeat is 1000, which indicates how many times this data segment can trigger the start of a loop.