Xpath condition
Hi,
I need an xpath to convert to uppercase for
<Empid>
<Name>
<FirstName>demo</FirstName>
<LastName>test</LastName>
</Name>
<Empid>
Need to check the element FirstName contains Demo ( by converting it to uppercase)
I used various type like these:
/Empid/upper-case(FirstName) = 'DEMO'
/Empid[upper-case(FirstName) = 'DEMO'] ex
but when did test configuration ID got error in receiver determination, somebody please suggest a suitable path...to test this condition.
Thanks
Hello,
Try using the below condition:
/Empid/Name[upper-case(FirstName) = 'DEMO']
OR
/EMPID/Name[translate(FirstName,'demo','DEMO')='DEMO']
-Rahul
Similar Messages
-
** XPath condition not work well in Receiver Determination.
Hi,
My scenario is having 3 receivers. I have 'Student' is the data type. I use the same data type for Source & Target Message Types. Requirement is I have to send
1) only records which are having SCOURSE = 'BE' to receiver 1
2) only records which are having SCOURSE = 'MCA' to receiver 2
3) only records which are having SCOURSE = 'MBA' to receiver 3
My Input.xml file contains the following records.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:THIRD_MT_OB xmlns:ns0="http://ganesh_third">
<STUDENT_INFO>
<ST_ID>10020</ST_ID>
<SNAME>Raja</SNAME>
<SCOURSE>BE</SCOURSE>
<SFEES>3000</SFEES>
<SMARKS>1200</SMARKS>
</STUDENT_INFO>
<STUDENT_INFO>
<ST_ID>10021</ST_ID>
<SNAME>Ram</SNAME>
<SCOURSE>MCA</SCOURSE>
<SFEES>3000</SFEES>
<SMARKS>1200</SMARKS>
</STUDENT_INFO>
<STUDENT_INFO>
<ST_ID>10022</ST_ID>
<SNAME>Ram</SNAME>
<SCOURSE>MBA</SCOURSE>
<SFEES>3000</SFEES>
<SMARKS>1200</SMARKS>
</STUDENT_INFO>
</ns0:THIRD_MT_OB>
I set the Xpath condition in the Receiver Determination Step and add the 3 receivers for against the conditions.
Our problem is, If we send the single record in the input file, the corresponding receiver is selected correctly and we get the output file for that receiver. But, if we send the all combination of records (MCA,BE,MBA) 3 receivers are selected and the 3 output files we get. But, the three files are having the all records (MCA,BE,MBA). Instead, we want the first file should only have MCA record, the 2nd file should only have BE record and finally the 3rd file should only have MBA record. That means each receiver should receive only one record for the above input.
Friends, I though it will work for the 'XPath Expression' against receivers in the Receiver Determination Step. But, it didn't work. (Records are not split up)
How do achieve this, friends?
Could you kindly help me to solve this problem.
Kind Regards,
Jeg P.If you are trying to split you input msg and send it to 3 different receivers using conditional receiver determination then it will not work. Once a condition is meet in the receiver determination then the entire msg is forwarded to the corresponding receiver, that is why when you have a single row in your input file which results in a single msg in XI the conditional receiver works. Now when you have multiple rows in your input file still only one msg is being created in XI for all the rows currently so all the conditions are being meet and the msg is forwarded to all the receivers.
If you are using FCC in the sender side then use the "recordset per msg" parameter to consider each row of your input file as a separate msg in XI and the rest will automatically fall in place.
Cheer's -
Xpath condition in interface determination
Hi all,
I have a scenario where i have two Interface mappings between same source and target. I need to define a condition based on if a field exists, then first one should be executed and if the field doesn't exists, then second.
How should i define a condition that if field doesn't exists, the second mapping should be executed.
Can any body please suggest.
Thanks,
Kalyani.Thanks for your replies . But this condition is not working for our requirement .
Below is our exact requirement.
Source structure is the xsd which we have imported into ExternalDefinition.This External Definition has 2 other external references(namespaces are also different).
The field which we need to check is in the external reference. This field is not visible in interface determination condition editor.
We have manually added the xpath condition in the interface determination.
1)The Xpath for EXIST condition looks like
(/p1:ABC_Responses/p1:ABC_Response/p1:ABCResponses/p1:ABCResponse/p6:Fault/p6:ID EX).
This is working fine.
2) The XPath for Not Exists condition looks like
(/p1:ABC_Responses/p1:ABC_Response/p1:ABCResponses/p1:ABCResponse/p6:Fault[not(p6:ID] EX).
This is not working.
Hope iam clear with the requirement now.
Edited by: kalyani uppari on Feb 11, 2010 10:30 AM -
XPATH condition in Receiver Determination in PI 7.1
Hi all,
I'm doing a Inbound 850 Scenario (no BPM involved)...based on the condition for (/LIST/S_ISA/S_GS/S_ST/S_BEG/D_353 = 00) its should either create ORDERS.ORDERS05 or create ORDCHG.ORDERS05 if (/LIST/S_ISA/S_GS/S_ST/S_BEG/D_353 = 04)...I'm giving the condition in interface determination and multiline selected in the Xpath editor
I'm using PI 7.1 and irrespective of the condition it always creats Orders.Orders05, I have 2 receiver agreements also for both receiving interfaces...
Any solution on how to debug?
Thanks,
Srini
Edited by: Srinivas Davuluri on May 12, 2009 10:56 AMI forgot to give the prefix...mistake from my side
-
BPM: XPath-Condition in Switch Step
Hello,
I have the following requirement in BPM.
There is a switch step with five branches, and I have the following document structure:
<Root>
<Segment>
<Docnum> 12345 </Docnum>
</Segment>
<Segment>
<Docnum> 12346 </Docnum>
</Segment>
</Root>
The switch condition is done based on the last digit of the first Docnum element. So in this case the value would be 5.
I tried to work with a substring as the total number of digits of docnum is always 5.
How would an XPath expression look like to retrieve the substring from the first <Segment> element? I tried different combinations but none of them really worked.
Example what I tried: p1:/root/Segment[1]/substring(docnum, 4,1)
Any advise on this?
Thank you very muchTry this...
substring(/p1:/root/Segment[1]/docnum,4,1)
for more info see
http://www.w3.org/TR/xpath
Message was edited by:
Alex -
Xpath condition in Receiver Determination
Hi Gurus -
I want to implement a condition, For QUALF=01 AND ORGID=ORG1, then only it should go to some receiver and otherwise some other Receiver.However when i implement this using context object/Xpath, The condition happens to be true which should not be true for following structure as No segment contain "QUALF=01 AND ORGID=ORG1".
It happens to be true probably because one of the QUALF=01 and one of the ORGID=ORG1, however i doesnt want like that
- <E1EDK14 SEGMENT="1">
<QUALF>01</QUALF>
<ORGID>ORG2</ORGID>
</E1EDK14>
- <E1EDK14 SEGMENT="1">
<QUALF>02</QUALF>
<ORGID>ORG1</ORGID>
</E1EDK14>
- <E1EDK14 SEGMENT="1">
<QUALF>01</QUALF>
<ORGID>ORG2</ORGID>
Expert opinions are invited.
Regards.
Jeet,Hi Jeet,
Your Condition should be as
<b>/p1:ORDERS05/E1EDK14/QUALF=01 AND /p1:ORDERS05/E1EDK14/ORGID=ORG1</b>
and not as <b>(/p1:ORDERS05/E1EDK14[QUALF="01" and ORGID="ORG1"] EX )</b>
To acheive this,
1. Go to condition editor in the RD
2. Insert a new expression clicking on the + button at the top left.Now u will find the operation AND between the two condition
3. In both the condition line select the respective XPath of the node and specify the matching condition.
It should look like..
Left Operand OP Right Operand
/p1:ORDERS05/E1EDK14/QUALF = 01 AND
/p1:ORDERS05/E1EDK14/ORGID = ORG1
Regards
San -
OSB Split Join Repeat Until Question On XPath Condition
I'm trying to use OSB File Transport to stream a very large XML document file into a service which will split the file into very many small XML documents. So, given a file like:
<BookStore>
<Book></Book>
<Book></Book>
... (many more books)
</BookStore>
In the split join I want to use a 'repeat until' to process each Book until there are no more Books in the BookStore. Here's my question: What is the correct XPath expression to use as the Repeat Until terminating condition? (I'm an XPath novice.)
Thanks for your help!!!Hi,
Based on what I understood, you should be using a for each loop with the conditions as follows:
Within the Split Join flow
for each ( counter variable from 1 to Count (xpath of book) ) --> For my example it was count($request.parameter/sjpoc:Orders/sjpoc:Order) replace this with your xpath.
- do your logic
Snapshot just in case @ http://dl.dropbox.com/u/19901533/sj_foreach_snapshot.JPG
Based on this the split and join would happen for n (based on count) number of Book tags.
Let me know if my understanding is incorrect.
Thanks,
Patrick -
XPATH: Condition with substring
Hi everybody,
in BPM we got several branches.
Regarding a condition that refers to the message-interface we want to process the different branches.
My question is:
Is it possible to use substring function in condition editor.
Sample: Value is >EXCP_ThisIsTheExceptionText<
I just want wo know, if the value starts with EXCP_
Regards Mariohi,
sure it's possible
you jut need to specify it as XPATH
as shown here:
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
you can use any xpath function like this so it's a pretty handy tool:)
Regards,
michal -
XPATH Condition to check if an element does not exists
Hi Experts,
I want to know the XPATH condtion to check if an element does not exist.
I have searched the forum but could not find a relevant discussion.
Please help.
Regards,
Ravi kanth TalaganaLeft Operand should be your element on which you need to implement the condition
Middle Operand (Condition column) should be Not Equal
Right Operand should be constant EX
I used this condition in RD to route a file from source to target if some element is not present in the file....not present means not even a blank entry for the element....
Check it and let me know the result.
Regards,
Abhishek. -
Hi
While selecting the receiver in receiver determination i am getting the below message.
Message interface does not exist in any software components installed on this business system" it says that schema is not correct?
becuase of this in my Xpath i m not able to see the whole structure.
Am I missing somthing?
chiragIt is just a warning that says your software component is not installed on source business system in SLD. And that is why source structure is not displayed in condition editor.
You can manually write the XPath, like /p1:MT_Src/Node1 and it should work -
Xpath condition not working for determining receivers
hello all
am writing a xpath expression for a simple structure
<doc>
<status>
<id>
</doc>
status is attribute field.and will have value 'error' and some other value for no error. I want to choose one receiver if error and other receiver if no error
so I wrote an xpath expression
/Doc[@status='Error'] EX --> Error receiver
count(/Doc[@status='Error']) = '0' --> no error receiver
it was working couple of days ago but suddenly stopped working
whats going on? thx
mikeBut xpath is not working properly..
Are you using this in the condition editor of Interface Determination (it should not be a cause of concern though)
Can you confirm that the condition that you have specified is proper ....does it work when you specify only one condition?
Regards,
Abhishek. -
Hi Experts,
I am stucked with a condition in XPATH which is not executing. I want to use substring function in the Expression Editor. In the source structure field IDTNR at path /ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR if the field value of IDTNR starts with a D(for eg DADHJI) then I have to block this particular message or else(eg ASHDJKKD) pass for other values. I have tried following ways so far.
(ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[(substring(.,0,1) ='D')] EX )
/ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNRhttp://not(starts-with(.,"D"))
substring(ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR,0,1) = 'D'
And also can some body please expalin what is the meaning of http:// in the second statement as also in thread Re: Using substring in the XPATH expression for Receiver Determination
Requesting you , please dont forward the links or blogs.
Thanks in Advance.
SudhirHi Sudhir
I think
substring(string,start,length) or substring(string,start)
should work on this.
Moreover try with
contains(String,contain string) or starts-with(String, Starts with String)
I am not sure if it get problem with escape sequences in String. Check again.
You can also use
substring-before(String, String) or substring-after(String,String)
Thanks
Gaurav -
I am trying to SelectSingleNode based on three conditions. ID and Type apply only to the outer node. But Context could apply to either the outer node or an inner node. So these should be selected...
<Node id="SomeID" type="SomeType" context="UseThis"></Node>
<Node id="SomeID" type="SomeType">
<Section context="UseThis"></Section>
</Node>
<Node id="SomeID" type="SomeType">
<Section context="UseThis"></Section>
<Section context="DontUseThis"></Section>
</Node>
But neither of these would...
<Node id="SomeID" type="SomeType" context="DontUseThis"></Node>
<Node id="SomeID" type="SomeType">
<Section context="DontUseThis"></Section>
</Node>
I am doing this now with two IFs. The first selects for ID & Type, and the second has an OR and two SelectSingleNodes to look for Context in either possible place. I just wonder, is there a more graceful XPath construct that handles this in a single
simple IF?
GordonDave, I think I have to use a flavor of my other logic anyway, and indeed I fear I may have a flaw in my xml structure. Given this, which is an example of the second condition in my original XPath pattern, I need to select only the nodes directly below Section.
All the Var & Value, Source & Destination stuff needs to be handled in the next function. But when my SelectNodes ends with /* I of course get all the layers below. My fear is that I need to use a single Node name for all these, like Task, so my selection
can only grab Tasks. Or I need to add a Task attribute. Because thus far I can't grok how to make an XPath pattern stop at a particular level down the tree. A single pattern like you show that could grab either all the nodes one level below Package when the
Package context is MachineConfig or all the nodes within the Section who's context is MachineConfig, would be ideal. Have I gone down a path where XPath is not going to get er done?
EDIT: Pretty sure the limitation is not in XML, but perhaps in SelectNodes. Or perhaps in my head, since it is midnight in Berlin and I had a few beers earlier and perhaps this is one that needs a fresh brain. And so, to bed. Probably to dream of Axiis,
as that looks promising as a solution. ;)
<Package id="RVT_2014" type="Rollout" Product="RVT2014">
<Section context="MachineConfig">
<Install id="Revit_2014" type="1">%Location_Root%\deploy\Autodesk\2014\Deployments\Revit2014\Img\Revit2014.ini</Install>
<Rollout>RVT_2014_WU1</Rollout>
<AddEnvironmentVariable>
<Var>ADSKFLEX_LICENSE_FILE</Var>
<Value>%Location_FlexLMServers%</Value>
</AddEnvironmentVariable>
<Copy id="RevitINI">
<Source>%Location_Root%\revit\2014\Beck Support Files\DAL-INI\Revit.ini</Source>
<Destination>%RVT2014_UserDataCacheINI%</Destination>
</Copy>
<DisableCommCenter>True</DisableCommCenter>
<CreateFolder id="RevitLocalFolder">C:\Revit Locals</CreateFolder>
<Delete id="Files">C:\msdia80.dll</Delete>
</Section>
<Section context="user_initialization">
<Copy id="SeedUserAppData">
<Source>%Location_Root%\revit\2014\Beck Support Files\DAL-UDC</Source>
<Destination>%Product_UserAppDataRoaming%</Destination>
</Copy>
<AddTaskbarShortcut>%Product_DefaultShortcut%</AddTaskbarShortcut>
<AddPlace>
<Name>Faves</Name>
<Value>C:\Users\%UserName%\Links</Value>
</AddPlace>
<AddPlaceSet>RVT_2014_Places</AddPlaceSet>
<Copy id="RAC 2013 Keyboard Shortcuts">
<Source>RAC2013_UserAppData_Roaming\KeyboardShortcuts.xml</Source>
<Destination>%Product_UserAppDataRoaming%</Destination>
</Copy>
<PinShortcut>%ShortcutPath%\%DefaultShortcut%</PinShortcut>
</Section>
</Package> -
Fault policies locaton and test xpath conditions not working.
I cant place fault policies files in a non mds location or the composite directory.
For example it does not work with an /opt/...... server path in the composite.xml property.
Also, I can't get working xpath test expressions like this:
<condition>
<test xmlns:elem="http://na.telefonica.com/elementoscomunes">$fault.fault0/elem:AREA_ERROR/ErrorType = "F"</test>
<action ref="reintentos-neon"/>
</condition>
In jdeveloper, the part is "fault0", and the subelements are like i've showed, but the condition never matches.
I saw in a forum that the sintax was $fault.nameofpart/xpathexpression, but doesn't seem to work. I've tried lots of permutations of the syntax, and also with 'F' instead of "F".
¿Any Idea?This is the exception in the server GUI
<fault>
<bpelFault>
<faultType>1</faultType>
<OBA_Par_Alta_AveriaFault>
<part name="fault0">
<elem:AREA_ERROR>
<ErrorID>8888</ErrorID>
<ErrorType>F</ErrorType>
<ErrorDesc>Afsafds</ErrorDesc>
</elem:AREA_ERROR>
</part>
</OBA_Par_Alta_AveriaFault>
</bpelFault>
</fault> -
XPATH condition in receiver determination.. Sum one of the filed
Hi,
This is my input payload.
segment "Record" will be coming multiple times.
<ns:MT_Account xmlns:ns="urn:com.statement">
-<BalanceRecs>
- --<Record>
<field1>CUA</field1>
<field2>0.00</field2>
<field3>324612.28</field3>
<field4> LTD</field4>
-----<numRecs>0</numRecs>
</Record>
--- <Record>
<field1>CUb</field1>
<field2>0.00</field2>
<field3>324612.28</field3>
<field4> LTD</field4>
<numRecs>2</numRecs>
</Record>
--- <Record>
<field1>CUc</field1>
<field2>0.00</field2>
<field3>324612.28</field3>
<field4> LTD</field4>
<numRecs>0</numRecs>
</Record>
</BalanceRecs>
Requirement:
I need to calculate the sum of field "numrecs".
If the sum is 0, then pass to BPM(IP_BPM)
If the sum is > 0 then pass to System B.
I tried using the below blog from shabarish..
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
/p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) = 0] EX --> BPM
/p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) > 0] EX --> SystemB
Is there anything im missing .. kindly suggest.
Thanks
Deepthi.Hi Mark,
It is working only for one receiver.
i mean
<numRecs>0</numRecs>
<numRecs>0</numRecs>
<numRecs>0</numRecs>
The message is going correctly when the sum value is 0. ie to BPM.
<numRecs>0</numRecs>
<numRecs>2</numRecs>
<numRecs>0</numRecs>
OR
<numRecs>2</numRecs>
<numRecs>0</numRecs>
<numRecs>0</numRecs>
When I pass the above payloads, it is going to both the receivers.
Since the total is 2, it should go only to systemB
Any idea?
This is working perfectly for enhanced receiver determination. I dont want to use enhance version for this simple case.
Maybe you are looking for
-
How to transfer data from an Intel Mac with tiger to PPC MAc with Panther ?
Hello, I have an old iMAc g5 1.6Ghz (PPC) that I just upgraded (memory and hard disk) as I wish to use it to back up all my files and for video. When I tried to tansfer all my files from my new intel Macbook using firewire mode, it did not work. It s
-
Passing a parameter to a method in the dataTable's value attribute
Hi, I'm brand new to JSF, so I might be overlooking something really simple. I'm trying to use a dataTable to display data from a database. It works fine until I try to pass a parameter to "#{customer.all}". My backer bean is ready (or so I believe)
-
hello, I have a table with 7 columns, 6 columns are of datatype of VARCHAR2/DATE/NUMBER, one column is of datatype SYS.XMLTYPE. I am trying to insert one record into the table. The insert script is as below: INSERT INTO t1 VALUES (234556789,1045,0,SY
-
I tried installing Adobe Premiere, and a notifcation popped up saying "update was successful but there were problems" and then told me that in order to fix any bugs I would need to update the app. I tried updating it but every time I try it says "upd
-
I have been trying to update for months now. The version I have is 10.6.3.25.