cancel
Showing results for 
Search instead for 
Did you mean: 

Counting Rows in a message in BPM

Former Member
0 Kudos

Hi Experts, i need some knowledge sharing here.

Anybody can tell me how can we get the numbers of rows in a message by using loop in BPM?

I was thinking of using Loop and container node. But i still don't get it how can i use the loop condition so that my loop is not looping forever.

Thank you so much guys....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I use the "Count" function in graphical message mapping and count the segments and add these to an unused field in the footer

Former Member
0 Kudos

"I use the "Count" function in graphical message mapping and count the segments and add these to an unused field in the footer"

Hi thx for the reply, however, can you explain to me in more detail.

My scenario is i got a message with structure like this:

Source Message:

Header 1..1

item 1..N

Type 1..1

Target Message:L

Header 1..1

result 1..1

Now, i want to count how many are there Type with value is for example 'E' and map it to the target message in node 'result'. So if there are 2 'Type' with value 'E' therefore the 'result' will filled with number '2'. If there is only 1 'Type' with value 'E' thus the 'result' will be filled with number '1'.

Do I have to use oneAsMany function?

justin_santhanam
Active Contributor
0 Kudos

Wishnu,

This can be easily achieved using UDF. Just create Advanced UDF -Queue. Write the below code

UDF [ Advanced - queue, input variable - type]



int count =0;
for(int j =0;j<type.length;j++)
  {
     if(type[j].equals("E"))
     count+=1;
  }

result.addValue(""+count+"");

Mapping

Type[Change Context to Header]--->UDF--->result

raj.

Former Member
0 Kudos

Thx so much Raj for the advice and help for the code. It works fine. Thx so much....

Answers (1)

Answers (1)

former_member181959
Contributor
0 Kudos

Hi,

Use loop step with container operation in integration process.

Use a container variable to hold the value of the count.

Hope this helps.

Prasad Babu.