I'm having a look at how to implement this in the Web UI and I'm starting to think this is something that should be handled mainly by the framework.
The way it's currently specified, the client has to check the contents of an output port to know whether or not the validation succeeded. However, when the client has access to the filesystem and chooses to set its own output directory for an output port (currently local mode), there is no way to get the contents of the output port through the Web API - the client has to remember which output directory it provided to the Web API and inspect the files in that directory (after having determined which port is the validation status port by checking the script XML). It's still achievable, but it complicates things for the clients.
Even when the client lets the engine handle the outputs (currently remote mode), which means that the XML can be retrieved through the Web API, it's not available directly through the job status XML. It's a two-step process where the client needs to iterate throught all the result elements and look for a result with the correct mime type; then retrieve that document.
To make things easier for the clients, the framework could provide the validation status directly in the job XML. Some suggestions:
- Introduce a new "FAILED" job status for jobs that succeeds but has a status port signaling a failure (ERROR vs FAILED would be kind of like static vs dynamic errors, or compile-time vs runtime errors)
- Introduce a new attribute or element containing the validation status
- Inline the validation status XML in the result element
What do you think?