Please enable JavaScript to view this site.

InterFormNG2 Manual

Navigation: Workflow > Workflow components > Advanced workflow components

Advanced Validation workflow components

Scroll Prev Top Next More

This is the list of advanced validation document workflow components:

 

1.Rule-based validation report to log.

2.Rule-based validation report to text attachment.

3.Rule-based validation report to XML attachment.

4.Rule-based XML validation.

5.Validate XML against XSD.

 

 

In short there are two validation options:

 

Rule-based XML validation

This component can validate an XML document using rules from a Schematron file.

The Schematron file must be uploaded to the library under "validation rules" with the file extension .sch.

The overall result of the validation will be written to the workflow variable "RuleValidationOutcome". If the document was valid, then the value of this variable will be "SUCCESS". When inserting the validation component in the workflow, a "Choice" component is automatically inserted after it. This choice will check the value of the outcome variable. If the validation was successful, then the "when" branch will be selected, if the XML is found to be invalid, then then the "otherwise" branch will be selected.

The detailed result of the validation will be written to the workflow variable "RuleValidationReport" as an XML document in "Schematron Validation Report Language" format.

The following components can be used to further process the report output (typically on the "otherwise" branch of the choice component, as part of the error handling):

 

Rule-Based Validation Report to XML Attachment: The XML report is turned into an attachment, so that it may be included in an e-mail

Rule-Based Validation Report to Text Attachment: The XML report is transformed into a simple plain text attachment, which can then be included in an e-mail.

Rule-Based Validation Report to Log: The validation report is written to the system log with ERROR log level.

 

Performance note: The Schematron files that are used in a workflow will be compiled to XSL when InterFormNG is started (or when the workflow is created). In case of large Schematron files it may take some time before the workflow is fully loaded.

 

An example of rule based, schematron validation is found here.

 

 

 

Validate XML against XSD

This component can validate an XML file against an schema definition (XSD). This component takes XML as input.

The XSD to validate against is selected as an attribute. The XSD can placed in the "transform" folder in the library. An XSD file in the library is allowed to include other XSD files that are also in the library, using relative paths (just like in a normal file system).

The component throws an exception if the validation fails. This exception can be handled by an error workflow.