on 02-23-2007 7:51 AM
I have a scenario where I am taking one source file and based on certain conditions writing one or two target files... Now I have it configured quite nicely the only problem is that even when the condition is to only write one file the second file although blank is still written and coming with the values.
<xml version="1.0" encoding="UTF-8" ?>
<ns1:Messages xmlns:ns1="http://sap.com/xi/XI/SplitandMerge">
<ns1:Message1/>
</ns1:Messages>
I noticed that these only appeared once I started to change the occurence of my message type in the message mapping to 0 to unbounded (NOTE I HAVENT YET CHANGED THE OCCURENCE IN MY INTERFACE MAPPING).
I had to include this header in my outbound payload in order for me scenario to work annd now I it is always coming even when thhe message type is not written... Is there a way around this??
Hi,
In outbound side while executing the scenario, dont give <messages>, <message1> elements. Just remove those two elements from the payload and give the input.
Regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
first make your msg mapping and interface mapping have the same occurance of 0..unbounded
yes, use your source condition on source node which decide whether second target file needs to be generated.....then output of this condition should be either true or false.......then use creatif function......then map it to target message1 node.
Thanks,
Rajeev Gupta
OK I have nearly solved it thanks to rajeev...
One problem remains....
My conditions only work if it falls within the first occurence of the item...
Basically my conditions are createif and it is to created if Error = True in one of my items...
So this works when there is an error in the first item but does not when an error occurs in like the 2nd or 3rd iitem...
I think I need a function to sort or look through the entire queue to see if error occurs anywhere in the queue because at the moment it is only looking at the first line of the queue so even if an error occurs later if there is no error in the first item then the target will not get written correctly...
Could someone help? Is there a standard function for this? or Could someone give me a UDF that can do this?
by the way I have already played with the context changes.....
So basically I want a function that can look through an entire queue and see whether the value True occurs anywhere... if it does occur then the result should be True else False
hi ,
pass this as input to ur UDF as context.
in UDF take the input values int to string array and loop the string array and check if it equals to true or until end of the all values and stores this values into result string and pass it output which will have true or flase.
Regards
Sreeram.G.Reddy
Thanks again Rajeev... I think that should work... but the problem is that our mock up system is only SP9 and hence doesnt have a sort function....
I think this will work when it comes to our development system which is PI7 but we have to do the Proof of Concept on the SP9 system...
Could someone please give me a UDF that does this function?
pass this as input to ur UDF as context.
in UDF take the input values int to string array and loop the string array and check if it equals to true or until end of the all values and stores this values into result string and pass it output which will have true or flase.
for(int i=0; i<input.length;i++)
{
if (input<i>== true)
{
string str= "true";
list .addValue(str);
}
}
str= "flase";
list .addValue(str);
more of this sort not exactly the same code
Regards
Sreeram.G.Reddy
Message was edited by:
Sreeram Reddy
HI,
Did yu checked ????
See here condition is it should chekc the value in the entire queue if it is existed the true or fales..
--first you have to change the input node context to its parent node.. (The input node occurrences should be 0..unbound)
--UDF -- iam checking the input list with the first value..
Input node -- (with change context)-- UDF -- target node..
String XYZ = node[0];
boolean ret = true;
for (int i=0;i , node.length;i++){
if (!node<i>.equals(XYZ)){
ret = false;
}else
{
ret = true;
}
result.addValue(ret);
}
Source code has syntax error: /usr/sap/MXA/DVEBMGS68/j2ee/cluster/server0/./temp/classpath_resolver/Map4af440a0c32111db9dd100306e0359e9/source/com/sap/xi/tf/_MMT_INT_RECV_ERROR_.java:87: cannot resolve symbol symbol : method length () location: class java.lang.String[] for (int i=0; i<a.length(); i++){ ^ /usr/sap/MXA/DVEBMGS68/j2ee/cluster/server0/./temp/classpath_resolver/Map4af440a0c32111db9dd100306e0359e9/source/com/sap/xi/tf/_MMT_INT_RECV_ERROR_.java:88: cannot resolve symbol symbol : method a (int) location: class com.sap.xi.tf._MMT_INT_RECV_ERROR_ if (a(i) =="true") ^ 2 errors
This is the error I get and this is the code
for (int i=0; i<a.length(); i++){
if (a(i) =="true")
result.addValue("true");
}
result.addValue("false");
Rajeev I now get
/usr/sap/MXA/DVEBMGS68/j2ee/cluster/server0/./temp/classpath_resolver/Mapecfd01b0c32211dbc8ac00306e0359e9/source/com/sap/xi/tf/_MMT_INT_RECV_ERROR_.java:91: illegal start of expression result.addValue("false");> ^ /usr/sap/MXA/DVEBMGS68/j2ee/cluster/server0/./temp/classpath_resolver/Mapecfd01b0c32211dbc8ac00306e0359e9/source/com/sap/xi/tf/_MMT_INT_RECV_ERROR_.java:91: ';' expected result.addValue("false");> ^ 2 errors
Im sorry to be such a pain but I really need to get this working please help...
HI,
Explain clearly your requirement ...
Regards
Chilla..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
map Messge 1 node to such a condition from source system which determines that whether the second target file needs to be generated......after this condition in graphical mapping put a creatif function .....then map it to Message1 node of target msg.
Then your second target file will not be generated.
Thanks,
Rajeev Gupta
Message was edited by:
RAJEEV GUPTA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have u changed the occurence in the MM? can u post a sample payload and breif more on ur scenario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
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.