Check Schema Service (com.ibi.agents.XDCheckSchema)

Syntax:

com.ibi.agents.XDCheckSchema

iIT Service Object:

Check Document Payload Against External Schema

Description:

The Check Schema service evaluates an input document against a specified schema. The schema can be JSON or XML, depending on the format of the input document being validated. In scenarios where a schema represents an agreement between the sender of a document and the receiver (for example, iWay Service Manager), schema checking is important for debugging purposes. It has lesser importance during actual production. However, this is ultimately an application design decision.

Note: Checking a schema can consume system resources and processing time. As a result, it is not recommended during operation in production environments.

Parameters:

The following table lists and describes the configuration parameters for the Check Schema service.

Parameter

Description

Schema File

The source of the schema to be applied to the incoming document. You can specify a file path directly in this field, or select one of the following values from the drop-down list:

  • route {$route}. A schema published to the selected route that is currently managing the channel.
  • start node {$start}. A schema specified on the Start object of the process flow.

Schema Name

If the schema is packaged in a .zip archive file, which is specified in the Schema File field, then the name of the schema file (for example, xyz.xsd) must be provided.

Strictness *

Determines the level of schema testing that should be applied. Select one of the following values from the drop-down list:

  • strict (default). The document must validate. Failure to validate results in a fail_parse result.
  • optional. If the schema is located, then the document must validate. If the schema cannot be located, then the document validation is ignored.

Is Target Namespace Enabled

  • false (default). There is no namespace to apply.
  • true. There is a namespace to apply.

Target Namespace Location

Target Namespace location. This property is mandatory if the preceeding property is set to true.

When

When to perform this operation.

  • Always (default) at each execution.
  • On debug, when running in debug mode.

Edges:

The following table lists and describes the edges that are returned by the Check Schema service.

Edge

Description

success

Successful.

fail_parse

The schema could not be parsed or the document failed the schema check.

fail_missingschema

The schema could not be found.

fail_format

The format of the input document was not compatible (for example, not in XML format).

fail_schema

The schema validation failed. The document payload is invalid against the specified schema.

fail_operation

The input schema type (based on the file extension) is not supported.

Example:

In this example, an absolute path to a schema is specified for the Schema File property.

Instead of providing an absolute path to the schema, you can also specify the location of a .zip archive file where the schema is packaged. In this case, you must also provide a value for the Schema Name property, which will direct this service to the root schema in the .zip archive file. For example:

You can also select route or start node from the Schema File drop-down list. If route is selected, then the schema is retrieved from the route that is currently managing the channel. If start node is selected, then the schema is retrieved from the process flow Start object, as shown in the following image.

When the process flow is executed, the input file is validated against the specified schema and an appropriate output document is generated.