No sweat, it is a simple 19 step process (grin):
A) Create and populate a dictionary
- create and name a new dictionary
- in the new dictionary, select the “Record Definition” line
- Click the “new definition” button. (looks like a folder with a motion accent on its upper right)
- name the new record, for example: record
4a) click finish (this should create the new record and highlight it)
- Click the “new definition” button again. The popup now shows more options
- Select the field definition radio button and click next
6a) on the next screen change the “Extractor Type” to Nth field
6b) Click on the “Insert Row” button since you will have two fields (one is there by default)
6c) name the first field (e.g. ponum), set position to 0.
6d) name the second field (e.g. potype), set position to 1.
6e) Click finish
B) Create and populate a Schema
- Create and name a new schema
- Select ‘Delimiter’ in the Record Parser section of the editor
8a) Choose Record Character to be “newline” from the Character dropdown
8b) Choose Field or Composite Character to be a comma (actually type a , in the field)
- In the properties section (upper right side of screen) set “Undefined Data” to True.
- Click the “Set” button in the properties - a popup will appear
- Navigate to the dictionary you created in section A. Click Next.
- Select the record you created in step 4. Click Finish.
- Click on the “Create Document Type” button in the main editor window (looks like a wM document)
13a) This automatically creates a document type in the same folder.
- Save your work.
C) Use your schema in a flow
- Create and populate a reference to your document type (from step 13a) in your flow (i did mine as an input to the flow so that i could populate when “running” the service on its own).
- In your flow create a pub.flatFile.convertToString step (from the WmFlatFile package)
- Map your document type (from step 15) to the Service Input for the convertToString, ffValues field.
- in the Service Input for the convertToString, ffSchema field, use the fully qualified schema name (e.g. copy/paste the schema into it)
D) The results
- When run, the CSV file shows up as the convertToString Output named “string”
Don’t skip any steps and i hope this helps!
-greg
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services