on 05-16-2007 12:16 AM
I am mapping
X string -> Y Decimal
how to convert string to decimal
is there a function
Jeff
Jeff
If you are using Graphical Mapping then XI will take care of conversion itself. You don't need to write any program explicitly.
But you need to do couple of validations because in case Source System will send NULL value ( which is allowed for String data type ), XI will generate mapping exception so for this during mapping you can check for NULL value & put constant value 0.
Also if you want to check whether this String value has all digits in it or not, you can write following simple UDF -->
<i>String str
if ( Integer.parseInt(a)==1){
str=a;
}
else
str=-1;</i>return str;
}
// then u can consider -1 as error value which you can check in Target system
Pls. keep in mind using UDF in graphical mapping you can only return String type value.
- lalit -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I an using fixed value mapping function and passing a value.
while i am doing testing in message mapping editor it displays target values.
i gave default value as 0.
when reaching 3rd party system it is going as 0 even if then source value exists.
is there a way i can ebug and check wats the issue
Jeff
Jeff
Seems that you are not putting the validation in correct way.
In my mapping between String PARNR( Source ) & Long DriverID( Target ), I used this logic -->
/ns1:DriverID=iF(const([value=0]), stringEquals(/ns0:PARNR=, const([value=])), /ns0:PARNR=)
In programmitical way you can put it like this -->
If ( PARNR == NULL )
then
DriverID=0
else
DriverID=PARNR
- Lalit -
Jeff
Seems to be some issue with validation logic you are using in your mapping.
I suggest you to try different things like
*) Don't use the default value logic & execute ur scenario with this you will be able to know whether the problem with FixedValue function or not.
Also are you sure you are providing the "Keys" from Source system which you are mentioning under the Key column of FixedValue function property.
- Lalit -
<i>**** Pls. provide points to comments which in either way helping you to move ahead with your problem. This way others who will take notice of this thread in future knows what to do & what not *****</i>
Just to make sure one thing, you are giving 0 as a default value in FixedValue function or you are putting a different validation for this.
If you are giving 0 as default in FixedValue then can you remove it & check what would be the output.
In such I would suggest you try different settings & try to pin-point where the issue is.
- Lalit -
Jeff,
Define your source datatype as string and target datatype as Decimal for the corresponding field.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey
use a simple UDF for this,simply convert the datatype for the sender.do a typecasting.
thanx
ahmad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.