Assert expression for BT-05(a)-notice (and similar), how should it work? #285
-
Field "BT-05(a)-notice" is on the Procedure level (single value) and an assert clause wants to compare its value with e.g. value of the field "BT-630(d)-Lot" which is on the Lot level (many lots and values available). How do you build validation in this case? If I understand correctly you should compare the field's value with all dates in all lots to find the one which is out of the allowed range. Based on the assert clause I could construct something like the pseudo-code below which seems to be not correct. if (BT-05(a)-notice > BT-131(d)-Lot[0]) then some error. // what about other lots here? or is it expected to have real logic like if (BT-05(a)-notice > BT-131(d)-Lot[0] || BT-05(a)-notice > BT-131(d)-Lot[1] || BT-05(a)-notice > BT-131(d)-Lot[2]) then some error. // compare with all possible lot values Your logic works well with XPath-based validation, true. But I am not building any XPath from the EFX, instead want to have a validation code (Java or C#) able to work with data. There are other similar examples as well. Following is a copy of an assert clause from the fields.json
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
could you answer? |
Beta Was this translation helpful? Give feedback.
-
Hi @eduardsmirnov, Apologies for the delayed reaction to your question. The short answer is: whatever you do with your validation the result should be the same as if you validated using XPath. There are two constraints in the specific assertion. Both should evaluate to true for the assertion to succeed. I hope that helps. |
Beta Was this translation helpful? Give feedback.
Hi @eduardsmirnov,
Apologies for the delayed reaction to your question.
The short answer is: whatever you do with your validation the result should be the same as if you validated using XPath.
There are two constraints in the specific assertion. Both should evaluate to true for the assertion to succeed.
Indeed the second constraint in compares a single value (BT-05(a)-notice) with a set of values (BT-131(d)-Lot). The comparison translates that as "the left operant must be greater than every value in the right operand sequence). Therefore, that's what your validation shoul1d yield.
I hope that helps.
Yannis