on 04-08-2011 7:03 AM
<Empid>
<ID>
<No>12</No>
</ID>
<Name>
<FirstName>demo</FirstName>
<LastName>test</LastName>
</Name>
<Empid>
I have to check if the first occurence of FirstName in the Name node as Test1 then map to target element.
Somebody pelase help me with the mapping for this condition.
Thanks
Problem occured again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below mapping:
FirstName> mapWithDefault> removeContext> CollapseContext>
Constant [Test1]> equalsS>
ifWithoutElse --> Target
FirstName-->
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Newa,
Map the fields like .. check if the field value is Test1 then send Test1 else make make that to fail.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have given an example of the input data
<Empid>
<ID>
<No>12</No>
</ID>
<Name>
<FirstName>demo</FirstName>
<LastName>test</LastName>
</Name>
<Name>
<FirstName>Test</FirstName>
<LastName>test</LastName>
</Name>
<Name>
<FirstName>demo1</FirstName>
<LastName>test</LastName>
</Name>
<Name>
<FirstName>Test</FirstName>
<LastName>test</LastName>
</Name>
<Empid>
If u see the above example, 2nd and 4th Name node have first name as Test but i should only consider the 2nd nodes First Name only,
please suggest with respect fo the above example.
Thanks
Hi ,
Chk this:
FirstName(change uts context to EmpId) -> sort-> splitbyvalue(ValueChanged) -> collapsecontext-----
-
equals---ifwthoutelse ---Target
Constant(Test)----
Mapping of "then" part:
FirstName(change uts context to EmpId) -> sort-> splitbyvalue(ValueChanged) -> collapsecontext---then
Thnaks
Amit
Hi,
i guess u can achive this using a simple UDF ( extractFirstName)
Execution type: All value of Queue.
for(int i =0;i<FirstName.length;i++)
{
if(FirstName<i>.equals("Test"))
{
result.addValue(FirstName<i>);
break;
}
}
Now map
FirstName ->extractFirstName->targetNode
Edited by: biplab das on Apr 8, 2011 1:01 PM
Hi,
I used a part of what you have suggested to map..
I changed the context of Firstname to <Empid >, then used collapse context and mapped its output toequals function , then use If without else and mappe it to target element.
<FirstName> ( context points to Empid) -
> Collapse Context -
>
Equals ---> IF
Test -
> -
> Target element
Then
Demo -
>
Thanks
Hi All,
With respect to the below example:
When i test the mapping , if Test comes in the First node then mapping with the output is fine
<Empid>
<ID>
<No>12</No>
</ID>
<Name>
<FirstName>Test</FirstName>
<LastName>lastname</LastName>
</Name>
<Name>
<FirstName>Demo</FirstName>
<LastName>test1</LastName>
</Name>
<Name>
<FirstName>Test</FirstName>
<LastName>test1</LastName>
</Name>
<Empid>
With respect to the above scenario , it works fine by taking the nodes with First Name as " Test" and mapping the target with the first occurence on Test
but when the file is :
<Name>
<FirstName>Demo</FirstName>
<LastName>lastname</LastName>
</Name>
<Name>
<FirstName>Test</FirstName>
<LastName>test1</LastName>
</Name>
The target is not getting filled.
Please suggest me with mapping...
Thanks
Newa
For this input file:
<Name>
<FirstName>Demo</FirstName>
<LastName>lastname</LastName>
</Name>
<Name>
<FirstName>Test</FirstName>
<LastName>test1</LastName>
</Name>
u want ur output something like this:
<Name>
<FirstName>Test</FirstName>
<LastName>test1</LastName>
</Name>
if that is the case then do ur mapping like this:
1)
FirstName(change its context to EmpId) -> sort-> splitbyvalue(ValueChanged) -> collapsecontext-----
-
equals-ifwthoutelse -removeContextName
Constant(Test)----
Mapping of "then" part:
FirstName(change uts context to EmpId) -> sort-> splitbyvalue(ValueChanged) -> collapsecontext---then
2)
FirstName(change its context to EmpId) -> sort-> splitbyvalue(ValueChanged) -> collapsecontext-----
-
equals---ifwthoutelse -
FirstName
Constant(Test)----
Mapping of "then" part:
FirstName(change uts context to EmpId) -> sort-> splitbyvalue(ValueChanged) -> collapsecontext---then
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.