cancel
Showing results for 
Search instead for 
Did you mean: 

message mapping with signature changed

Former Member
0 Kudos

Hello,

I have a mapping whose incoming and outgoing message has the same message type, let's say the message type for both in and out message is *MT_Material *. The mapping basically copy all data from in message to out message, however, the out message is only created based on certain condition. Therefore I changed the signature to define the Occurance of the out message as 0..1 while the in message has occurance of 1.

Things work fine, out message only contains data when the condition is fullfilled. However the mapping program expects incoming message like;

<?xml version="1.0" encoding="UTF-8"?>

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ns1:MT_Material xmlns:ns1="http://mynamespace">

<MatNo>123345</MatNo>

<MatText>

<Language>en</Language>

<Text>esx</Text>

</MatText>

<MatText>

<Language>fr</Language>

<Text>esxfr</Text>

</MatText>

</ns1:MT_Material>

</ns0:Message1>

</ns0:Messages>

Note the xml tags in bold are needed because of the signature change (occurance change). However the outbound interface is based on the message type of MT_Material, thus the sender will NOT send the xml tags in bold, rather following message is sent:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_Material xmlns:ns1="http://mynamespace">

<MatNo>123345</MatNo>

<MatText>

<Language>en</Language>

<Text>esx</Text>

</MatText>

<MatText>

<Language>fr</Language>

<Text>esxfr</Text>

</MatText>

</ns0:MT_Material>

Message in this format is NOT expected by the mapping program with changed signature, thus mapping is does NOT result in the right result.

So what should I do with it? looks like change signature doesn't make any sense because it expects different outbound message format as the one without signature changed.

Basically mapping is PI internal stuff, the sender should not be aware of it, thus sender should just send a message based on the message interface which is based on MT_Material.

what do you thnk of this?

Any

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Also, when the condition is not fullfilled, an empty message is sent to receiver like:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1></ns0:Message1></ns0:Messages>

again this is not expected by receiver, because inbound message is based on MT_Material which does NOT contain the xml tag as above.

The requirement is: if condition is not fullfilled, not outgoing message is sent, message flow stops inside PI. How is this possible?

Thanks

Jayson

Former Member
0 Kudos

HI Jayson

I dont understand the need to use Multimapping pattern in your requirement.

it looks simple to me that you are sending message from Sender to receiver based on some condition only you want to send the message. You are checking the condition in mapping and generating the message.

Why dont you just check the condition in mapping and use CreateIf -> MT_Material directly. This will create the target message only when conditon satisfies.

Moreover Just to do this you dont even need mapping or IR objects. You can check in ID itself and send message.

Thanks

Gaurav

Former Member
0 Kudos

Hi Gaurav,

you are partially right. In my specific case, I might not need to change signature. But in general, if the incoming message with cardinality of 1 needs to be mapped to outgoing message of cardinality of 0:n, the problem described in my initial post is valid. How would you say about it?

Also, I guess, as you said, if condition fullfilled, not node is generated, however I guess an message with empty xml payload is still sent to the receiver (I need to prototype this to make sure.) What I want is not to send any message is condition is not fullfilled.

BTW, my issue can't be solved in ID in the receiver determination, as the condition check is complex enough that the condition in RDetermination can't archive.

Thanks

Jayson

Former Member
0 Kudos

Hi Gaurav

I just tested your suggestion of CreateIf -> MT_Material. If the condition is fullfilled, everything is okay, root node is created and message is forwarded. However if condition is not fullfilled, in MONI, there is an entry with status of system error is logged saying that cannot create target element. The result is correct, no message is forwarded to receiver, however having the error entries in MONI is definitely not good as they are not errors in fact.

Basically what I want is, if condition not fullfilled, no message is forwared to receiver, and everything is still okay, no error should be seen in MONI.

Anybody has better idea to archive this?

Also, as stated in my initial post, in case of signature change, how can we not force the sender to change the xml payload structure (the xml tags in bold) just for our PI mapping work?

Thanks

Jayson

Former Member
0 Kudos

just to refresh the thread

stefan_grube
Active Contributor
0 Kudos

The additional tags in the XML are necessary to enable the PI runtime to distinguish the different parts of the message.

The graphical mapping cares about the additional tags, the XSLT and Java mappings has to care themselves.

If you just want to have a mapping based on a condition, you could go for rules in interface determination. You could different mappings there.

Regards

Stefan

Former Member
0 Kudos

Hi Jayson

System error is because the condition is checked for Main node. and for PI XML tags are required.

Then we have to move to ID based condition.

Let us know the condition you want to achieve. lets check with the XPATH we can built the condition or not.

Another solution can be If the condition is false and you dont want to generate the output. Pass a particular output to target XML and let it pass mapping. In ID check for the output you have generated for (NO output case) and define a dummy receiver or your own system so that message will not reach to actual target system.

Thanks

Gaurav

Former Member
0 Kudos

Gaurav,

I still find it weird that because of PI need, the sender is forced to send additional xml tags in addition to the xml document which is supposed to send. We're make the middleare NOT transparent to the communication parties, and we are forcing the communication parties to do extra work just for our middleware, this is no good.

Jayson

Former Member
0 Kudos

Hi Jayson,

Ideally PI doesnt expect Message or message1 to be part of the input structure while using the multi-mapping. I just created a multimapping and I was able to send the data to XI with any extra tags ( message or message1 ).

When you dont pass the Message or message1 tag in your input, what error are your getting ?

Thanks,

Pooja

Former Member
0 Kudos

HI Jayson,

As Gaurav said, if you provide us the condition for your interface, we can check if we can achieve that using xpath. I think, if the xpath option can suffice your requirement, then it would be much cleaner path than checking the condition in the MM.

Thanks,

Pooja

Former Member
0 Kudos

Hi Jayson

You are correct to some extent we should not force the vendor to send a tag to satisfy middleware. But if the tag is required for the business process what can be done other than forcing as a rule to vendor

As PI is a XML based tool where XML is tied to a XSD all messages need to follow XSD. Now in your requirement we need to meet the condition for generating the output. Being a middle ware PI is not meant for holding the messages or used as an end point for some communication. It works on two engines and we need to pass IS without error. Mapping will work at IS and if it failed its an error but we have to satisfy condition.

I have faced similar requirement to yours. I had routed the messages through email to vendor when no output need to be generated as they were incorrect and doesn't follow business rule of the process.

We can check with Xpath or either some the way we discussed above in case condition is not met

Thanks

Gaurav

Former Member
0 Kudos

Thank both of you, Pooja and Gaurav, it was more like a general question about multi-mapping. Xpath condition in Rdetermination is an option, but it won't satisfy my situation as mine contains more complex determination.

Former Member
0 Kudos

HI Jayson,

In general, the Message and Message1 tags are not supposed to be part of the input sturcture . Even though in the XI message mapping you see Message and Message1 tags get added the moment you change the occurence of the target ; but PI doesnt expect these tags in the input data from the Sender system.

Thanks,

Pooja

Former Member
0 Kudos

PI doesnt force the sender to send any extra tags to suffice the multimapping requirement.

Former Member
0 Kudos

Hey Jayson

As Pooja said PI wont force sender or receiver to send extra tags its upto the middleware to handle that. Source and receiver are expected to send/receiver message in accordance with schema defined in middle ware.

Anyhow its always in out hand to do custom development over the PI framework for any complex resolution

Thanks

Gaurav