on 03-16-2011 7:56 AM
Hi ,
I have a requirement for one of the Interfaces . the Input Structure is given below
<Material_Classification>
<Characteristic_Name>CUBE_PRICE</Characteristic_Name>
<Characteristic_Value>FAX 2033</Characteristic_Value>
</Material_Classification>
<Material_Classification>
<Characteristic_Name>CLUB_STATE</Characteristic_Name>
<Characteristic_Value>FRANCE</Characteristic_Value>
</Material_Classification>
</Material_Record>
</MT_MDMMaterialData>
As per the requirement if the Characteristic_Name endswith Value "STATE" then Output value (Characterstic value ==StateIndictor ) Ie "France" else should give a blank value to the stateindictor if Characteristic_Name not ends with Value STATE..
I used the If else then conditon to satstify the above requirement but the problem is in my mapping if i run the above test code
the Output i am getting is empty value . ie (StateIndictor==Empty Value) ie the if statement is checking the first leve "Characterstic Name " and sending the blank value as output instead of moving to the next Level where Chracterstic Name has a STATE value ...
can any one suggest me a better solution to get the result .
Regards,
Aziz khan ,
Hi,
There could be context problem. Check by adding SplitByValue(Each) after the condition. Also check if Name and Value fields are in the same context.
-Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried using the below UDF to satisfy the above requirement . let me know if My Syntax is correct with regard to the above requirement which i had explained .
while(var1.!endsWith("STATE"))
Input variable is classification Name
{
if(var1.endsWith("STATE"))
{
return true;
}
}
Let me know
Regards,
Aziz khan
Hi,
I guess, in the output u want something like this:
<Target>
<StateIndictor></StateIndictor>
</Target>
<Target>
<StateIndictor>FRANCE</StateIndictor>
</Target>
There is no need to creta a UDF, but still u need to use go with this:
Execution type: All values of a context, Input: a, b
if(a[0].endsWith("state"))
{
result.addValue(b[0]);
}
else
{
result.addValue("");
}
mapping:
Characteristic_Name
-
UDF----
StateIndictor
Characteristic_Value
Thanks
Amit
Thanks for the UDF ...!
but the UDF explains about the Length of the Var1 ie Charaterstic_Name
let me explain you my requirement ..!
INPUT Stracture
<Source>
<Material_Claffication>
<Charaterstic_Name>East_Cut</Charaterstic_Name>
<Charaterstic_Value>France</Charaterstic_Value>
</Material_Claffication>
<Material_Claffication>
<Charaterstic_Name>East_STATE</Charaterstic_Name>
<Charaterstic_Value>England</Charaterstic_Value>
</Material_Claffication>
</Source
according to Requirement the Target Stracture should be
<Target>
<StateIndictor></StateIndictor>
</Target>
<Target>
<StateIndictor>England</StateIndictor>
</Target>
But i am getting the Below Output as per my mapping useing the iFelsethen Condition along with EndsIf
<Target>
<StateIndictor></StateIndictor>
</Target>
<Target>
<StateIndictor></StateIndictor>
</Target>
The StateIndictor as Blank ....My if else statement is not able to check the second Charaterstic_Name condtion which endswith Value "STATE" to get the Output as "England" ....
Charaterstic_Name has 0..unbounded as occurence ..!
Let me know how to achive this ..Required target ..using UDF or any other means ..!
Regards,
Aziz khan
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.