Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Integration Server Built-In Services | Flat File Folder | Summary of Elements in the Flat File Folder | pub.flatFile:FormatService
 
pub.flatFile:FormatService
WmFlatFile. Service that formats the field String in a flat file schema or dictionary and ensures that the value of the String meets the format restrictions of the format service.
Use this specification when you create format services for fields in a flat file schema or dictionary. The format service is invoked for a field when the pub.flatFile:convertToValues and pub.flatFile:convertToString services are invoked. You create a format service to format the field String and ensure that the value of the String meets the format restrictions of the format service. When creating a particular format service for use with the Format Service property in a flat file schema or dictionary, the service you select must implement the pub.flatFile:FormatService specification (located on its Input/Output tab).
Important:
If a particular field does not have a value (that is, a value is not returned in the IS document (IData object) for the pub.flatFile:convertToValues service or is not present in the input data for the pub.flatFile:convertToValues service) the format service assigned to that field will not be executed.
Input Variables
value
String. The field value to format.
direction
String. Indicates the type of formatting to be applied to the field. Specify one of the following:
Value
Description
convertToString
This field is in an outbound document and needs its internal format converted to its external format.
convertToValues
This field is in an inbound document and needs its external format converted to its internal format.
validate
String. The value of the input parameter validate from the pub.flatFile:convertToValues service.
true
The value of the convertToValues validate parameter is true (validate).
false
The value of the convertToValues validate parameter is false (do not validate). This value is always false when the value of the direction parameter is convertToString.
minLength
String. Enables you to validate the minimum length of a field. If the field is extracted via a Fixed Position Extractor, this is the number of bytes that are extracted. If the field is not extracted via the Fixed Position Extractor and a Length Validator is associated with this field, this is the minimum length that will be considered valid. Otherwise, this parameter will not be present in the pipeline.
maxLength
String. Enables you to validate the maximum length of a field. If the field is extracted via a Fixed Position Extractor, this is the number of bytes that are extracted. If the field is not extracted via the Fixed Position Extractor and a Length Validator is associated with this field, this is the maximum length that will be considered valid. If the maximum length is unlimited (–1) or there is no Length Validator, this parameter will not be present in the pipeline.
FormatInfo
Document. Information that can be used by individual formatting services. This information can be obtained from one of 3 locations:
*convertToString – You can specify FormatInfo in addition to the delimiter information for a call to this service.
*convertToValues – If delimiter information is explicitly passed into the convertToValues service, FormatInfo can be specified.
*From the UNEDIFACT UNA segment – The EDI document type automatically extracts the decimal separator from the UNA segment.
The only format services that use this feature are the decimal formatting services (for implied decimal and decimal formats). The FormatInfo IS document should contain a string called DecimalCharacter. If the decimal character is ‘,’ the number would be formatted as 100,10 (European format) instead of 100.10, as is common in the US.
Note:
Changes to the data in this object will be reflected in all other format services that are invoked during execution of convertToString and convertToValues.
Output Variables
formattedValue
String. The field value with appropriate formatting applied.
meetsFormat
String. Whether the value could be formatted properly.
Value
Description
true
Indicates that the value could be properly formatted.
false
Indicates that the value could not be properly formatted.
errorMessage
String. If meetsFormat is false, this parameter provides a text message describing the formatting error.
valueToValidate
String. The value that will be used by the validator for this field. If this value is not present, the value passed in the input variable value will be validated. This field is used only for situations in which the input variable validate is set to true.
maxLength
String. Enables you to validate the maximum length of a field. If the field is extracted via a Fixed Position Extractor, this is the number of bytes that are extracted. If the field is not extracted via the Fixed Position Extractor and a Length Validator is associated with this field, this is the maximum length that will be considered valid. If the maximum length is unlimited (–1) or there is no Length Validator, this parameter will not be present in the pipeline.
FormatInfo
Document. Information that can be used by individual formatting services. This information can be obtained from one of 3 locations:
*convertToString – You can specify FormatInfo in addition to the delimiter information for a call to this service.
*convertToValues – If delimiter information is explicitly passed into the convertToValues service, FormatInfo can be specified.
*From the UNEDIFACT UNA segment – The EDI document type automatically extracts the decimal separator from the UNA segment.
The only format services that use this feature are the decimal formatting services (for implied decimal and decimal formats). The FormatInfo IS document should contain a string called DecimalCharacter. If the decimal character is ‘,’ the number would be formatted as 100,10 (European format) instead of 100.10, as is common in the US.
Note:
Changes to the data in this object will be reflected in all other format services that are invoked during execution of convertToString and convertToValues.