on 04-01-2009 1:05 PM
Hi Experts,
I have this xpath condition, however the processing failed.
(/p1:MT_extGoodsReceipt/GoodsReceipt/GoodsReceiptDetail/ListOfGoodsReceiptItemDetail/GoodsReceiptItemDetail/GoodsReceiptLineItemReferences/ListOfReferenceCoded/ReferenceCoded[[ ReferenceTypeCodedOther='LIMIT_VALUE']], EX)
(/p1:MT_extGoodsReceipt/GoodsReceipt/GoodsReceiptDetail/ListOfGoodsReceiptItemDetail/GoodsReceiptItemDetail/GoodsReceiptLineItemReferences/ListOfReferenceCoded/ReferenceCoded[[ ReferenceTypeCodedOther!='LIMIT_VALUE']], EX)
I have one source (xml) and two target idoc interfaces. The target interface is determined based on the defined condition.
The structure of the source has multiple <ReferenceCoded>, for instance:
<ReferenceCoded>
<ReferenceTypeCoded>AA</ReferenceTypeCoded>
<ReferenceCoded>
<ReferenceTypeCoded>Other</ReferenceTypeCoded>
<ReferenceTypeCodedOther>BB</ReferenceTypeCodedOther>
</ReferenceCoded>
<ReferenceCoded>
<ReferenceTypeCoded>Other</ReferenceTypeCoded>
<ReferenceTypeCodedOther>CC</ReferenceTypeCodedOther>
</ReferenceCoded>
<ReferenceCoded>
<ReferenceTypeCoded>Other</ReferenceTypeCoded>
<ReferenceTypeCodedOther>LIMIT_VALUE</ReferenceTypeCodedOther>
</ReferenceCoded>
Since we have LIMIT_VALUE then the condition is TRUE; however the processing fails. Please your advise.
Thank you very much!
Regards,
Lex
Hi,
do not use the bracket
//ReferenceTypeCodedOther='LIMIT_VALUE' EX)
Regards Mario
Edited by: Mario Müller on Apr 14, 2009 8:22 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi lex,
You may try this.
1.First receiver give the condition.
(/p1:MT_extGoodsReceipt/GoodsReceipt/GoodsReceiptDetail/ListOfGoodsReceiptItemDetail/GoodsReceiptItemDetail/GoodsReceiptLineItemReferences/ListOfReferenceCoded/ReferenceCoded[ ReferenceTypeCodedOther='LIMIT_VALUE'], EX)
2.The second receiver:
select continue message processing with the following receiver.Give the Business system name or service name.
Regards,
Prakasu.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lex,
Alternatively, you could opt to use multi-mapping. Then as for the conditions, you could make a queue type udf that concats all values of the "referenceTypeCoded", searches for the string "LIMIT_VALUE" and returns a true or false. This in turn activates the type of IDOC you will be using.
Hope this helps,
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
did you check the multiline option in the condition editor?
More on xpath - /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lex,
what's your objective?
If there is an <ReferenceCoded> tag with 'LIMIT_VALUE' in the source XML, what should be done?
Just one particular interface should be called? Or you want to split the XML in a way that the tags with the 'LIMIT_VALUE' go to one interface and the other tags go to other interface?
Also, notice that for synchronous interfaces you must have at most one true sentence.
Hence, you need to make sure that one condition is always true and the other is always false.
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Henrique,
The source xml structure is ...
/extGoodsReceipt/GoodsReceipt/GoodsReceiptDetail/ListOfGoodsReceiptItemDetail/GoodsReceiptItemDetail/GoodsReceiptLineItemReferences/ListOfReferenceCoded/ReferenceCoded/ReferenceTypeCodedOther
Only one target interface is called once the condition is satisfied and no splitting of xml message.
We tried the following xpath condition...
/extGoodsReceipt/GoodsReceipt/GoodsReceiptDetail/ListOfGoodsReceiptItemDetail/GoodsReceiptItemDetail/GoodsReceiptLineItemReferences/ListOfReferenceCoded/ReferenceCoded[ReferenceTypeCodedOther='LIMIT_VALUE'] , EX)
and it works! Once this condition is satisfied, the first target interface is executed
For the second condition, is there a way to negate the whole first condition? Sort of negating the EX operator.
Thanks!
Regards,
Lex
Right! "!='LIMIT_VALUE'" should be OK; however two idocs will be generated. We only need to generate one Idoc per xml message - 1source(xml):1target(idoc).
Because in the source XML we might have a scenario that looks like this...
<ReferenceTypeCodedOther>AA</ReferenceTypeCodedOther>
<ReferenceTypeCodedOther>BB</ReferenceTypeCodedOther>
<ReferenceTypeCodedOther>LIMIT_VALUE</ReferenceTypeCodedOther>
Regards,
Lex
Hi Lex,
Im not really sure if it's possible to negate the EX operator.
The problem about Shabarish's sugestion is that if there're two tags, one with LIMIT_VALUE and one with a different value, this condition will also be true.
So you'll have two true statements, and your requirement won't be met.
You could try to play around with XPath operators, e.g. count() and try to use something like:
count(/x/y[z = 'value']) =/= 0
or
count(/x/y[z = 'value']) = 0
Check this: http://msdn.microsoft.com/en-us/library/ms256103(VS.85).aspx
Best,
Henrique.
an alternative i can suggest is option of setting a flag value in the mapping itself.
something like this;
/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
this will give u the flexibility to check all your conditions in the mapping itself.. which is rather easier than the checks in xpath.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
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.