Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I use a condition with path greater than 0 the properies all EdiValue paths preciding are left null. #42

Closed
cleftheris opened this issue Apr 13, 2017 · 3 comments
Labels

Comments

@cleftheris
Copy link
Contributor

cleftheris commented Apr 13, 2017

There is an internal read cache that is used to temporarily store the all the already read values as the reader advances to the next tokens inside the file stream (text buffer). This is called the ReadCache and it is reset whenever the serializer reaches the beginning of the next segment.

The current design introduces the following problem: Although the sole purpose of the readcache is to help serializer make search operations (for conditional deserialization) without loosing any values, a loss may occur because we are advancing the reader and not being able to check the contents of the cache. This is exactly what seems to be happening with multiple condition attributes.

@cleftheris cleftheris added the bug label Apr 13, 2017
@cleftheris
Copy link
Contributor Author

cleftheris commented Apr 13, 2017

This continues the discussion with @Nekeniehl from issue #34
An example would be this transmission fragment

IMD++Z01'
IMD++Z10'
IMD++Z14+Z07'

plus the following mapping

 [EdiMessage]
    public class Message_ORDRSP
    {
        [EdiCondition("Z01", Path = "IMD/1/0")]
        [EdiCondition("Z10", Path = "IMD/1/0")]
        public List<IMD> IMD_List { get; set; }

        [EdiCondition("Z01", "Z10", CheckFor = EdiConditionCheckType.NotEqual, Path = "IMD/1/0")]
        public IMD IMD_Other { get; set; }

        /// <summary>
        /// Item Description
        /// </summary>
        [EdiSegment, EdiPath("IMD")]
        public class IMD
        {
            [EdiValue(Path = "IMD/0")]
            public string FieldA { get; set; }

            [EdiValue(Path = "IMD/1")]
            public string FieldB { get; set; }

            [EdiValue(Path = "IMD/2")]
            public string FieldC { get; set; }
        }
    }

results to the correct creating of containers but null property values for FieldA FieldB FieldC because of Condition.Path IMD/1/0 paths IMD/0/0 and IMD/1/0 won't map.

I nailed it and will push a fix today hopefully.

@Nekeniehl
Copy link
Contributor

Thanks for the fix! I will come back to work on Tuesday and see if I manage to retest and pull the POCO. Thanks for your support!

@Nekeniehl
Copy link
Contributor

Tested and working, this also makes work ticket #38. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants