cancel
Showing results for 
Search instead for 
Did you mean: 

Counting The Occurence Of A Node

Former Member
0 Kudos

Hi Experts,

I have requirement in which I need to repeat a Send step (in BPM) based on the number of times a node repeats in the source message.

E.g.:

<SRC>

<Item>ItemData1</Item>

<Item>ItemData2</Item

<Item>ItemData3</Item>

</SRC>

In this scenario the send step in the BPM should repeat thrice

BPM :

Receive>Check For No. Of Item Nodes>Send (This Step should repeat).

Please provide pointers in this regards.

Thanks,

Abhishek.

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

U should use a transform step to convert the three nodes into three messages. Now store these three messages in a container variable. Then use a Block in ForEach mode and use this container variable and ur design is done :).

Regards,

Prateek

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Abhishek

I dont think even a BPM is required just to repeat the target message number of times source message occur.

Well did you tried mapping the source node (0.Unbounded) to Target (0..1) using multi mapping

Do Try go to message tab in message mapping and just change the target node to 1..unbounded and see you will get message /Message1 structure where you can easily repeat the target equal to source node without changing it to 0..unbounded.

Check this also

Thanks

Gaurav

Former Member
0 Kudos

Hey,

in your mapping the target should be o...unbounded.

This should convert your input message into number of output messages.

Then as Pratik said use a trasnform step in BPM followed by a multiline container.

Then a block step that will act as a loop and the send step in the block so that it repeats.

refer to this blog to implement the block step in forEach.

regards,

Milan.

former_member200962
Active Contributor
0 Kudos

Hi,

This is the message which I will receive:

<SRC>

<Item>ItemData1</Item>

<Item>ItemData2</Item

<Item>ItemData3</Item>

</SRC>

This is the message which i need to send:

<TRG>

<Content>It should contain the Individual ItemData</Content>

</TRG>

Please note that no node in the TRG message will be repeating...so what i need to do is to include the mapping in the Block step in BPM (so that mapping repeats for each Item node)...is the logic correct?

Also now can you please tell me what will be the values in the following:

1) Container Operation: Target and Expression.

2) Block: Multiline Element and Current Line.

Please provide solution to this.

Thanks,

Abhishek.

samiullah_qureshi
Active Contributor
0 Kudos

Hi,

Before container for message collection you have create a single line and a multiline message in conatiner window.

In 'Container' you have to choose operation as append and in source message specify a message from conatiner and in target message you have to specify multiline message of same abstract message interface.

To know how to use of block go through following blog:-

Regards,

Sami.