cancel
Showing results for 
Search instead for 
Did you mean: 

Wildcards input to Constant function

Former Member
0 Kudos

Hi,

I have a scenario in which multiple receivers exist for a single sender.

A value from the source need to be mapped to different values for each of the receiver and then sent.

All the receivers' names start with a common string i.e. they are like

SAP_RECVR_DEV

SAP_RECVR_1_DEV

SAP_RECVR_A_DEV

SAP_RECVR_A2_DEV

Using the built in value mapping function allows me to achieve the above mapping correctly. However, I want to catch the cases wherein if the value coming from the source is not mapped to any value in XI (in such cases the message should fail in XI, however the built in value mapping function has been observed to be sending the value from source itself to the target and not raising any exception).

Hence, i tried creating a custom mapping function for this with the following input parameters

SenderAgency

SenderScheme

ReceiverAgency

ReceiverScheme

SourceValue

with constants for the first four values and SourceValue containing the value to be mapped.

During this I am not sure what shoud i use as the value for ReceiverAgency as i have multiple receivers. Can wildcard characters be used as an input to the Constant function?

In case it is possible to make the built in value mapping function raise an exception in case of absence of a mapping in XI, please suggest how it can be achieved.

regards,

Diptee

Edited by: diptee s on Dec 22, 2010 3:30 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

srikanth_srinivasan3
Active Participant
0 Kudos

Check the permissible set of input values (using X-Path) in Receiver Determination & configure here to throw an exception.

-

Srikanth Srinivasan

Former Member
0 Kudos

Hi Srikanth,

Would you please elaborate the solution you provided?

thanks,

Diptee

srikanth_srinivasan3
Active Participant
0 Kudos

In condition editor at receiver determination, follow the steps below:

1) Select XPath

2) Provide the XPath of the element thats fetched as an input to Value Map in your mapping.

3) Condition like this:

3.1) Xpath of source element - value you've provided as key in your value map

3.2) All keys to be checked here, where something comes new which is not present in the condition check, the message will be stopped with an exception.

Please let me know if thats clear.

-

Srikanth Srinivasan

Former Member
0 Kudos

thanks for the details Srikanth,

However, i have a doubt here.

In the scenario i have, i need to send data from source to all the receivers at a time, with a different target value for each of the receiver.

Since you have mentioned adding the XPath to the receiver determination conditions, i needed to confirm if the solution you provided would work in my scenario as well.

thanks,

diptee

anupam_ghosh2
Active Contributor
0 Kudos

Hi Diptee,

By xpath method mentioned by Srikanth you will be able to access individual field within source message. The content of the field may be compared with constant values in form of strings. So if the match is exact the target data will be forwarded to a specific receiver. There are other options as well to compare the data. Here in your case I think you are routing the target based on some content of the source message. Also you are using value mapping for populate the target message. But finally after mapping you need receiver determination to send the values that too to multiple receivers at the same time. please refer to link below which says much about multiple receiver determination

http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/frameset.htm

Finally are you using a BPM in your scenario? In BPM's it is very easy to provide sender elements in branches. So depending on input payload same messages are forwarded to different receivers.

regards

Anupam

Edited by: anupamsap on Dec 31, 2010 11:58 AM

Edited by: anupamsap on Dec 31, 2010 3:30 PM

srikanth_srinivasan3
Active Participant
0 Kudos

I am unclear about your statement 'i need to send data from source to all the receivers at a time'.

When we talk about Value Map, messages processing would be mutually exclusive.

If what I understand you is right, you are talking about a different requirement of your flow here: Multiple receivers

If you have desired multiple receivers, please apply the conditions to be cheked for all permissible receivers.

-

Srikanth Srinivasan

Former Member
0 Kudos

hi,

my scenario sends the source message to all the configured receivers without any conditions being applied to the receiver determination.

also there are multiple source values which need to be mapped to the respective target value for each of the receivers.

the sender here is a BPM indeed.

thanks,

diptee

srikanth_srinivasan3
Active Participant
0 Kudos

Context of your question posted: Configure value map to throw an exception if no key-value pair exists in value map.

did you try to apply condition (as described in previously) in receiver determination?

-

Srikanth Srinivasan

anupam_ghosh2
Active Contributor
0 Kudos

Firstly I wish u all a very very happy new year.

Hi Diptee,

I think you are trying to send same target message with different content to multiple receivers at the same time. The content of the message is being decided by value mapping(you can also do it using UDF) followed by sending of the message. Firstly in BPM a receiver step receives the message followed by a transformation step say TR1. In this first transformation you provide a UDF. Which will check whether the source message contains all valid values to be mapped to target or not. The output of this transformation will update a field say "status" within target message say target1(this target message has only one field called status and is different from the one you are going to actually send to receivers later on) in the form of a number say 0 for success (i.e. the value within source are all valid) and 1 for invalid values. Next you put a switch step and in its positive branch you are going to put only one transformation step say TR2 followed by a send step. Here while designing the switch you check the value of status field of target1. If the value is 0 you are going to take the positive branch.

In this TR2 step within switch step you use your value mapping to put values in the actual target message from the source message (you have received in receive step earlier),here you will find no invalid values to be mapped since the BPM workflow has reached the positive branch after checking the input payload. Now the send step sends message to all recipients.

This was the design in Integration repository in Integration directory you have to set receiver determination to multiple receivers. If you have not done this before refer to the link I specified in earlier post. By this way the BPM does not send any message if it is an invalid one.

here is the design of BPM

receive source message -> transform -> branch(check status)-> if zero -> positive branch -> value mapping -> send step

Regards

Anupam

Edited by: anupamsap on Dec 31, 2010 3:22 PM

Edited by: anupamsap on Dec 31, 2010 3:28 PM

Former Member
0 Kudos

thanks anupam & srikanth,

I will try both the above solutions and will get back to you in case of any further doubts.

Thanks for your wishes as well and Wish you a Very Happy New Year !!!

regards,

Diptee

Former Member
0 Kudos

hi,

i have discussed both the above solutions with the client and he doesn't seem to be happy about it, as adding new mapping with both the above solutions would incur a design change in XI whenever a new mapping needs to be added.

hence i would like to get back to a UDF here which will allow me to generate an exception upon failure of mapping lookup. but i would need to use a constant function to provide the recv agency value to this UDF and would like to know if its possible to give wildcard input to the 'constant' function.

I have tried using 'SAP_RECVR*' as the input to my 'Constant' function however the * seems to be getting interpreted literally and hence even when the mapping is present its not being picked.

regards,

Diptee

Edited by: diptee s on Jan 7, 2011 10:52 AM

srikanth_srinivasan3
Active Participant
0 Kudos

New Year Wishes to you too.

The proposal I made doesnt seem to involve any additional map.

It is just to add an XPATH entries in existing receiver determination.

-

Srikanth Srinivasan

Former Member
0 Kudos

hi srikanth,

the solution provided by you does not include adding any maps, however adding xpath conditions in recvr determination conditions is a design change.

thus, in future if we need to add any new mappings, the values of the same would need to be added to the XPath conditions.

hence, i am looking for a solution where i need not hardcode the source values being mapped in XI.

thanks & regards,

diptee

srikanth_srinivasan3
Active Participant
0 Kudos

Within my visibility, I dont see a way to handle it with value map of XI 3.0 itself..

Sorry Dipte..

-

Srikanth Srinivasan

Former Member
0 Kudos

When you insert a Value Mapping block in a mapping, in the Properties window the last block is about exception.

Behabiour if lookup fails: Use Key, Use default value or Throw Exception.

Former Member
0 Kudos

hi Martin,

i am using XI 3.0 and cannot see the Exception property in the Properties window for my buit in value mapping function.

regards,

Diptee