on 11-27-2013 10:56 AM
hi,
i m using PI 7.31 and have a graphical map query.
In the INPUT file i am getting a field INP1 which will have dynamic value like - 1,2,3,4,5,6,7,8,9 or 10 or any number.
In the OUTPUT file depending on INP1 value OUT node needs to be created and OUT value should be OUT_1,OUT_2 etc.
Example-
(1) Input - INP1=2
Output should be ,since input value is 2, 2times OUT node should come 2 times with values - OUT_1 and OUT_2
(2) Input - INP1=4
Output -OUT node should come 4 times with values - OUT_1,OUT_2,OUT_3,OUT_4
if UDF is needed for it also ,please advise.
regards
Hi,
Did you get this worked out?
can you please pass your input and output xml if possible?
Regards,
Muniyappan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you need to explain the source and target structure again. can you paste the schema here?
I understood like below
source structure
A
B
then the count of the above context is 2 hence you need to generate two target nodes then use the below UDF
int count = 0;
int j =0;
for(int i=0;i<arr1.length;i++)
{j++;
if(j == Integer.parseInt(arr2[count])&& i <arr1.length-1)
{
result.addValue(arr1[i]);
result.addContextChange();
count++;
j =0;
}
else
{
result.addValue(arr1[i]);
}
}
Cheers,
Hidayat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I Hope this would address your needs
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 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.