Giter Club home page Giter Club logo

Comments (10)

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos, thanks for the report. I'll be looking into this shortly.

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos - when the TOO_MANY_DATA_ELEMENTS error occurs, can you confirm that the segment involved is the SRC?

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

After doing some additional research on this issue, I believe that your configuration that includes the following schema type should work. At this point, I suspect that there is some other data error in the input file you are processing that is causing the ELEMENT_OCCURRENCE_ERROR.

<segmentType name="SRC">
  <sequence />
</segmentType>

from staedi.

benisantos avatar benisantos commented on August 13, 2024

Hi @MikeEdgar and thank you for your time. I attach a simple test with the TOO_MANY_DATA_ELEMENTS failure.

validation-test.zip

The test fails with:
java.lang.AssertionError: ELEMENT_OCCURRENCE_ERROR: TOO_MANY_DATA_ELEMENTS (seg=SRC, elemPos=1, compoPos=-1, textOnError=null)

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos , thank you for the example. I will be providing a fix for the issues you flagged with TODO comments as well in your test case related to the UNA segment.

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos, the reason you are seeing an issue with the validation of the IATA in UNB element 1, component 1 and PNRGOV in the UNH is because the internal control schema is based on the ISO control segments which do not include those values. Are you aware of any publications by IATA that would define the valid values for IATA's message types?

The use of IATA in the UNB seems to be in conflict with the guidelines here (https://www.gefeg.com/jswg/cl/v4x/40200/cl1.htm), but I understand that the PDF linked in #10 requires that code value and it should be supported somehow.

from staedi.

benisantos avatar benisantos commented on August 13, 2024

@MikeEdgar "Are you aware of any publications by IATA that would define the valid values for IATA's message types?"

  • No, sorry. I'm only aware of "PNRGOV" and "ACKRES" msg types :(

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos , the following code sample is a way you might be able to "ignore" the code values in the UNB and UNH segments. You could alternatively use an EDIStreamFilter to ignore them and keep your main logic cleaner. I have identified the issues with TOO_MANY_DATA_ELEMENTS and SEGMENT_NOT_IN_DEFINED_TRANSACTION_SET for UNA and will have a new release published soon, hopefully today.

case ELEMENT_DATA_ERROR:
    // TODO Change "control schema", because it does not recognise "IATA" (UNB), "PNRGOV:11" (UNH)
    if ("DE0001".equals(reader.getReferenceCode()) && "IATA".equals(reader.getText())) {
        break;
    }
    if ("DE0065".equals(reader.getReferenceCode()) && "PNRGOV".equals(reader.getText())) {
        break;
    }
    if ("DE0052".equals(reader.getReferenceCode())) {
        break;
    }
    // Handle the error

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos - the fix for the two issues here has been release and is now available in version 1.4.0.

<dependency>
  <groupId>io.xlate</groupId>
  <artifactId>staedi</artifactId>
  <version>1.4.0</version>
</dependency>

from staedi.

benisantos avatar benisantos commented on August 13, 2024

Thank you so much @MikeEdgar

from staedi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.