I have created a FFSchema with recorddefinition as dummyHeader. The FF Definition has record parser as Delimited with Record characeter newline, field character ,
The flat file is
dummyHeader,1,2
dummyHeader,3,4
Now I have a repeat step under which I am doing the convertToValues. The first dummyheader record is parsing fine.
But when it comes for 2nd iteration, the converttoValyes service is failing with [FFP.0012.0004] Found no valid records error.
The 2nd record is not getting parsed, could anyone help me with this?
You have multiple records in flat file. What i didn’t understand is is your “repeat step”, IMO you do not need a repeat step to convert the flatfile to values. All you need is to set the Max Repeat preoperty for the record definition.
define a record “dummyHeader” in the schema
Set the “Max Repeat” property (developer->properties panel) for the record to Unlimited or any positive number you want.
Generate the document from the schema
Now use the “converToValues” it should give you multiple records in output
Thanks for the response.
Actually my requirement is to parse the dummyHeader record one after the another. i.e. parse one dummyHeader and then process it. And then parse the second dummyheader and process it.
For this, I have done few additional things apart from the 4 steps you have mentioned above.
Include the converttoValues under a Repeat flow step/construct.
Set the “iterate” input in Converttovalues to “true”.
Also branch step on ffiterator output from convertToValues to check if data exists. If data does not exist, then exit from the Repeat flow.
Because the “ffiterator” holds the next records, and if invoked as transformer within repeat/loop this will be lost after first iteration unless mapped to a pipeline variable.
you know what? i had mapped out the ‘ffiterator’ in pipeline when calling converToValues as a transformer. Still it was not working.
I found some threads just now in the forum regarding ‘transformer’ v/s ‘invoke’. It seems that if there is a loop/repeat, then it is not advisable to use transformers.
The way a service can be used as a transformer or invoke is like calling by reference and calling by value respectively.
So I am pretty sure that transformer is not working for my requirement. I better use invoke.