cancel
Showing results for 
Search instead for 
Did you mean: 

Value Mapping questions

Former Member
0 Kudos

Hi,

I did the following and still not getting correct value

> Wrote a UDF to accept 1 parameter and return a response

******CODE**********

AbstractTrace trace= container.getTrace();

com.sap.aii.mapping.value.api.XIVMFactory xivm = new com.sap.aii.mapping.value.api.XIVMFactory() ;

String context = "http://sap.com/xi/XI";

com.sap.aii.mapping.value.api.IFIdentifier ifdsrc = xivm.newIdentifier("SRC","PAR1");

trace.addDebugMessage("AA");

com.sap.aii.mapping.value.api.IFIdentifier ifdtgt = xivm.newIdentifier("TGT","PAR1");

com.sap.aii.mapping.value.api.IFRequest ifreq = xivm.newRequest(ifdsrc,ifdtgt,location[0]);

trace.addDebugMessage("BB");

trace.addDebugMessage("CC");

com.sap.aii.mapping.value.api.XIVMService xivs = new com.sap.aii.mapping.value.api.XIVMService();

String value1 = new String("");

boolean v1=false;

try{

com.sap.aii.mapping.value.api.IFResponse ifr1 =xivs.executeMapping(ifreq);

v1 = ifr1.hasTargetValues();

trace.addDebugMessage(" Has Value is " + v1);

value1 = xivs.executeMapping("SRC","PAR1",input[0],"TGT","PAR1");

} catch (Exception e1)

{ result.addValue( "ERROR");}

trace.addDebugMessage("Value is" + value1);

if(v1 ==true)

{result.addValue(value1);}

else

{result.addValue(ResultList.SUPPRESS);}

                                • CODE END **********

However, when I run the map test after connecting the input to the UDF, the output always is

>> THe boolean value is TRUE although I do negative tests with invalid values

>> From the tracing above, the value is always "Mapped value of Source: http://sap.com/xi/XI PAR1 SRC __cC_ Target: http://sap.com/xi/XI TGT PAR1"

I do not know what the exact value is and always getting a TRUE for the "hasTargetValues" method.

Please review if I am doing something wrong here

m

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Do you want to access the value mapping inside a User Defined Function?

Code and explanation is available in this blog,.

/people/sukumar.natarajan/blog/2006/10/23/accessing-value-mapping-defined-in-directory-using-java-functions

Regards

Bhavesh

Former Member
0 Kudos

Thanks Bhavesh !! Great source of info..

m

Former Member
0 Kudos

Still getting the same

"Mapped value of Source: http://sap.com/xi/XI PAR1 SRC LAAA Target: http://sap.com/xi/XI TGT PAR1"

& no other values

Answers (1)

Answers (1)

Former Member
0 Kudos

The value mapping does not work in Integration Builder's test tab.

Instead of a real mapping result, the result is the generated text: "mapped value of..."

Value mapping can only be tested by running a real interface (sending test message from RWB amounts to a real interface in that regard).