EDIFACT Integrator - Online Help
EDIFACT Integrator
Questions / Feedback?

EDIFACTReader Configuration

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

EDIREADER Configuration Settings

CrossFieldValidationEnabled:   Enables cross-field validation rules.

If true, cross-field validation rules present in the document schema will be checked. The default value is false. Note, Bots Schema Files do not support syntax rules, therefore CrossFieldValidation rules will never execute for these schemas.

Encoding:   The character encoding to be applied when reading and writing data.

If the data contains non-ASCII characters this setting should be specified so characters are properly preserved. This value should be set to a valid character set such as "UTF-8" or "ISO-8859-1".

HasXPath:   Determines if the specified XPath exists.

This setting can be used to query if an XPath exists before setting XPath. For instance:

Console.WriteLine(edireader.Config("HasXPath=IX/FG/TX/IT1Loop1/[2]"));
ResolveXPathOnSet:   Determines whether or not the XPath is resolved when set.

When true, the component will fully resolve a detailed path when XPath is specified. In this case, the XPath property will contain the XSegment s name as well as the indices when queried after being set.

If this value is set to false, the exact string will be returned when the XPath property is queried from the last time it was set.

For example, the following code will print the string "/[1]/[1]/[1]/[10]" when this value is false, and would print "/IX[1]/FG[1]/TX[1]/IT1Loop1[4]" when this value is true:

reader.XPath = "/[1]/[1]/[1]/[10]";
Console.WriteLine(reader.XPath);

In another example, the following code sample will print "IX/FG/TX/IT1Loop1" when false and would print "/IX[1]/FG[1]/TX[1]/IT1Loop1[1]" when true:

reader.XPath = "IX/FG/TX/IT1Loop1";
Console.WriteLine(reader.XPath);

This is useful in cases where the full XPath including indices is needed for future processing.

ComponentDelimiter:   The delimiter separating components.

After parsing an EDI document, this configuration option will return the delimiter used to separate components within data elements of the EDI document.

This configuration option may be set in the StartInterchange event to specify the delimiter to be used.

ElementDelimiter:   The delimiter character separating data elements.

After parsing an EDI document, this configuration option will return the delimiter used to separate data elements within segments of the EDI document.

This configuration option may be set in the StartInterchange event to specify the delimiter to be used.

SegmentDelimiter:   The delimiter character separating segments within the EDI document.

After parsing an EDI document, this configuration option will return the delimiter used to separate segments within the EDI document.

This configuration option may be set in the StartInterchange event to specify the delimiter to be used.

ReleaseChar:   The character used to escape delimiters within values.

After parsing an EDI document, this configuration option will return the escape character used to escape delimiters within values within the EDI document.

This configuration option may be set in the StartInterchange event to specify the escape character to be used.

PrintSchemas:   Displays the schema defining the structure of the parsed document.

After calling ParseFile this setting may be queried to obtain information about the structure of the parsed document. If the desired XPath is not known this helps determine the structure so that the correct XPath can be built. For instance:

Console.WriteLine(edireader.Config("PrintSchemas"));
Will output text like:
X12_00501_276
  ST[1,1]
  BHT[1,1]
  REF[0,10]
  NM1Loop1[0,99999]
    NM1[1,1]
    N2[0,2]
    N3[0,2]
    N4[0,1]
    REF_2[0,2]
    PER[0,1]
  HLLoop1[1,99999]
    HL[1,1]
    SBR[0,1]
    PAT[0,1]
    DMG[0,1]
    NM1Loop2[0,99999]
    ...
PrintXML:   Displays the structure of the parsed document.

After calling ParseFile this setting may be queried to obtain information about the structure of the parsed document. The parsed data is represented as XML when queried. This shows all parsed data and may be useful for debugging purposes.

UseSchemaId:   Specifies whether to populate the Element Name with the Id or Ref value.

This setting specifies whether the Name is populated with the Id from the schema or with the positional (ref) value like N101. It is only applicable to RSSBus JSON schemas. For instance:

reader.Config("UseSchemaId=true");
reader.XPath = "/IX/FG/TX/N1Loop1[1]/N1";
for (int i = 0; i < reader.XElements.Count; i++)
{ 
  Console.WriteLine(reader.XElements[i].Name + ": " + reader.XElements[i].Value);
}
Will populate the Name with the Id value read from the schema. The above will output a value like:
98: ST
93: BUYSNACKS PORT
66: 9
67: 1223334445

In contrast, if UseSchemaId is False (default) the following Name would be used and the output would look like:


N101: ST
N102: BUYSNACKS PORT
N103: 9
N104: 1223334445

The default value is False. This setting is only applicable when using RSSBus JSON schemas.

StrictSchemaValidation:   Specifies the behavior during schema validation.

This setting specifies what happens when performing schema validation and a validation warning occurs. By default this value is set to 1 (Warn) and the Warning event will fire, but processing will not stop. See the WarnCode parameter list in the Warning event for details about possible validation warnings. Possible values for this setting are:

0 (Ignore) All validation warnings will be ignored. Warning will not fire with warnings.
1 (Warn - default) The Warning event will fire with all validation warnings.
1 (Error) All validation warnings are treated as errors and will cause an exception. Processing will stop immediately.

Base Configuration Settings

GUIAvailable:   Tells the component whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GuiAvailable to false will ensure that the component does not attempt to process external events.

UseBackgroundThread:   Whether threads created by the component are background threads.

If set to True, when the component creates a thread the thread's IsBackground property will be explicitly set to True. By default this setting is False.

UseManagedSecurityAPI:   Tells the component whether or not to use the system security libraries or a managed implementation.

By default the component will use the system security libraries to perform cryptographic functions. This means calls to unmanaged code will be made. In certain environments this is not desirable. To use a completely managed security implementation set this setting to True. Setting this to True tells the component to use the internal managed implementation instead of using the system's security API.

Note that when this value is set the product's system dll is no longer required as a reference, as all unmanaged code is stored in this file.

 
 
Copyright (c) 2018 /n software inc. - All rights reserved.
Build 1.0.6635.0