cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping, Condition on Node

Former Member
0 Kudos

Hi Expert

I have a simple requirement, but not sure how to do it in BPM mapping.

Below is my Source and target Structures.

Source:                                                                                           Target:

sRecord                0..unbounded                                                         tRecord          0..unbounded

     value              0..1                                                                           Value          0..1

     deleteFlag       0..1

I can get multiple sRecords, with some having DeleteFlag = X and others with no DeleteFlag field.

I have to create target record only when delete flag field does not exist.

If DeleteFlag does not exist , then create tRecord.

Example input

sRecord

     value               1

sRecord

     value               2

     deleteFlag        X

sRecord

     value               3

     deleteFlag        X

sRecord

     value               4

sRecord

     value               5

In above case target record should be created only for value 1,4 and 5

Please advice

Accepted Solutions (0)

Answers (2)

Answers (2)

kun_wu
Advisor
Advisor
0 Kudos

Hi Jabri,

You can use the standard function filter to do the job.

filter(sRecord, "http://www.example.org/NewXMLSchema:deleteFlag=X")

http://www.example.org/NewXMLSchema should be the namespace of your xsd which defines the data types of your sRecord.


This should solve your issue.


Regards,

Kun

Snavi
Active Participant
0 Kudos

Hi Osman,

try with the filter function in the mapping (Rules and Functions -> Generic)

for more information on the generic functions, please check the below link

Generic Functions - SAP NetWeaver Composition Environment Library - SAP Library

Former Member
0 Kudos

if i use filter i get this error

expected "xyz" but found "xsd:string", if i ignore this and click OK also while building its failing.

Snavi
Active Participant
0 Kudos

Hi Osman,

can you put a screenshot of your mapping and condition, and the error message please

have you put filter condition on the list object? source and target as list objects

Former Member
0 Kudos

The filter function should work but it seems to have problems with namespaces etc. I've seen several cases where I couldn't get the filter function to work. A relatively easy alternative if the filter function doesn't work out is to implement a web service as EJB that does the filtering for you.

This also makes it easier to implement complicated filter and you'll see the filter step in your process.

Best regards,

Frank