Format Services for Validating Flat File input

I am trying to parse a flat file and I have different records identified by 001, 002, 003, etc and within some of the records I want to validate the fields, I have this so far:

pub.file:getFile
pub.flatFile:convertToValues

I have a dictionary with the field and record definitions and a schema with the references to them with positional indexes set for each. I want to be able to validate data type and date formats. How can I implement a format service to do this for me? I have tried declaring a new Specification in the same folder as the Flow Service, and passing the Document Type that I am saving the parsed data in, but I don’t know what to do with it from there, if that is even correct, I have read some documentation in webMethods Developer User Guide, but I am still unclear about what to do. I am using Developer 6.1. Thanks for you help in advance!

-Nick

Hi Nick,

You can build the format service and reference it in the schema where ever you defined the fields. If you defined the fields in the Dictionary under Field Definitions do it there or if you defined them directly in the schema you can also reference the format service there as well. Look for the column format Service.

HTH

I believe you are on the right track.
In the custom format flow service pass the inputs to the FormatService specification like (value example:date),direction (convertToValues),
validate (true),FormatInfo (dateformat) etc…and then you have to specify this custom format service path in the flatfile schema/formatService tab for the individual fields that you want to do validate check.

Sorry if my post confuses,

HTH,

Thanks for the fast reply. I fully understand Chris’ post, I was that far to start with, but how do I integrate and invoke this format service? I have created it at the same level as my dictionary, schema, flow service, and document type. I am reading in the file, parsing it and outputting it to the document type. Where does the format service fit and how do I specify the things that RMG suggested. I remember seeing that in WmFlatFile.pub.flatFile:FormatService, how is it integrated? Thanks again!

Nick

Nick,

To elaborate more,

In the FlatfileEditor Schema or Dictionary just click any field then it will show up the properties panel,there you will see a tab called FormatService in the right corner.So click the browsing folder and browse the custom format service location which you have created and click ok.Since you want to validate dateformat etc…then click the date field and follow the above comments.

Hope you got my point.am i confusing?

Regards,

Not at all confusing, maybe I am using the Document Type wrong? I have no fields in it, I am just using it as an intermediary between the incoming and outgoing flat file, so it has no fields. This is the reason I can navigate to the format service in the properties panel, but find nothing when I select the format service I created. There is no date field to click on because I am not sure how to create the format service and give it the formatting specs. Do I have to set Specification Reference to WmFlatFile.pub.flatFile:FormatService or what? Thanks a bunch for you help so far. I just can’t get over the hump…

Nick

yes,you have to set input Specification Reference WmFlatFile.pub.flatFile:FormatService in the service input/output tab and specify the format information.

HTH,

Nick,

I don’t understand when you say you don’t have the fields defined. Even if you are using the default record you would have to still define the fields for the default record. That’s where the format service goes.
As RMG indicated the format service is invoked when you validate the document.
How are you reading the incoming file. Maybe you can try to attach the format service to that schema and not the intermediary.

Okay I am understand how it comes together, but in the input/output panel for the format service I have a specification reference to WmFlatFile.pub.flatFile:FormatService and inputs include value, direction, validate, etc, but it will not allow me to choose a variable to format or set these values in any way? Any further suggestions on implementing the date formatting?

Thanks,

Nick

In the custom format service pass the incoming flatfile date value to value,direction convertToValues,validate toTrue,FormatInfo(whate ever format you like)in the specification record.

HTH,

Chris-

I created a dictionary, fields and records are defined here. I set the FormatService for the field I wanted validated to “ValidateMerchantInfo” which has a specification reference to WmFlatFile.pub.flatfile:FormatServices. I then have a pub.getFile that steps to convertToValues where the data is output to MerchantData Document Type. I just want to be able to format some fields in this process but when I open the format service I created, I cannot set any fields, it has value, direction, validate, etc as input and some output, but how do I tie that to the date field definition in my dictionary so that I can specify the exact format? I know I have to point to the format service, but beyond that I cannot set the format, or atleast figure out how to. Thanks for all your help.

-Nick

You added the format service to a specific field in your schema. So webMethods will invoke this service for you - your service has to take the ‘value’ variable (the field you want to format) and you do whatever you want to format it and set the formattedValue pipeline variable.

Make sure you have your format service locked so you can edit it.

Nick,
You have to specify the particular format value in the custom format service and follow the will kriski comments mentioned above.

sorry for too many sugesstions at one time.

HTH,

Nick,

You can also check the flat file samples in your installation. Its seems to be useful and takes you thru the entire process.
…\IntegrationServer\packages\WmFlatFileSamples\pub

Thanks,

Hi,
I have a xxx.txt File and I want to read that and afterwords will display the Content of the file in a html or jsp format.
Anywhere, for Reading i need to define FlatFile.
have someone someidea, how can i build FlatFile.

Thanks for sometip
Roya

Roya,

Which version of IS are you working on?

If ver6.x then follow as mentioned below,

By looking into your txt file you have to create a FFSchema and use the convertToString (this will give output FlatFile string),here on do what ever your requirement says.

Please go thru the ISFlatFileSchemaUserguide.pdf for more information about FFSchema/Dictionaries/WmFlatFile services etc…

goodluck,