The Element Transformation and Validation (ETV) step transforms and validates the elements within an XML document as instructed by attributes attached to those elements. For example, the following XML document contains attributes specifying that the maximum length for City is 30 and that values longer than that should be truncated.
<?xml version="1.0" encoding="utf-8"?>
<Sample xmlns:etv="urn:com.workday/etv">
<City etv:truncate="true"
etv:maxLength="30">Llanfairpwllgwyngyllgogerychwyrndrobwyllllantysil
iogogogoch</City>
</Sample>
If this sample document is processed using the ETV step, it will be transformed to the following XML document:
<?xml version="1.0" encoding="utf-8"?>
<Sample>
<City>Llanfairpwllgwyngyllgogerychwy</City>
</Sample>
Note that the value has been truncated to thirty characters and that the etv attributes are removed as part of the transformation.
The ETV step also supports a number of validation rules. For example, in this sample message the etv:required attribute indicates that the Social_Security_Number element is required to have a value.
<?xml version="1.0" encoding="utf-8"?>
<Sample xmlns:etv="urn:com.workday/etv">
<Social_Security_Number etv:required="true">
</Social_Security_Number>
</Sample>
This sample doesn’t contain any attributes that will transform the contents of the document, so if this sample document is processed using the ETV step, the resulting document will simply have the ETV attributes removed.
<?xml version="1.0" encoding="utf-8"?>
<Sample>
<Social_Security_Number></Social_Security_Number>
</Sample>
In addition to this, the following error message will be generated. Such error messages can be reported on the integration event or in audit files.
No value is available for Social Security Number. Social Security Number is a required field.