-
Hello, I am encountering an issue with the calculation of forbidden/mandatory fields when the context is empty. Example:In the case of Subtype-29 (SDK 1.12), for instance, if I take the variable Which is translated into XPath as: {
"context": "/*/cac:ProcurementProject/cac:RealizedLocation/cac:Address",
"condition": "cbc:CountrySubentityCode"
} However, in my case, the context is empty, and I don't have the element The XML file is complete and corresponds to the file Observations:I published the notice on the preview, and when I try to extract the HTTP response from {
"fieldId": "BT-727-Procedure",
"label": "field|name|BT-727-Procedure",
"displayType": "COMBOBOX",
"dataType": "code",
"constraints": {
"forbidden": {
"expression": "false", // Here the expression is "false"
"severity": "ERROR"
}
},
"value": {
"codeList": "other-place-service",
"code": null
},
"empty": true
} Question:How is the forbidden condition calculated in this scenario? Thank you in advance for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Example 2:Similarly, for the variable This is translated into XPath as: {
"context": "/*/cac:ProcurementProject/cac:RealizedLocation/cac:Address",
"condition": "not(cbc:CityName)"
} In this case, the context is again empty. However, the HTTP response ( {
"fieldId": "BT-5101(a)-Procedure",
"label": "field|name|BT-5101(a)-Procedure",
"displayType": "TEXTAREA",
"dataType": "text",
"constraints": {
"maxLength": {
"expression": "400",
"severity": "ERROR"
},
"forbidden": {
"expression": "true", // Here the expression is "true"
"severity": "ERROR"
}
},
"empty": true
} Thank you in advance for your help! |
Beta Was this translation helpful? Give feedback.
-
Hi @skyazid,
Yes, eNotices is not applying the condition against the final XML but on the JSON structure used to render the form. It means that for eNotices2, the ND-ProcedurePlacePerformance is existing (because present in the JSON document) and then the condition is applied on the subtree. eNotices2 is implementing the visitor generated using ANTLR based on the grammar provided by the SDK and there is no XPath translation. Sorry to not support you more on this but this project (SDK, EFX..) is under the exclusive responsibility of the SDK team at the moment, so I leave it to them now :) |
Beta Was this translation helpful? Give feedback.
You can find the ANTLR EFX grammar here:
https://github.com/OP-TED/eForms-SDK/tree/develop/efx-grammar
EFX toolkit:
https://github.com/OP-TED/efx-toolkit-java
There is also some SDK documentation about validation here (also see sibling pages):
https://docs.ted.europa.eu/eforms/latest/guide/validation.html
You can use Java along with the EFX toolkit to evaluate EFX expressions on the server side (via your own API).
Get the rules from the SDK fields.json: https://github.com/OP-TED/eForms-SDK/tree/1.13.0/fields
The central validation service (CVS) can be used to evaluate an entire notice: https://docs.ted.europa.eu/eforms/latest/metadata-driven-applications.html
Integrating with CVS is a goo…