-1

I am trying to map one record into multiple records using webMethods Designer flow service. 1 row converted into several rows. Please help me to wire webethods flow service to map the following using LOOP,REPEAT, MAP, etc.

SourceRecord
DateFields TargetRecord
DT ( Record initiator )( 1 .. 1 ) DTM (Record initiator)( 1 .. many times) OrderDate DTM_01 SalesDate DTM_02 ExpireDate

Sample Input data ( element delimiter "," and segment terminator newline)

DT,20200914,20200916,20230913   <-- where DT is record initiator "," is element separator 
                                    and orderDate = 20200914
                                        SalesDate = 20200916
                                        ExpireDate = 20230913

Desired Output Data ( multiple rows)  ( DTM is record initiator element delimiter "*" and segment terminator newline)
DTM*002*20200914   <-- 002 is qualifier for OrderDate
DTM*007*20200916   <-- 007 is the qualifier for SalesDate
DTM*036*20230913   <-- 036 is the qulifier for ExpireDate
Yasir
  • 1

1 Answers1

0

There is not enough information. Do you have one string with one record of input data? Do you have a list of strings or a document list? Most likely the record comes from a flat file? Is the output a string list or document list?

Anyway, the simple solution to your question (assuming one record) is to tokenize (using pub.string:tokenize) the input string and map it to output object using indices concatenating it with preset qualifiers:

enter image description here enter image description here

Now you can build your string out of that string list using pub.string:makeString, using new line as separator (notice that cursor is on the second line): enter image description here

  • Thank you for answering. I would like to do edi mapping one record input to multiple records output I have csv input file with one line content like DT,20200914,20200916,20230913 and I would like to see output file with 3 lines content like DTM*002*20200914 DTM*007*20200916 DTM*036*20230913 – Yasir Sep 24 '20 at 15:30
  • In that case my example is more or less what you want as it requires a string (1 line) on the input and generates a string (with 3 lines) on the output. Only a matter of writing that string to a file using a built in or custom service. – Radosław Jakubowski Sep 25 '20 at 07:25