on 05-19-2008 12:16 PM
Hi All,
Suppose in BPM I have 2 message mappings.
In first message mapping suppose I store my source xml filed value in global container.
Code:
public String setValue(String a,Container container){
String bp = a;
GlobalContainer g;
g = container.getGlobalContainer();
g.setParameter("BPNumber", bp);
return bp;
Now in 2nd Message Mapping I want bp value in target xml field:
public String getValue(Container container){
GlobalContainer g;
g = container.getGlobalContainer();
String str = (String) g.getParameter("BPNumber");
return str;
But I am getting null value in target xml field:
Pls suggest.
Hi Rack,
in you component controller.....
goto to the context tab.....
there you can create nodes and inside the nodes, you can create attributes...
now its a global variable.....
so go to your view context.....
just drag these nodes from the component controller to the view context.
it can be done to any number of views.
Reward points if this helps
Regards
Vani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Rack:
The term global is not real global: it is only global in terms of Message Mapping, in other words, the global vaiable is only for 1 message mapping.
In your case, you used two message mappings, the value can not be passed cross the message mapping.
In such case, you have define container variable to carry over the value, pass from one tranformation step to another.
Regards.
Liang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
By declaring the Global variable we can achive this.
Your said you are using two mappings, but you mentioned the UDF code.
what is your scenario and requirement can you explain elaborately ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
There is no way to pass variables across message mappings.
If you want to use the information from the first mapping in the second one, you can use 2:1 mapping and pass the first payload to the second mapping as well. Then you have an access to the fields of the first mapping.
The other way is to create some data type "container" and change your first mapping to 1:2 mapping. The second message will be of type "container" and you can put there any generated values you want. Then the second mapping should be 2:1 mapping getting the payload and the "container" message. Then you can use values from this "container" message in your second mapping
Best regards
Dmitry Yankovsky
I think we can use global container to access values in different UDF but in one mapping only.
Check
http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
GlobalContainer Object
This object enables you to cache the values that you want to read again when you next call any user-defined function in the same message mapping -- from above link
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.