cancel
Showing results for 
Search instead for 
Did you mean: 

BPM Combine Two Messages

Former Member
0 Kudos

I'm using PI 7.1, and I have a BPM that receives data and makes a synchronous call to a database to insert and then return the number of rows inserted. What I'm trying to do is get a hold of the number of rows inserted in order to add that number to the xml structure of the original message.

I am currently trying to use a transformation step that takes two messages as input (the original message and the number of rows updated) and combines them into one message. This mapping works in the operation mapping test, but when I execute the BPM, the rows updated are not added to the target message as they were in the operation mapping test.

I can see from looking at the transformation step in sxmb_moni that the mapping is receiving both input messages, it just doesn't seem to be executing the mapping as expected. I was under the impression that transformation steps were meant to be used for operations like this, so I'm assuming the BPM setup or transformation step is not configured correctly.

I would appreciate any suggestions or help that anyone could offer.

Thanks!

David

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dave,

So what result do you get? does your mapping program complete execution? or do you get an error?

If there was some change you made to the program that you think hasn't been updated yet, you can do a runtime cache refresh(sxi_cache).

You may be getting the result in the Op.Map but practically you need to check and see at runtime what your container variables hold. For this what i suggest would be for you to look at the values held by both containers > (1st MsgType and 2nd MsgType) at Run time and check what is the output of the transformation(Resulting MsgType).

SXMB_MONI, Select PE in ur respective message, On the menu tab, choose Goto Listwith Tech Details. Select the transformation step, you can actually see each of these individual container elements and what they hold @ runtime, it may not be ur map.

Hope this helped ur cause!

cheers

Hanish John

Edited by: Hanish John on Apr 5, 2010 7:37 PM

Former Member
0 Kudos

Thanks, Hanish. The mapping program completes successfully, but the output message is identical to the first input message.

I checked the values stored in the container objects for the transformation step. MessagesIn[1] and MessagesIn[2] are what I would have expected, but Messages_Out seems to just be a copy of MessagesIn[1] - it does not appear to be the result of the mapping.

It's almost as if the mapping is not being executed at all and MessagesIn[1] is simply being returned. Note that Messages_Out should be the same message type as MessagesIn[1]. There is a field for the number of rows inserted that is null in MessagesIn[1] and should be populated in Messages_Out as a result of the map.

Thanks!

David

Former Member
0 Kudos
 MessagesIn[1] is simply being returned. Note that 
Messages_Out should be the same message type as MessagesIn[1]. There is a field for the number of 
rows inserted that is null in MessagesIn[1] and should be populated in Messages_Out as a result of the map.

From what I understand you have MessagesIn[1] , MessagesIn[2] then you do a transformation to get back MessagesIn[1]{this now has a field in it that holds in the the # of rows returned from MessagesIn[2]}. In that case it is strange why it doesn't work for you , taking for granted that you tested the mapping StandAlone.

Try doing this, create a new Mesg Type(This is for your final target) instead of using the same MessagesIn[1] as your target . Create an abs . intrf for the same and define a new container say Target in ur Integration Process, use this in your transformation and check if it still gives the same issue. If it does, its definitely your map.

Hope you get closer to the soln.

Cheers!

Hanish John

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos

Can you provide the steps inside your BPM and their sequence....it will be like:

Receive1 --> Receive2 --> SendSync --> Transformation (3:1) --> SendAsync

You should make sure that the processing in the BPM reaches atleast till the Transformation step with Original & Response messages.

Regards,

Abhishek.

Former Member
0 Kudos

Abhishek,

Here are the steps inside my BPM:

Receive - receive input file

SyncSend - send database insert, return num rows inserted

Transformation (2:1) - combine input message and num rows inserted into output message (output message is same type as input message but should have a rowsInserted field populated)

AsyncSend - send message to file adapter

You should make sure that the processing in the BPM reaches atleast till the Transformation step with Original & Response messages.

Are you referring to the scope of the container objects? They are currently set to Process. I also have the transformation step set to create a new transaction, although I've tried it with and without checking this box and it doesn't seem to make a difference.

Thanks!

David

former_member200962
Active Contributor
0 Kudos
Are you referring to the scope of the container objects?

In SXMB_MONI --> you will have an entry for your BPM processing --> Click on the PE link --> Graphic Workflow will open which will tell you till what step has the BPM performed.

To Troubleshoot:

1) Check Graphic workflow and ensure that the mapping step is executed.

