cancel
Showing results for 
Search instead for 
Did you mean: 

Message Split

Former Member
0 Kudos

Hi all,

I am doing a File Split scenario, requirement is to group a set of items coming

From a source file into messages .

File to flat file scenario source file is having n items requirement is to split this file after every 500 items not using BPM.

As of now I am able to generate as many files as the number of items but the

Requirement is to group atleast 500 items in one message because the target system

Can nt take that big file .

Is this scenario feasible in Message mapping ??

Regards,

KLK

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Thanks all it is working using UDF

milan_10
Participant
0 Kudos

Why don't you guys doesn't learn XSLT.

It's quite easy...

bhavesh_kantilal
Active Contributor
0 Kudos

> Why don't you guys doesn't learn XSLT.

> It's quite easy...

because when the payload is huge XSLT can gives perfromance problems and when something can be done using graphical mapping plus some Udf's , graphical mappings should be used.

Regards

Bhavesh

Former Member
0 Kudos

Hi,

You can achieve this using UDFs(queue type).

Create the following UDF and map the parent node as

item ---> UDF -


> parent node

input: a


 int len = (int) Math.ceil(a.length/500.0);
for(int i=0; i<len; i++){
     result.addValue("constant");
}

Then create a second UDF and map the child element.

item ---> UDF -


> child

input: a


for(int j=0; j<a.length; j++){

     if(j%500 == 0 && j != 0)
          result.addValue(ResultList.CC);
     result.addValue(a[j]);

}

Regards,

P.Venkat

Message was edited by:

Venkataramanan

Former Member
0 Kudos

Hi Venkat,

I am trying to do this using Graphical mapping

I will try ur UDF and update u at the earliest

Thanks and Regards

KLK

Former Member
0 Kudos

Venkataramanan,

I am getting an error in the mapping saying Row which is under item can not be generated

Source is as follows :

MT

item

Row

field1

field2

Cannot produce target element /ns0:Messages/ns0:Message1/ns1:it_MT[2]/item/Row. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

Former Member
0 Kudos

HI,

You have an option in File adapter

--Source File Size : SourceFileSize

--Msecs to Wait Before Modification Check

Enter the number of milliseconds that the adapter must wait before it checks whether the files have been changed.

This parameter is not available if you have selected File Content Conversion as the Message Protocol and then made an entry under Recordsets per Message that splits an input file into several messages

Also see the below link

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

Former Member
0 Kudos

Chandra Sekhar

Not using BPM !!

KLK

Former Member
0 Kudos

Hi KLK,

Use UDF..

from source to target .. root. nodes.

source side one msg, target side two msgs.

target side first one is for 500 msgs,second one is for rest of msgs.

For this first send all record into Vector/Hash map.And then route these records based on loop condition first 500 to msg1 and rest to msg2..

Regards

Chilla..

Former Member
0 Kudos

Hi KLK,

this scenario is feasible without BPM....

In your sender file adapter just tell number of record-sets per message as 500...

then your source file will be broken after 500 records.

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Rajeev,

I am getting a XML file not flat file and number of items are variable

and not counted at the source end

KLK

Former Member
0 Kudos

Hi KLK,

then there is a work around for your this msg split problem....

make a J2EE adapter module - from source file create files of 500 rec and put them in someother target folder........

now make another file com channel to pick the files from this target folder......so your scenario will take the second file comm channel and then your input files will be of 500 recs.

Thanks,

Rajeev Gupta

Message was edited by:

RAJEEV GUPTA

Former Member
0 Kudos

Hi,

Please see the below links for Message split ..

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

/people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure

Regards

Chilla..

<i>Points rewarded if it is usefull..</i>