-
Bug
-
Resolution: Unresolved
-
Minor
-
jBPM 4.2, jBPM 4.3
When I deploy an invalid JPDL file (take a valid file, add <abc/> at some random location, voila) through the RepositoryService, the deployment succeeds. I can see that the validation error is reported internally, but an exception is not thrown.
It is also not possible for the caller to determine that there was a validation error, unless the caller is willing to cast NewDeployment to DeploymentImpl and invoke the methods from the ProblemList superclass.
The thing is, DeployerManager (line 49, jbpm 4.3) checks that there haven't been any errors using ProblemList#hasErrors(). And ProblemList#hasErrors() returns true if there is at least one problem with severity ProblemImpl.TYPE_ERROR. However, validation errors are reported with severity ProblemImpl.TYPE_XML_VALIDATION_ERROR.
Of course I don't know the reasons why the developer of this code choose this implementation, but to me it seems that this was an oversight and the hasErrors() should have checked for TYPE_XML_VALIDATION_ERROR as well.
I haven't had a chance yet to see how a process definition with an invalid jpdl file functions in practice, but it doesn't seem right that you can deploy an incorrect process definition.
And if it was right, for some reason, then I think the caller should have a chance to find out, so in that case the interface NewDeployment could be extended with methods to retrieve any problems during deployment.