on 05-23-2005 7:29 PM
Hello
I am having a scenario where I want to reuse the previous value of a map to calculate another value.For the same I tried container parameters in Message Mappings by using a simple Java function calling
container.getGlobalContainer().setParameter("test","value");
in another simple user defined java method I used container.getGlobalContainer().getParameter("test").
But my target value is coming as null.
Anybody knows how to use container methods to reuse values in Message Mappings??
Thanks in advance.
Regards
Rajeev
Hi Rajeev,
Have you tried my weblog?
/people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi
Regards,
michal
Message was edited by: Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Michal,
Thanks for the reply and I exactly did the same thing.
Suppose I am having 2 calculated fields C1 and C2 in target format I used
calculation->value->C1 and calcualation->value->container.getGlobalContainer().setParameter("test",value of C1);
and C2 as
(String)container.getGlobalContainer().getParameter("test")->calculation->C2
but the container value is coming as null.
(I tested by hardcoding value of container in earlier Java function but same result null values)
Regards
Rajeev
Hi,
but have you really tried my example?
did it work?
globalcontainer is a array of strings
this will enable you to get all of the values:
String[] b = (String[]) globalContainer1.getParameter("test");
for (int i=0; i<b.length; i++)
{
result.addValue(b<i>);
}
please try my example first, using container is very simple once you get it right
Regards,
michal
Hi,
There is also another method by which you can use values across different functions.
IN your Integration Builder, while you are in your Message Mapping, under the Design tab there is a small menubar.
Choose the rightmost option which is called Edit Java Sections. Using this you can use global variables which have a scope of the entire mapping. That means you can use them anywhere in the mapping.
Only remember to populate the variables with valid data before using them in other functions.
Let me explain with an example.
Once you click on Java sections, a smaller box opens up which has 3 fields.
Under the first field called Global Variables we can give something like:
String a;
Under second field called Initialization Section we can give:
a = " ";
Now we can use this variable a in any UDF to store some value and this same variable can be used again to retrieve the value.
This eliminates the need of using containers within the same mapping.
Glad to be able to help.
Regards,
Kshitij
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it doesn't work?
if not tell me:) maybe I can help
Regards,
michal
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 | |
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.