on 04-14-2008 8:47 AM
Hello All,
I am using this thread as a reference for declaring a Counter for unique sequence number generation...
-
-> define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.
enter the following in the GlobalVariables Section
Integer counter =0;
-> define a user defined function (SeqGen let's say)
write the following code in it.
Integer seq = 0;
GlobalContainer globalContainer = container.getGlobalContainer();
a = globalContainer.getParameter("counter");
seq = globalContainer.getParameter("counter");
seq = seq + 1;
globalContainer.setParameter("counter",seq);
return a;
now use this user defined function (SeqGen)in all ur mappings to the sequence no of ur line items.
-
If u could just elaborate on creation of UDF.. on what are we goin to pass in the variable 'a'... while creating the UDF. ??
Harpreet..!!
Hi,
U can use standard counter function or index function.
Thanks,
Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi harpeet,
A UDF can be of two types a Simple UDF and Adavnced UDF.
This is a case of a simple UDF,
A simple UDF returns only 1 element as an output.
here 'a' is such an generated output. you can assign this to any numeric filed of ur target stucture
This UDf does not require any input Field from the message.
These functions are known as generating functions.
Hope this explains.
Reward points if useful.
Regards,
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here 'a' is the return variable.
the udf will genrate a seq num incrementally staring from 1...an d so.
the udf out put(seq num) has to map specified target field.
warm regards
mahesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.