Code Monkey home page Code Monkey logo

Comments (1)

zubri avatar zubri commented on July 17, 2024

The field gets broken because its content is invalid. And since field 61 in particular does not have any subfield (component) separators (slashes, semicolon, line break) then it is impossible for the parser to recreate the same object you have originally build.

When you build the field instance with new Field61() and you set the internal components individually, each value you provide is store in inner attributes of the class. So far, so good.

However, when you append the field to the message, in the actual message structure the field value is a plain String. For your particular test this becomes:

:61:230510C1,S//dummy

Then, when you retrieve the field from the message, the parser will do a best effort to split the string into field 61 internal components. But if the value has missing or not well-formed content, there is no way to do a proper match.

When you set the values, you should make sure they are compliant with the field specification:

DATE2 [DATE1] 2a [1a] NUMBER <SUB-6> <VAR-SEQU-1>

I suggest you do the test taking into consideration field 61 samples from compliant messages. For example:

081027C858,28NOPT12716219\n1524/6006/TESORO NACIONAL
1001060106D341,34N422NONREF\r\nFURTHER REFERENCE
090227C291553,62NAYG13391140\n1524/6009/TRASPASO AUTOMATICO AL
020626D120000,NCOLABCD//12345
1512290201EDZ0000000002,2222FBNKNONREF
170717D203336,94NTRFR016341554//2395200\n01P

from prowide-core.

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.