2) Check if there is any error in the worflow.

3) I feel that the Transformation step is not able to get the source message(s).

3) The BPM design seems to be simple and also the steps look correct.....open the BPM in IR and press F7 (check) and find if any error/ warning is reported.

4) If you find that everything is fine and still the BPM does not work....make some dummy change to the BPM>save> activate and again test....may be some cache issue (if it is not a configuration one)

Regards,

Abhishek.

Former Member
0 Kudos

>

>

Are you referring to the scope of the container objects?

> In SXMB_MONI --> you will have an entry for your BPM processing --> Click on the PE link --> Graphic Workflow will open which will tell you till what step has the BPM performed.

> To Troubleshoot:

> 1) Check Graphic workflow and ensure that the mapping step is executed.

> 2) Check if there is any error in the worflow.

> 3) I feel that the Transformation step is not able to get the source message(s).

> 3) The BPM design seems to be simple and also the steps look correct.....open the BPM in IR and press F7 (check) and find if any error/ warning is reported.

> 4) If you find that everything is fine and still the BPM does not work....make some dummy change to the BPM>save> activate and again test....may be some cache issue (if it is not a configuration one)

Thank you for the suggestions. I've examined the workflow: the mapping step has been completed, and there don't seem to be any errors. As I mentioned to Hanish a few posts up, the two input messages are both appearing in sxmb_moni in the transformation step as expected.

Checking the BPM in the ESR returns "No semantic errors found."

I've tried making minor changes and saving/activating several times, so I don't think it could be a cache issue.

Is it possible that I need a correlation? There is only one receiver, but the synchronous send receives a message as well. Do the two need to be correlated before the transformation step?

Thank you!

David

former_member200962
Active Contributor
0 Kudos

Correlation is not required in your design, I still feel the Transformation step is not able to produce the required output....do you get the expected output when you test the mapping in IR with the same payload as in runtime?

Regards,

Abhishek.

Former Member
0 Kudos

>

> Correlation is not required in your design, I still feel the Transformation step is not able to produce the required output....do you get the expected output when you test the mapping in IR with the same payload as in runtime?

Ok, thanks. Yes, when I take the message content of MessageIn[1] and MessageIn[2] from sxmb_moni, remove the top level nodes (ns1/ns0) and copy the xml to the operation mapping test tab in the IR, the mapping works as expected.

Do you know of a way to get more logging information from the transformation step? Where would an error message show up if there was one?

Thanks!

David

Former Member
0 Kudos

David, you do not need co-relation here,

Did you try the approach I mentioned earlier[seperate target type]? just to see if it is an issue with your map at run time?

Former Member
0 Kudos

I have resolved the issue. Based on your suggestions, Abhishek and Hanish, I was closely examining the relationship between the runtime values in the transformation step and the test execution in the operation mapping. I discovered that the message type for MessagesIn[2] was not the same as the message type that the operation mapping was expecting for the second input (although the content was the same, one type had a prefix in the name that the other did not...).

When I had copied and pasted the payload from the transformation step runtime into the operation mapping test tab, I had omitted the top level nodes which contained the interface names in order to skip the Messages/ Message1 tags. In doing so, I also omitted the ns1: tag that contained the message type, so I didn't realize that it was causing the problem.

I'm not sure why there wasn't an error thrown in the transformation step since the message types of the input data and the expected input obviously conflicted. Maybe there was an error but I didn't find it? Where would such an error be?

Thank you for all of your help!

David

Edited by: David Baker on Apr 6, 2010 3:37 PM - Clarified

madhusudana_reddy2
Contributor
0 Kudos

Hi,

to add that number to the xml structure of the original message.

I think you are using original message and response message(number of rows inserted) at source side and original message at target side in mapping.

if it is the case create one more message interface with different name for target side (in mapping) and execute the interface then it will work.

thanks,

madhu