on 07-25-2007 11:03 AM
The problem is that I need to share somehow data between different instances of the same mapping. Lets say that I need to include to the target field the number of mappings done so far, so I need to store the counter somewhere, so it will be avilable to the further mappings.
The GlobalContainer variables works only for the current mapping instance or for the whole mapping at all?
Another problem is that the mapping is JAVA-mapping, so I am not sure if I can use Global Variables from Java Sections.
Thanks for any solutions!
Any reason you cant just use an integration process? Then just use container operations to increment a counter. Would then give you additional control over how the counter is initialised if you want too.
Cheers
James.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello J, thanks a lot for your reply!
So you are saying, that if I will define a variable in BPM, and than will increment it in cantainer, than it (variable) will be the same for all instances of BPM. If, for example, two messages have came in very short period of time, and two instances of BPM processing those messages in parallel they will share the only one variable?
Or if, for example, I have one message yesterday, have increneted counter to one, and one message today, are you sure that the varibale will keep the value from yesterday?
Sound some kind of unrealistic to me. I will make some tests.
Thanks again for your reply!
Not quite.
You launch a BPM once, then use a receiver step within a loop to keep receiving, mapping then sending messages (you can use correlations to tie specific messages to specific BPM instances).
The variable you define will only be applicable to the current instance of the BPM, therefor if you launch multiple BPM's or the instance dies etc, it will be re-initialised. This might not be what you want, hence I only offer it for suggestion as an alternative
I've used this approach with a timeout branch to receive messages for x period of time then fire them off as a batch.
Hope that helps
if u had used global container in one mapping program u cannot refer or retrieve the value in another mapping program. yes it can been refrenced betwwen different instance of the same mapping program.
In java program why do u want to use global program when the variable declared in a java program can be made public to all the methods
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
say u have create 2 mapping program, the global container for mapping program A cannot be accessed in mapping program B but the container can be accessed at various instances(node levels) in mapping program A itself. if u need some data accessible across all mapping program then u need to make use of lookups where u can store the data in a DB table and later retrieve it in UDF and map accordingly. This way you address for global access
Message was edited by:
Prabhu S
I have only one mapping program. A first message comes, than the mapping program is called for the first time, and I set inside it some variable. When a second message comes the mapping program is called for the second time, and the variable which was setted in the first mapping program run is no longer exist in GlobalContainer object. This is the problem.
Can you please tell a little bit more about "lookups where u can store the data in a DB table". What is this?
Message was edited by:
Artsiom Anichenka
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.