Skip to Content
author's profile photo Former Member
Former Member

Mapping, Condition on Node

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 15, 2016 at 11:11 PM

    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


    Capture.JPG (69.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Posted on Jul 29, 2016 at 03:38 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.