Giter Club home page Giter Club logo

Comments (12)

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos - this is supported using "implementation" schemas. Take a look at the Validation page on the wiki. Basically, you define the transaction schema as the base standard, then you customize the segments using <implementation>. If it ends up being too large, you can always defined the implementation in a separate file and include the other schema that defines the transaction and all the segment and element types.

That example in the wiki is very basic (just a single segment), but the idea applies to both segments and loops. Let me know if you have further questions. The example could probably be a bit more complex.

from staedi.

benisantos avatar benisantos commented on August 13, 2024

I'm taking a look at src/test/resources, but I have a doubt:

  • There are examples of reusing a transaction segment in the implementation without changes. For instance:
  <segment type="AK2">
    <!-- Unchanged from standard -->
  </segment>
  • But I don't find an example of reuse a full loop in the same way. Is supported something like that on an implementation?
  <loop code="foo" type="bar">
    <!-- Unchanged from standard -->
  </loop>

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos - that is not supported. Typically, implementations of a loop will reduce the occurrences of segments or remove them altogether, so I don't think there would really be a case for using the loop as-is. In the case of PNRGOV, the document you linked is the implementation guide. I have not been able to locate the standard definition, but I believe it would likely be a more general description of the message. For example, all references to TVL would be identical. It's only in the implementation guide where the different TVL requirements are specified.

Do you know if the PNRGOV standard is available anywhere?

from staedi.

benisantos avatar benisantos commented on August 13, 2024

@MikeEdgar I don't know any standard documentation like you suggest :(
I'll try your transaction-vs-implementation advice as soon as I can.
Anyway, Thank you for your help!

from staedi.

benisantos avatar benisantos commented on August 13, 2024

@MikeEdgar I think I found an error related to transaction-vs-implementation schemas and empty segments (like SRC in PNRGOV), when the empty segment is the first element of the loop (in other positions works perfectly).

If I change the transaction and implementation schemas to remove SRC and remove as well from the EDIFACT file, the validation is OK. Same, if I put SRC as second or third position of the loop. But in first position, the validation process fails.

Could you realize where the problem is? Or do you need a failed test to help you?

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos , I will take a look later today, but a test case would definitely be appreciated!

from staedi.

benisantos avatar benisantos commented on August 13, 2024

@MikeEdgar I have created a custom issue (#79) for the problem with empty segments starting loops. And I have attached a failed test case :)

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos - how are things going with your implementation using the PNRGOV guide? I wanted to check if there is anything still needed on this issue.

from staedi.

benisantos avatar benisantos commented on August 13, 2024

Sorry @MikeEdgar , I'm busy with other business now :( I'll go back to this issue as soon as I can.

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

Hi @benisantos - I just wanted to follow up on this one to see if you were able to solve your schema issue.

from staedi.

benisantos avatar benisantos commented on August 13, 2024

Hi @MikeEdgar ! Yes, the schema issue was solved with the advice of question #104. This question could be closed :)

And thank you for this awesome lib!

from staedi.

MikeEdgar avatar MikeEdgar commented on August 13, 2024

@benisantos , thank you, glad to hear that!

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.