You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Thank you very much for this helpful library). I am new to EDI tech. Trying to understand the serialization path usage of identical segments with different qualifiers (generating 850 based on X12)
I am following sample from https://github.com/indice-co/EDI.Net/blob/master/test/indice.Edi.Tests/Models/X12_850.cs
As I understand, the REF segment can occur more then once in the EDI structure. Below is simplified problem description :
My goal is to serialize three segments to something like this (each segment has unique qualifier):
REF*A*1~
REF*B*2~
REF*C*3~
Here are examples of corresponding properties (I tried various combinations of Path syntax to better understand them, but still failing)
[EdiMessage]publicclassOrder{[EdiValue(Path ="REF/0", Description ="Should result with REF*A")]publicstringVarIdA{get;set;}[EdiValue(Path ="REF/1", Description ="Should result with REF*A*1~")]publicstringValueA{get;set;}[EdiValue(Path ="REF/0", Description ="Should result with REF*B")]publicstringVarIdB{get;set;}[EdiValue(Path ="REF/1", Description ="Should result with REF*B*2~")]publicstringValueB{get;set;}[EdiValue(Path ="REF/0", Description ="Should result with REF*C")]publicstringVarIdC{get;set;}[EdiValue(Path ="REF/1", Description ="Should result with REF*C*3~")]publicstringValueC{get;set;}}
With my approach I see that all REF0 are parsed first. Then all REF1 are parsed and the first value from REF1 complements the last REF/0.
So, I understand that paths are relational across all properties with identical segments. No matter how I experimented with paths syntax, I was not successful.
Please, help to understand how paths are constructed and evaluated in scenarios with multiple instances of the same segment.
The text was updated successfully, but these errors were encountered:
You need a container class in order to achieve something like this.
Try with a representing the REF segment like this
The order of the properties is taken into account. Also If you need to support de-serialization you will have to decorate the properties with the EdiCondition attribute.
Paths are consisted of three parts like so [The segment name]/[The element index]/[The component index]
In X12 frequently there are almost always single component elements, thus the third part of the path can be ommited since it almost always defaulst to zero 0. This does not mean it is non existent.
Paths can use the wildcard character when livig inside a class so that the same class can be re-used in a different "context" depending on the property EdiPath annotation. For instance this is exceptionally usefull when making use of EdiElement classes.
(Thank you very much for this helpful library). I am new to EDI tech. Trying to understand the serialization path usage of identical segments with different qualifiers (generating 850 based on X12)
I am following sample from https://github.com/indice-co/EDI.Net/blob/master/test/indice.Edi.Tests/Models/X12_850.cs
As I understand, the REF segment can occur more then once in the EDI structure. Below is simplified problem description :
My goal is to serialize three segments to something like this (each segment has unique qualifier):
REF*A*1~
REF*B*2~
REF*C*3~
Here are examples of corresponding properties (I tried various combinations of Path syntax to better understand them, but still failing)
Where assigned values are
VarIdA = "A";
ValueA = "1";
VarIdB = "B";
ValueB = "2";
VarIdC = "C";
ValueC = "3";
The resulting EDI is not what I wanted:
…
REF*A~
REF*B~
REF*C*1~
REF**2~
REF**3~
…
With my approach I see that all REF0 are parsed first. Then all REF1 are parsed and the first value from REF1 complements the last REF/0.
So, I understand that paths are relational across all properties with identical segments. No matter how I experimented with paths syntax, I was not successful.
Please, help to understand how paths are constructed and evaluated in scenarios with multiple instances of the same segment.
The text was updated successfully, but these errors were encountered: