cancel
Showing results for 
Search instead for 
Did you mean: 

Validating ASMA headers in Message Mapping

former_member192105
Participant
0 Kudos

Hello,

I have a JMS -> SAP PI 7.11 -> Receiver1 OR Receiver2 scenario.

If proper values of JMS Header (DCJMSMessageProperty0 and DCJMSMessageproperty1) are present then only Receiver1 should be called; otherwise Receiver2 should be called.

Accordingly I have mentioned conditions in Receiver Determination and this part is working fine

Now when I call Receiver2 I have to create below message (Message Type already defined):

<Validation>
<CustId>123456</CustId> 1..1
<Error> //to be generated only when Property0 is either not present or has invalid value
<ErrorValue>DCJMSMessageProperty0</Errorvalue> 
</Error>
<Error> //to be generated only when Property1 is either not present or has invalid value
<ErrorValue>DCJMSMessageProperty1</Errorvalue>
</Error>
</Validation>

How to check in mapping if the ASMA headers are present and have valid values?

I am aware how to write the Dynamic Configuration UDF

Valid Values for Property0 = SAP, WebMethods, FileServer. Any other value is invalid.

Valid Values for Property1 = Server2. Any other value is invalid

Please help.

~Thanks.

Edited by: Abhishek01 on Jan 24, 2011 10:57 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Abhishek,

since you know how to write the Dynamic config udf to retrieve the values, why dont you simply do an "if condition" to "null" there itself and default the values?

Maybe i dint get the question rite.. 😮

Regards,

Ninu.

former_member192105
Participant
0 Kudos

Hello,

why dont you simply do an "if condition" to "null" there itself and default the values?

I did apply the below mapping logic

Source -> GetASMAUDF -> FixValues -> equalS (fail) -> createif -> Error

Fixvalue setting

SAP <------> pass

WebMethods <------> pass

FileServer <------> pass

Default value is set as fail

Now as per my understanding if Property0 has SAP/ WebMethods/FileServer then pass will be populated and Error will not be generated; whereas if Property0 not equal SAP/WebMethods/ FileServer then default value (fail) will be populated and Error node will be created.

But during execution, I am getting an error in Interface Determination saying "cannot produce target node Error"

Please help.

~Thanks.

RKothari
Contributor
0 Kudos

Hello,

I guess CreateIf function accepts boolean values: true, false.

Try passing these values in Fixvalue and equalS functions.

-Rahul

Former Member
0 Kudos

"Cannot produce target node" is an error which we get when some source field mapped to a mandatory target is missing in the input. In this case, i think probably something has been overlooked.

In this case, when error segment is created, you need the default values "DCJMSMessageProperty0" and "DCJMSMessageProperty1" right? Have you mapped the same? Have you tried to run it locally in your interface mapping using a try catch block?

Former Member
0 Kudos

Hi,

Check whether the UDF is working as expected or not..i.e returning the value or not...

if so then check the mapping condition (by simply the passing the value as if udf is returned ) and check the mapping whether it is working or not...

you have map the output of udf to some other field also and check what is the output returned by udf..

HTH

Rajesh

former_member192105
Participant
0 Kudos

Hello,

Try passing these values in Fixvalue and equalS functions.
Check whether the UDF is working as expected or not..i.e returning the value or not...

I think there was something missing in my UDF itself. I added the below code (Property0 is the String which will hold the DCJMSMessageProperty0, when present)

if (Property0 == null)
return "";
else
return Property0;

The logic for Error remains same: Source -> GetASMAUDF -> FixValues -> equalS (fail) -> createif -> Error

Have you tried to run it locally in your interface mapping using a try catch block?

The mapping will not execute in Interface mapping as it has DynamicConfiguration logic.

At least now the mapping works good in Integration Builder -> Tools -> Test Configuration.

I do not have access to run the scenario end-to-end so will have to wait till tomorrow for onsite team to test.

The thread is not closed yet; if any suggestion then please do post

~Thanks.

former_member192105
Participant
0 Kudos

Hello,

The check using above UDF is working good.

~Thanks.

Answers (0)