cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping in BPM - set value of collection item

Former Member
0 Kudos

Hello,

is it possible to set value to exact item of collection in mapping step in netweaver BPM?

I need something like set(<collection_variable>,<item_index>,<item_value>)  - so exact opposite of GET generic function, which gets specific item from collection.

Is it possible in NW BPM?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

And what about Generic Function Insert-Before?

Former Member
0 Kudos

Hi Andrew,

In theory yes - but practically no - i think.

Do you have some example how would you use that for set an item?

former_member191643
Active Contributor
0 Kudos

Use a Mapping Activity where you can map the data structures as compared to the XML Schema you have created in the BPM Project

Former Member
0 Kudos

Of course I`m using mapping activity - but I cannot (or at least I dont know how) set the value of the specific item of collection.

Example:

I have collection myCol:("aa","bb","cc").

I can get value of second item of collection myCol using get(myCol,1). Result is "bb".

Now I want to change "bb" to "ww". How is it possible? I`m looking for something like

set(myCol,1,"ww") or myCol[1] = "ww"

I tried to change item retrieved by get function - but it is retrieved by value, not by reference - so change performed to that item wont have effect on original item in collection myCol.

former_member191643
Active Contributor
0 Kudos

Try using the 'Looping' property in Mapping Activity. It might help.

Former Member
0 Kudos

It Wont help you - I think.

Can you describe in more detail how you would solve that problem using looping?

Looping in BPM is not sequential (its parallel) and field currentCollectionItem is readOnly - so you cannot write into that item. How can this help me?

former_member191643
Active Contributor
0 Kudos

Oh yes you are right. It is indeed readOnly. My bad. Just trying to help.

May be you can write an EJB Function within your BPM project to take care of this? And then use it while mapping?

Former Member
0 Kudos

You dont have to apologize. I didnt meant that as offend.

I appreciate the possibility to discuss that topic with somebody, because discussion itself sometimes shows other perspective to the problem, which can lead to solution

Of course I wrote EJB function to solve that - but I cant believe that it isnt standard solution to that pretty common use case.

I think, that problem lays in very limited implementation of XPath into Netweaver BPM. I will bet my left hand, that in some future SP of BPM will SAP introduce something like this:

myCollection[1]/notificationId = notificationId

which is standard XPath way to do that