FF schema creation for a requirement

Hi All,

We have the below scenario.

We have a source FF (csv) which has to be parsed, converted to target structure and then convert it to FF string and send to the partner.

Till Parsing of the source file we have no issues.

Ths data contains emp details.

Suppose there are 10 emp records in the source file, then each record needs to be converted into the below FF format.

i.e each record must have 3 lines of FF data.


PTAAA50BBB11000000000CurDate_H11NNN*12HHH*15KKK*37LLL*73PPP*74JJJ75UUU

PTaaa50bbb13000000000CurDate_H02ccc*03ddd*04eee10fff

PTAAA50BBB12000000000CurDate_H05DDD*48EEE68FFF


The fields highlighted in RED are variables which are read from the source file.

The Challenges we have are

    • at the end of each line (We are thinking to put a empty field at the end of the doc to attain this)
  1. Schema for this requirement

  2. If any of the variables is empty, then Leave out fields (this means the fieldnumber (2 digits) upto including the *)

Can any one advise us the FF schema to attain this.

Thanks,
Venkat

Did you try using formatServices which will have to custom logic to empty fields what ever per requirement (then assign it in the FFSchema of the particular field you want to format) and also in the convertToString ( there are some inputs which let fills nulls when certain fields has empty values)

HTH,
RMG

Venky,
To understand your requirement still more better…

You have 10 employee records in the incoming data, and you want to create 3 records for each employee records in outgoing data (total 30 records) ?

PT - is it a record identifier for all 30 records?

-Senthil

Hi Senthil/RMG,

Thanks for looking into my thread,.

PT is not a record identifier, but some constant which needs to be appended to the variable, say, ‘AAA’.

What you understood is correct. if there are 10 employee records, we need to generate 30 records in outgoing data.

The only delimiter we have in the data is * (may be we have to decide how o use this. For now we are thinking to use * as field delimiter and ‘/n’ as record delimiter.)

If you see, each record is ending again with a ‘’ which is not the case in general. For this we thought of defining an extra field at the end and nullifying that so that the service convertToString will create a '’ at the end of the record (emptyTrailingFields prop set to true)

We are working on, how best we can a single schema for this requirement (3 records) and reached out to the forum for the suggestions.

Also, another requirement given to us is,


If any of the variables is empty, then Leave out fields (this means the fieldnumber (2 digits) upto including the *)

We understand that suppose the record is as below

PTaaa50bbb13000000000CurDate_H02ccc03ddd04eee10fff

Suppose if the field ‘ddd’ is empty then the record should look like this.

PTaaa50bbb13000000000CurDate_H02ccc*04eee10fff

i.e the constant ‘03’ along with the variable ‘ddd’ and * needs to be left out.

If this possible to implement this in delimeter seperated FF?

cos, as far as I know, if filed ‘ddd’ is empty then the record looks like below.

PTaaa50bbb13000000000CurDate_H02ccc**04eee10fff

Could you please share your thoughts on this.

Thanks,
Venky

your understanding is right… it will bring the data like **… schema cannot skip the field… schema is a defined structure…

-Senthil

Hi Senthil,

Thanks for the quick reply.

Any idea how best we can prepare the schema for the requirement. (3 sets of records for each record)

For now, we are considering to form “PTAAA50BBB11000000000CurDate_H11NNN” as a string using multi concat
and forming 3 records in the schema

RecordMain (occurring - infinity)
Record 1,
Filed 1
|
|
Field 7

Record 2,
  Filed 1
   |
   |
  Field 3


Record 3,
  Filed 1
   |
   |
  Field 4

Any othr better idea than this :slight_smile:


PTAAA50BBB11000000000CurDate_H11NNN*12HHH*15KKK37LLL73PPP*74JJJ75UUU

PTaaa50bbb13000000000CurDate_H02ccc*03ddd*04eee10fff

PTAAA50BBB12000000000CurDate_H05DDD*48EEE68FFF


Hi All,

If we need to form a FF like below

PTAAA50BBB11000000000CurDate H11NNN*12HHH*15KKK*37LLL*73PPP*74JJJ75UUU

Can u suggest me how I can form an FF schema for this with out hard coding.

Also, If variable ‘HHH’ is empty the FF has to look as below

PTAAA50BBB11000000000CurDate H11NNN*15KKK*37LLL*73PPP*74JJJ75UUU

In the sample FF shown above, the variables are shown in RED ans the remaining are constants.

Thanks,
Venkat