So I've spend quit some time with CAM this week to figure out if it was a good fit for our product.
In terms of validation capabilities: it's a 100% match. And there seems to be some bonus features that we never thought of.
However, the errors reporting could be enriched easily I think.
Let me explain…
We're trying to replace our current validation process to enforce our requirements on business documents (invoices, purchase orders, stuff like that…). From the same file (here the CAM template) we'd like to be able to validate documents and create documentation about our requirements. The CAM template provide all that: it's perfect (I miss the inline as:makeMandatory attribute from the OASIS CAM official specification though…).
Our issue is that the error reporting that CAMv generates is in plain english. Sure, we can create our own ErrorHandler but the error still stays in english. It would be great if the ErrorHandler was given the violated rules in parameters.
So, instead of having:
public class NodeValidator{
[...]
private void validateChildNode(Node node, Element xmlNode) throws AttributeException {
[...]
if (elems != null && elems.size() > 1 && !node.isRepeatable()){
errorHandler.addError(xmlNode, Constraint.isNotRepeatable);
}
[...]
}
[...]
}
We'll get something like:
public class NodeValidator{
[...]
private void validateChildNode(Node node, Element xmlNode) throws AttributeException {
[...]
if (elems != null && elems.size() > 1 && !node.isRepeatable()){
errorHandler.addError(xmlNode, node, Constraint.isNotRepeatable);
}
[...]
}
[...]
}
Constraint could be an enumeration with all the kind of rules that can infringed.
Then, the default errorHandler could translate this error in english or easily be overridden to provide an enriched message that would make more sense to the business requirement and the user.
Does this sounds like something that CAMv could be doing one day?
Has anyone tried something like that before?
Thanks for your feedback!
Michel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW - just a sanity check here - assume you have found printMessage() rule, with condition expression, and that you can do WARN: this is a warning, as well as default error checking.
That is generally how I add special condition checking - however I understand your request to allow the normal rules to also have extended capabilities.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
So I've spend quit some time with CAM this week to figure out if it was a good fit for our product.
In terms of validation capabilities: it's a 100% match. And there seems to be some bonus features that we never thought of.
However, the errors reporting could be enriched easily I think.
Let me explain…
We're trying to replace our current validation process to enforce our requirements on business documents (invoices, purchase orders, stuff like that…). From the same file (here the CAM template) we'd like to be able to validate documents and create documentation about our requirements. The CAM template provide all that: it's perfect (I miss the inline as:makeMandatory attribute from the OASIS CAM official specification though…).
Our issue is that the error reporting that CAMv generates is in plain english. Sure, we can create our own ErrorHandler but the error still stays in english. It would be great if the ErrorHandler was given the violated rules in parameters.
So, instead of having:
We'll get something like:
Constraint
could be an enumeration with all the kind of rules that can infringed.Then, the default errorHandler could translate this error in english or easily be overridden to provide an enriched message that would make more sense to the business requirement and the user.
Does this sounds like something that CAMv could be doing one day?
Has anyone tried something like that before?
Thanks for your feedback!
Michel
Michel, excellent suggestion, thanks!
We will take a look into this for next week and share our thoughts back.
I'm also thinking this might tie back into a multi-lingual configuration option similar to how we are doing that for the CAM editor also.
David
BTW - just a sanity check here - assume you have found printMessage() rule, with condition expression, and that you can do WARN: this is a warning, as well as default error checking.
That is generally how I add special condition checking - however I understand your request to allow the normal rules to also have extended capabilities.
David,
Yes, that will definitely be a good thing for localization!
Thanks for pointing out
printMessage()
. This is not enough but could be a temp workaround for us…Again, thanks for your feedback and keep me posted!
Michel