How to evaluate dynamic XPath expression in BPEL?

I have an xml file where I keep many settings for my BPEL process. At runtime, I read the file and I want to select values from it based on values in the process payload.
For example, imagine that the process payload is an order:
<order>
<header>
<id/>
<customer_id/>
<team_id/>
</header>
<items>
<item>
<id/>
<sku/>
<price/>
<quantity/>
</item>
</items>
</order>
Now, in my xml settings file, I have a section where I keep a mapping of "team_id" and "assignment_group", so that for each team id, I can select the appropriate group to whom a task should be assigned. The relevant section of the settings file will look something like this:
<assignment_groups>
<group team_id='0923230'>invoice_approvers</group>
<group team_id='3094303'>order_approvers</group>
<group team_id='3434355'>shipping_approvers</group>
</assignment_groups>
So, imagine I get an order input to my process where the team_id is '3094303'. Now I have to lookup the correct assignment group in my settings file.
So, I construct the dynamic XPath expression
/settings/assignment_groups/group[@team_id=3094303]
I know that this would evaluate to "order_approvers". However, even though I have the XPath expression in a BPEL variable, and I have my settings file as a BPEL variable also, I don't know how to execute the XPath expression against the settings BPEL variable to retrieve the correct value.
Any ideas appreciated.
Thanks,
Jack

James:
Thank you for the response. Incidentally, this is the very same document and section that I have been looking at for guidance. Specifically, the section titled "Dynamically indexing by Constructing an XPath at Run Time" on page 12-13.
I tried to do something similar to the example at the top of page 13:
<variable name="iterator" type="xsd:integer"/>
<assign>
<copy>
<from expression="concat('/invoice/line-item[',bpws:getVariableData('iterator'), ']/line-total')"/>
<to variable="xpath"/>
</copy>
<copy>
<from expression="bpws:getVariableData('input', 'payload',bpws:getVariableData('xpath')) + ..."/>
</copy>
</assign>
I am able to achieve the first copy operation to get my dynamic XPath into a BPEL variable and that's fairly straightforward. But I am unable to get the second copy to work. Specifically, I am not sure what to put in the second argument of the bpws:getVariableData function. I have tried many different combinations, but when I try to compile my program, I get the following compilation error:
Error:
[Error ORABPEL-10902]: compilation failed
[Description]: in "C:\code\TrainingWS\SampleGetSettings\bpel\SampleGetSettings.bpel", XML parsing failed because "org.collaxa.thirdparty.jaxen.expr.DefaultFunctionCallExpr".
[Potential fix]: n/a.
Thanks,
Jack

Similar Messages

  • How to evaluate dynamic user defined expression

    Hi All,
    I am looking for a solution where I can provide a GUI interface to user where one create their expression/formulas to get some results.
    The description goes like this: Suppose using GUI a user chooses an operator than he can choose it operands and again operands can be another expression. So I am thinking in a tree direction. Once a user is done I can read that expression in IN-ORDER to get the complete expression now my problem is how to evaluate this to get their results?
    Any ideas/solutions are welcome.
    Thanks in advance,
    Regards,
    Sandeep

    I could not get what did you mean by that? I am looking for some help if someone has better idea and architecture to implement it

  • [How-to] Evaluate dynamically an ABAP Constant

    Hello,
    Do you know how I can dynamically/programatically retrieve the value of a defined constant in an ABAP Class having the name of the Constant.
    I tried using the CLASSDESCR of the class to retrieve all attributes of type "constant", but I am not able to get the constant-value.
    Thanks for your help,
    Laurent

    Laurent Chavanis wrote:
    Hello,
    >
    > Do you know how I can dynamically/programatically retrieve the value of a defined constant in an ABAP Class having the name of the Constant.
    >
    > I tried using the CLASSDESCR of the class to retrieve all attributes of type "constant", but I am not able to get the constant-value.
    >
    > Thanks for your help,
    > Laurent
    Seems you are trying to do something like this, not sure though
    DATA:
      lv_const_name TYPE char30 VALUE 'ALIGN_AT_BOTTOM'.
    FIELD-SYMBOLS:
    <fs_cons_value> TYPE ANY.
    ASSIGN cl_gui_calendar=>(lv_const_name) TO <fs_cons_value>.
    IF sy-subrc IS INITIAL.
      WRITE :<fs_cons_value>.
    ENDIF.
    You can only access constants defined as 'Public' using the above technique.
    -Rajesh.

  • How to get dynamic boolean expression's value?

    String str = "((true)&((false)|true))";
    how to get the result of boolean from str?

    You will need to write a simple parser to parse the string and evaluate the expression.

  • Assistance with Xpath expression in BPEL

    Hi,
    Recently trained on BPEL but new to XPATH. I would like to ask your advice on how best to search an XML response like the one given below.
    As part of a BPEL flow I would like to obtain the EntityId of the CustomerService where AddonID=26 and CustomerServiceStatus=Active. There can be 0 (zero) or 1 such entries.
    I realise I could count the number of CustomerServices and then loop through each and test for the above criteria, but is there is better/more efficient way? - Thanks.
    <GetSubscriptionByMSISDN_OutputVariable>
    <part name="parameters">
    <GetSubscriptionByMSISDNResponse>
    <gsresp:GetSubscriptionByMSISDNResult>
    <resp:Result>
    <ErrorCode>0000</ErrorCode>
    <Success>true</Success>
    <ErrorMessage>Operación finalizada con éxito.</ErrorMessage>
    <ErrorMessageExtend/>
    </resp:Result>
    <gsresp:Subscription>
    <entity:EntityId>14372</entity:EntityId>
    <subs:Balance>0</subs:Balance>
    <subs:CreditLimitByDay>0</subs:CreditLimitByDay>
    <subs:CreditLimitByMonth>0</subs:CreditLimitByMonth>
    <subs:ConsumptionLimitLock>0</subs:ConsumptionLimitLock>
    <subs:ConsumptionLimitAlert>0</subs:ConsumptionLimitAlert>
    <subs:PricesPlan>1</subs:PricesPlan>
    <subs:PricesDescription>Pospago 1</subs:PricesDescription>
    <subs:StartDate/>
    <subs:SubscriptionStatus>InUse</subs:SubscriptionStatus>
    <subs:MSISDN>66666666666</subs:MSISDN>
    <subs:HasCreditOnTime>false</subs:HasCreditOnTime>
    <subs:Consumption/>
    <subs:CustomerServices>
    <entity:EntityId>61584</entity:EntityId>
    <addo:Description>Activation</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-08T04:40:22</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>28</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>61585</entity:EntityId>
    <addo:Description>Activation</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-08T04:40:32</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>30</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>61602</entity:EntityId>
    <addo:Description>Activation</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-08T04:39:48</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>1</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>61603</entity:EntityId>
    <addo:Description>Activation</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-08T04:40:11</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>26</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>61600</entity:EntityId>
    <addo:Description>Activation</addo:Description>
    <addo:ContractedTo>2008-09-08T03:40:11</addo:ContractedTo>
    <addo:ContractedFrom>2008-08-08T00:00:00</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Inactive</addo:CustomerServiceStatus>
    <addo:AddonId>26</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>74665</entity:EntityId>
    <addo:Description>Descp: Add Services</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-26T17:45:58</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>45</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>77493</entity:EntityId>
    <addo:Description>Descp: Add Services</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-30T11:14:28</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>108</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>77684</entity:EntityId>
    <addo:Description>Descp: Add Services</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-09-30T13:57:12</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>31</addo:AddonId>
    </subs:CustomerServices>
    <subs:CustomerServices>
    <entity:EntityId>91228</entity:EntityId>
    <addo:Description>Descp: Add Services</addo:Description>
    <addo:ContractedTo/>
    <addo:ContractedFrom>2008-11-06T13:43:01</addo:ContractedFrom>
    <addo:CustomerServiceStatus>Active</addo:CustomerServiceStatus>
    <addo:AddonId>36</addo:AddonId>
    </subs:CustomerServices>
    <subs:NobilllId>0</subs:NobilllId>
    </gsresp:Subscription>
    </gsresp:GetSubscriptionByMSISDNResult>
    </GetSubscriptionByMSISDNResponse>
    </part>
    </GetSubscriptionByMSISDN_OutputVariable>

    Hi Dietrich,
    Thanks for all the help, and your patience. I think you're getting me closer to figuring out what I should be doing. I can see now in the transformation mapper how I should have constructed the 'if' test, but I am still having an issue when I run the process. The problem being the wrong element in the array is being selected.
    Given the following input data to the transformation:
    <inputVariable>
         <part name="payload">
              <ns1:AnitBPELProcess1ProcessRequest>
                   <ns1:msisdn>640005076</ns1:msisdn>
                   <ns1:CustomerServiceCollection>
                        <ns1:EntityID>1966</ns1:EntityID>
                        <ns1:AddonId>26</ns1:AddonId>
                        <ns1:Status>Inactive</ns1:Status>
                   </ns1:CustomerServiceCollection>
                   <ns1:CustomerServiceCollection>
                        <ns1:EntityID>1991</ns1:EntityID>
                        <ns1:AddonId>26</ns1:AddonId>
                        <ns1:Status>Active</ns1:Status>
                   </ns1:CustomerServiceCollection>
              </ns1:AnitBPELProcess1ProcessRequest>
         </part>
    </inputVariable>
    ...and the following transformation (ony relevant part shown):
    <xsl:template match="/">
    <ns0:VoiceMailProductDetails>
    <xsl:if test='(/ns0:AnitBPELProcess1ProcessRequest/ns0:CustomerServiceCollection/ns0:AddonId = "26") and (/ns0:AnitBPELProcess1ProcessRequest/ns0:CustomerServiceCollection/ns0:Status = "Active")'>
    <ns0:VoiceMailKPNEntityId>
    <xsl:value-of select='/ns0:AnitBPELProcess1ProcessRequest/ns0:CustomerServiceCollection/ns0:EntityID'/>
    </ns0:VoiceMailKPNEntityId>
    </xsl:if>
    </ns0:VoiceMailProductDetails>
    </xsl:template>
    ...why does the transformation set the target field "VoiceMailKPNEntityId" to 1996, when the correct array element is the 2nd with an EntityID of 1991?
    I was expecting the 'value-of select' to have used the element that matched the criteria as it is within the 'if'.
    Thanks - Anit
    PS: I did also play round with using xpath query within an Assign to retrieve the EntityID, but this faulted with a "selectionFailure" error when my test data did not contain a row that met the search criteria.

  • How to pass dynamic logical expression to function module

    Hi,
    I'm using FM META_READ_TABLE as below:
    As mentioned above im using META_READ_TABLE FM to get company codes from CSKS table of ECC. Below is the code im using:
       DATA:i_opt type STANDARD TABLE OF RFC_DB_OPT, i_fld type STANDARD TABLE OF RFC_DB_FLD,
           i_res type STANDARD TABLE OF TAB512.
    Constants:   c_expr(72) TYPE c VALUE 'KOSTL EQ COST_CTR', c_fld(5) TYPE c VALUE 'BUKRS'.
      w_opt-text = c_expr.
    w_fld-FIELDNAME = c_fld.
    append: w_opt to i_opt,
            w_fld to i_fld.
    data i_control type STANDARD TABLE OF BBP_CONTROL_RECORD.
    **&&--Get Co code from ECC (CSKS table)
    CALL FUNCTION 'META_READ_TABLE'
      EXPORTING
        QUERY_TABLE          = c_table
    *   DELIMITER            = ' '
    *   NO_DATA              = ' '
    *   ROWSKIPS             = '0'
    *   ROWCOUNT             = '0'
        LOGICAL_SYSTEM       = v1_logsys
      TABLES
        OPTIONS              = i_opt
        FIELDS               = i_fld
        DATA                 = i_res
        CONTROL_RECORD       = i_control.
    however it is giving me 'Communication Error' while executing this piece of code. I guess the problem here is with passing query to i_opt table. obviously the way im doing this is wrong and it has to be dynamic. Could anybody please give me idea how to execute fm with dynamic query i.e., 'KOSTL EQ COST_CTR' where COST_CTR is cost center and an importing parameter to this.please advise.
    Rgds

    The "communication error" would seem more likely to be a problem with an RFC call - does 'META_READ_TABLE" call another function in the remote system?
    We don't have that function module here (is it SRM?) but you should be able to construct your dynamic "where" something like this (p_kostl is the variable in this example):
      data:
        l_where     type text72.
      concatenate
        'KOSTL EQ_'
        p_kostl      "variable
        into l_where.
      translate l_where using '_ '.  "replace underscore with space
    Jonathan

  • XPATH expression to get Array node

    Hi
    I have a problem with an XPATH expression in BPEL. I want to get to a particular node in the following result set ..
    <return xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns3="http://com.quion.taken.services/ITakenService.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:Array" ns2:arrayType="ns3:com_quion_dto_taken_BouwnotaVoorraadDTO[2]">
    <item xsi:type="ns3:com_quion_dto_taken_BouwnotaVoorraadDTO">
    <begunstigde xsi:type="xsd:string">Sjoerd</begunstigde>
    <datum xsi:type="xsd:dateTime">2005-10-31T23:00:00.000Z</datum>
    <bedrag xsi:type="xsd:string">1000.0</bedrag>
    <geldLeningId xsi:type="xsd:string">4.0</geldLeningId>
    <rekeningnummer xsi:type="xsd:string">1234</rekeningnummer>
    <notaId xsi:type="xsd:string">1.0</notaId>
    </item>
    <item xsi:type="ns3:com_quion_dto_taken_BouwnotaVoorraadDTO">
    <begunstigde xsi:type="xsd:string">Laszlo</begunstigde>
    <datum xsi:type="xsd:dateTime">2005-10-31T23:00:00.000Z</datum>
    <bedrag xsi:type="xsd:string">1.0</bedrag>
    <geldLeningId xsi:type="xsd:string">4.0</geldLeningId>
    <rekeningnummer xsi:type="xsd:string">5678</rekeningnummer>
    <notaId xsi:type="xsd:string">2.0</notaId>
    </item>
    </return>
    The first thing is that my variable in BPEL does not show the ïtem"level", it shows for example 'return/notaId'.
    However I can get to the second node by keying in
    EXPRESSION 1:
    bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[1]/notaId')
    No I want to dynamically determine the particular node instance. I do this as follows [copied from the Array sample]:
    EXPRESSION 2:
    bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')
    BPEL throws the following error
    assignNotaId (faulted)
    [2005/11/09 09:49:36] Updated variable "invokeTaskManager_initiateTask_InputVariable" More...
    <invokeTaskManager_initiateTask_InputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    <task xmlns="http://services.oracle.com/bpel/task">
    <taskId />
    <title />
    <creationDate />
    <creator />
    <modifyDate />
    <modifier />
    <assignee>jstein</assignee>
    <status />
    <expired />
    <expirationDate />
    <duration />
    <priority />
    <template />
    <customKey />
    <conclusion />
    <attachment />
    </task>
    </part>
    </invokeTaskManager_initiateTask_InputVariable>
    [2005/11/09 09:49:36] Error in evaluate <from> expression at line "172". The result is empty for the XPath expression : "bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')".
    [2005/11/09 09:49:36] "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown. less
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <part name="summary">
    <summary>empty variable/expression result. xpath variable/expression expression "bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')" is empty at line 172, when attempting reading/copying it. Please make sure the variable/expression result "bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')" is not empty.</summary>
    What is wrong with my expression 2?
    Thanks
    Jan Willem

    This Example works fine for arrays that are part of a WSDL message.
    But in 10.1.3.1 this does not work with a array that is part of an XSD declaration
    for Example XSD snippet
    <xsd:element name="itemList">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element maxOccurs="unbounded" minOccurs="1" ref="tns:Item" />
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    using the following in assign statement
    <copy>
    <from expression="concat('/ns9:itemList/ns9:Item[',string(bpws:getVariableData('index')),']')"/>
    <to variable="idxXpath"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('OutputItemList',bpws:getVariableData('idxXpath'))"/>
    <to variable="idx_item"/>
    </copy>
    gives a compiler error that is
    Error(176):
    [Error ORABPEL-10085]: invalid argument
    [Description]: in line 176 of "D:\OnlineShopping_1\bpel\OnlineShopping.bpel", the second argument "bpws:getVariableData("idxXpath")" for getVariableData is not a literal expression.
    [Potential fix]: Please correct the second argument, you might need to escape using single quote or " to make it literal.
    Can anyone site the reason for the same or a possible solution?
    Message was edited by:
    user607972

  • Dynamic XPath in XQuery or XQSE

    Is there a way to execute dynamic xpath expression in XQuery or XQSE, to do something like:
    declare xqse function tns:checkName($addrBook as element(),$name as xs:String ) as xs:boolean {
    declare $var as xs:String := "Address/Person[@name='" + $name +"']";
    ( : test if expression in $var returns not empty result when applied to $addrBook : )
    return value( $resultOfEvaluation) ;
    Thank You
    Edited by [email protected] at 03/13/2008 7:19 PM
    Edited by [email protected] at 03/13/2008 7:19 PM
    Edited by [email protected] at 03/13/2008 7:20 PM

    You haven't described why you want to do this - I suspect it is might be unnecessary/over-kill. Anyway
    1) in the interest of efficiency, DSP compiles and optimizes xquery, and therefore the xquery cannot be modified at run-time.
    2) the Filter api will let you apply filters, which effectively generate a new query, compile it and execute it. But you can only apply selections to elements that are exposed in the result
    The thing is that final client should not use mediator api, and i do not want to have an intermediate client that would use mediator. I don't understand what you mean here - how is the client supposed to to submit a response to DSP and get a result if it does not call DSP directly or indirectly?
    If the client already has the result, and you want to find something within that result, by far the most efficient way (aside from only returning that result in the xquery submitted to DSP), is to navigate through the DataObject with the get() methods. Firing up an xquery engine is a very expensive way to go through a DataObject - to do this you will need to serialize the DataObject into xml, create an XmlObject from that string, and then evaluate the xquery.

  • OAGIS Get XPath Expression

    We are using the OAGis schema and a client is sending us data in an expression instead of in the actual schema location using the <Get> portion of the schema.
    <Get uniqueIndicator="true">
          <Expression expressionLanguage="XPath">//Credit/FirstName[.="John"]</Expression>
          <Expression expressionLanguage="XPath">//Credit/LastName[.="Smith"]</Expression>
    </Get>What is the best way in BPEL to evaluate this xpath expression to set the FirstName to John and LastName to Smith? We are currently using a transform to parse each expression using XSLT into our database schema. It's not very elegant because it uses an if statement to check the path then has to parse out between the quotes then passes the value to the new var/schema.
    It seems like there should be a way to evaluate the XPath and set the path to the noted string.
    Thanks,

    This Example works fine for arrays that are part of a WSDL message.
    But in 10.1.3.1 this does not work with a array that is part of an XSD declaration
    for Example XSD snippet
    <xsd:element name="itemList">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element maxOccurs="unbounded" minOccurs="1" ref="tns:Item" />
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    using the following in assign statement
    <copy>
    <from expression="concat('/ns9:itemList/ns9:Item[',string(bpws:getVariableData('index')),']')"/>
    <to variable="idxXpath"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('OutputItemList',bpws:getVariableData('idxXpath'))"/>
    <to variable="idx_item"/>
    </copy>
    gives a compiler error that is
    Error(176):
    [Error ORABPEL-10085]: invalid argument
    [Description]: in line 176 of "D:\OnlineShopping_1\bpel\OnlineShopping.bpel", the second argument "bpws:getVariableData("idxXpath")" for getVariableData is not a literal expression.
    [Potential fix]: Please correct the second argument, you might need to escape using single quote or " to make it literal.
    Can anyone site the reason for the same or a possible solution?
    Message was edited by:
    user607972

  • Xpath expression substring or contains

    Hi ,
    I have this inbound source message
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <TO_DATA>
    - <item>
      <LINE>000012E3 ABCD 3I 20070911164941</LINE>
      </item>
      </TO_DATA>
      </rfc:Z_RFC>
    and two inbound interfaces
    condition is , if "ABCD" exists in the LINE field(type string) then the corresponding Interface mapping should execute.
    I know the exact location of "ABCD occurence so I can use either contains or substring functions.
    I tried /P1:Z_RFC/TO_DATA/item[substring(LINE,X,Y)="ABCD"] EX no right operand
    /P1:Z_RFC/TO_DATA/item[substring(LINE,X,Y)]= "ABCD"  with right operand
    substring((/P1:Z_RFC/TO_DATA/item/LINE),X,Y) = "ABCD"
    similarly I tried around with <b>"contains"</b> function too.
    but not able to apply exactly, I tried with different options looking at different blogs in SDN.
    so how should be the Xpath expression ?
    thank you.
    Babu

    yes,
    I have two different interface mappings in interface determination.  
    I have same sender RFC interface(outbound) and two different target interfaces  and so why I have two different interface mapping,MMs.
    sender and reciever systems are same in both cases.
    .................condition1--interface mapping1--
    sender -
    |--                                                                |--
    Receiver
    .................condition2--interface mapping2--
    >>>two dfferent interfaces one when the condition satisfies and other when the condition doens'tmacth...
    I know why you are asking this,if we have one interface map and two target interfaces then we need to go for enhanced interface determination.
    and need not to be just "substring" or "contains" function ,just any function will do.
    so any suggestion about the above scenario in ASCII diagram?
    thank you.
    Babu

  • Assigning JMS message in BPEL: The result is empty for the XPath expression

    Hi,
    My project, an Oracle BPEL 11g project, is reading an XML payload from a JMS queue. I would like to transform the message and assign the elements of the messages to other variables. But when I am doing that in the "assign" step, it raises an error: Error in evaluate <from> expression at line "63". The result is empty for the XPath expression : "/ns2:publishProject/payload/Message".
    Even though I can see the message payload in the Audit with all the values.
    To me it looks like a name space issue, but I could not find out how to correct it. Any hint will be a big help. Please let me know if you want to check the .xsd for the message.

    I publish a JMS message to a topic in one BPEL process and have another BPEL process read from the topic and start the flow. The problem I have is that the first process is writing fine to the topic, but the second process seems to be reading twice. I am seeing two instances of the second process in em.
    Can anyone help? I am using JDev 11.1.1.1.0
    Thanks

  • XPath Expression won't evaluate

    Hi,
    I am using the ora:doc() function to read an xml and XPath to get extract particular values from it. The issue is that the XPath expression doesnt evaluate correctly on Oracle BPEL process manager where as the same expression is being evaluated correctly in XMLSPY with XPath 1.0.
    The XML that I am trying to read is of the format
    <?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSpy v2006 U (http://www.altova.com)-->
    <n:CHNotification xmlns:n="http://www.example.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org
    C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELWorkspace\testXML\CallHomeNotification.xsd">
         <Notification id="String">
              <n:mailto>String</n:mailto>
              <n:mailcc>String</n:mailcc>
              <n:subject>String</n:subject>
              <n:body>String</n:body>
              <n:additionalbody>String</n:additionalbody>
         </Notification>
         <Notification id="String32432">
              <n:mailto>String</n:mailto>
              <n:mailcc>String</n:mailcc>
              <n:subject>String</n:subject>
              <n:body>String</n:body>
              <n:additionalbody>String</n:additionalbody>
         </Notification>
    </n:CHNotification>
    The function being used in OracleBPEL Process manager is
    ora:doc('${server_url}/xmllib/notification.xml', //Notification[@id="String"]/n:mailto)
    Can somebody please tell me where I could be going wrong?....It'll be a great help.
    Thanks,
    Gunjan

    I have the same problem posted in the constants discussion
    Hi
    I am trying out the xml file solution. I have places an XML-file in the xmllib location. The file has the following content :
    <?xml version="1.0" encoding="UTF-8">
    <bpel-domain>
    <preferences>
    <property name="defaultRentepercentage"> 0.3 </property>
    </preferences>
    </bpel-domain>
    In the Assign step in BPEL I do the following
    orcl:lookup-xml('http://localhost:9700/orabpel/xmllib/trials-properties.xml', '/bpel-domain/preferences/property[@name="defaultRentepercentage"]')
    The error I get when running this is the following
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:lookup-xml("http://localhost:9700/orabpel/xmllib/trials-properties.xml", "/bpel-domain/preferences/property[@name="defaultRentepercentage"]")", the reason is ExtFuncFunction.
    Please verify the xpath query.
    I have tried the xpath expression in XMLSpy, and there it seems to work
    Am i missing something ?

  • How to evaluate the dynamic condition string in PL/SQL ?

    Hello, I am solving the issue of checking and validating the event table.
    For Example, the event table namely "Contract_validated" contains some atts about a contract as follow:
    CONTRACT_VALIDATED (SEQ_ID, CO_ID, VALID_T, CHANGE_KEY, ATT1, ATT1_FROM, ATT2, ATT2_FROM, REASON, CHANGE_KEY_ORIG, ATT1_ORIG, ATT2_ORIG)
    In this table, the pairs (ATT1 and ATT1_FROM), (ATT2 and ATT2_FROM) must be compared to check whether the values are changed or not in the update event (change_key = U). If some records have change_key = U but the values does not change, I need to protocol and correct such records.
    The table name and attributes list could be dynamic, and will be provided as parameters. Therefore, I use Dynamic PL/SQL to generate the code to test the conditions between the values between the pairs columns for detecting the invalid event. However, I am stucking in testing the condition phrases because I can not evaluate the condition string in the SELECT statement. I can not use IF because parts of this condition string take the value from a record and collection type. Anyone has the idea how to evaluate the condition in such case, please give me instructions or recommendations (it could be other alternatives to solve the problems)
    Here is the code which generated from my Dynamic PL/SQL string, however, Oracle raise exception error at the EXECUTE IMMEDIATE v_sql command
    SELECT 'x' FROM DUAL WHERE (NVL(v_rec.ATT1, NULL) <> NVL(v_rec.ATT1_FROM , NULL) OR (NVL(v_rec.ATT2, NULL) <> NVL(v_rec.ATT2_FROM , NULL))
    E-0008: Unkown Exception raised in Loop. ORACLE:ORA-00904: "V_REC"."ATT2_FROM": invalid identifier
    vo_traced_list has type Table of VARCHAR2(2000), storing the atts list of table (CONTRACT_VALIDATED), it has value already from other procedure invocation.
    Here is the dynmic PL/SQL code generated dynamically depends on the table name, and attr list:
    DECLARE v_rec CONTRACT_VALIDATED%ROWTYPE;
    TYPE cv_type IS REF CURSOR;
    v_rec_cv CV_TYPE;
    v_cond VARCHAR2(4000);
    cond BOOLEAN := FALSE;
    v_exec VARCHAR2(1000);
    v_default VARCHAR2(10):= 'NULL';
    tk_val CONTRACT_VALIDATED.VALID_T%TYPE;
    pk_val CONTRACT_VALIDATED.CO_ID%TYPE;
    v_cnt NUMBER;
    BEGIN
    OPEN v_rec_cv FOR SELECT /*+ parallel(x,4) */ x.* FROM CONTRACT_VALIDATED x WHERE CHANGE_KEY = 'U' ORDER BY VALID_T;
    FETCH v_rec_cv INTO v_rec;
    IF v_rec_cv%NOTFOUND THEN
    Add_Log('Event_Validating',v_user,v_event_validated,'INFO','I-0001: No-Procession needed');
    ELSE
    BEGIN
    LOOP
    pk_val := v_rec.co_id;
    tk_val := v_rec.valid_t;
    v_cnt := vo_traced_atts_list.COUNT;
    v_cond := '(NVL(v_rec.'|| vo_traced_atts_list(1)||', ' || v_default || ') <> NVL(v_rec.' || vo_traced_atts_list(1)||'_FROM'
    ||' , ' || v_default || '))';
    cond := (BOOLEAN) v_cond;
    FOR v_i IN 2..v_cnt LOOP
    BEGIN
    v_cond := v_cond ||CHR(13)||CHR(10)||'OR (NVL(v_rec.'||vo_traced_atts_list(v_i)||', ' || v_default || ') <> NVL(v_rec.'||vo_traced_atts_list(v_i)||'_FROM'
    ||' , ' || v_default || '))';
    END;
    END LOOP;
    v_exec := 'SELECT ''x'' FROM DUAL WHERE '||v_cond;
    Add_Log('Event_Validating',v_user,v_event_validated,'INFO',v_exec);
    EXECUTE IMMEDIATE v_exec;
    /* Exception raised from here
    E-0008: Unkown Exception raised in Loop. ORACLE:ORA-00904: "V_REC"."ATT2_FROM": invalid identifier
    It seems that Oracle does not understand the dynamic reference v_rec.ATT2_FROM, v_rec.ATT2,... to test the condtion
    IF SQL%ROWCOUNT = 0     THEN -- condition is false ==> traced attributes does not changed
    -- update the REASON = 4 - not interested event
    v_exec := 'UPDATE CONTRACT_VALIDATED SET REASON = 4 WHERE CO_ID = '||pk_val||' AND VALID_T = '||tk_val;
    EXECUTE IMMEDIATE v_exec;
    END IF;
    FETCH v_rec_cv INTO v_rec;
    EXIT WHEN v_rec_cv%NOTFOUND;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,v_event_validated,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    RAISE ge_raise_error;
    END;
    END IF;
    CLOSE v_rec_cv;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,v_event_validated,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    RAISE ge_raise_error;
    END;

    Dear Andrew,
    Thank you so much for your suggestions, however, I think it will be better to let me explain more about the situation.
    I am working at Data Warehousing and Analysis part. The event tables are provided by other applications such as Customer OTLP system, Sales Management, etc. We therefore just have the results stored in the event tables (which could be wrong or inconsistency) and no way to force them to be valid by constraints. Before further processing the events , their records should be checked and overridden if possible, and that is the point I am trying to solve now.
    The Event table names, their attributes list, data types, primary key, timestamp columns etc are dynamic and are provided via parameters. I would like to write a procedure which can check the invalid events (not only update, but also insert, delete), protocol them, and override them if possible before processing further. Because the table name, attribute lists, data type, etc are not known in advanced, to my best knowledge, the only choice is generating dynamic PL/SQL code although it could suck the performance. The code you have seen in my first question is the output from the follwoing procedure, where the i_att_list provides the atts list has been parsed from other procedure invocation, i_pk is the primary key, i_tk is the time key, i_table_name is the table name (which is Event_Validation in previous example). The stucking point I have met now is that I do not know how to test the condition to detect the different between column pairs (ATT1 and ATT1_FROM, ...). Using Select from dual is just a dummy select for testing the where condition which must be formed as a string by that way.
    Thank you very much for your answer and looking forward to seeing your further recommendations or suggestions.
    Regards,
    Tho.
    CREATE OR REPLACE PROCEDURE Update_Validation
    ( i_att_list enum_string, -- list of attributes
    i_pk IN VARCHAR2, -- primary key column
    i_tk IN VARCHAR2, -- time key column
    i_table_name IN VARCHAR2 -- table_name - the columns format be checked
    ) AUTHID Current_User IS
    TYPE LoopCurType           IS REF CURSOR;
    ln_parallel NUMBER := 4;
    ge_raise_error EXCEPTION;
    v_user VARCHAR2(100);
    v_sql VARCHAR2(4000);
    v_string VARCHAR2(4000);
    v_crlf VARCHAR2(2) := CHR(13)||CHR(10);
    BEGIN
    SELECT sys_context('USERENV','current_schema') INTO v_user FROM DUAL;
    v_sql:= 'SELECT /*+ parallel(x,'||ln_parallel||') */ x.* FROM ' ||i_table_name|| ' x '||
              'WHERE CHANGE_KEY = ''U'''||
    ' order by '||i_tk;
    v_string := 'DECLARE v_rec '||i_table_name||'%ROWTYPE;' ||v_crlf||
              ' TYPE cv_type IS REF CURSOR; ' ||v_crlf||
    ' v_rec_cv CV_TYPE; ' ||v_crlf||
              ' v_cond VARCHAR2(4000); ' ||v_crlf||
         ' v_exec VARCHAR2(100);' ||v_crlf||
              ' v_default VARCHAR2(10):= ''~~''; ' ||v_crlf||
    ' tk_val '||i_table_name||'.'||i_tk||'.%TYPE;'||v_crlf||
    ' pk_val '||i_table_name||'.'||i_pk||'.%TYPE;'||v_crlf||
              ' v_cnt NUMBER;' ||v_crlf||
              'BEGIN ' ||v_crlf||
                        'OPEN v_rec_cv FOR ' ||v_sql ||';' ||v_crlf||
                        'FETCH v_rec_cv INTO v_rec;' ||v_crlf||
                             ' IF v_rec_cv%NOTFOUND THEN ' ||v_crlf||
                                  'Add_Log(''Event_Validating'',v_user,i_table_name,''INFO'',''I-0001: No-Procession needed'');'||v_crlf||
                             ' ELSE ' ||v_crlf||
                                  ' BEGIN '||v_crlf||
                                  ' LOOP '||v_crlf||
                                  'pk_val := v_rec.'||i_pk||';'||v_crlf||
    'tk_val := v_rec.'||i_tk||';'||v_crlf||
    'v_cnt := i_att_list.COUNT;' ||v_crlf||
                                            'v_cond := ''NVL(v_rec.''|| i_att_list(1)||'', '' || v_default || '') <> NVL(v_rec.'' || i_att_list(1)||''_FROM'''||v_crlf||
                             '||'' , '' || v_default || '')'';'||v_crlf||
                                            'FOR v_i IN 2..v_cnt LOOP'||v_crlf||
                                                 'BEGIN'||v_crlf||
                                                 'v_cond := v_cond ||CHR(13)||CHR(10)||''OR NVL(v_rec.''||i_att_list(v_i)||''), <> NVL(v_rec.''||i_att_list(v_i)||''_FROM'''||v_crlf||
                                                 '||'' , '' || v_default || '')'';'||v_crlf||
                                                 'END;'||v_crlf||
                                            'END LOOP;'||v_crlf||
                                            'v_exec := ''SELECT ''x'' FROM DUAL WHERE ''||v_cond;'||v_crlf||
                                            'EXECUTE IMMEDIATE v_exec;'||v_crlf||
                                            'IF SQL%ROWCOUNT = 0     THEN -- condition is false ==> traced attributes does not changed'||v_crlf||
                                            '-- update the REASON = 4 - not interested event'||v_crlf||
                                            'UPDATE '||i_table_name||' SET REASON = 4 WHERE '||i_pk||' = '||v_tk||' AND '||i_tk||' = '||tk_val||';'||v_crlf||
                                            'END IF;'||v_crlf||
                                       'FETCH v_rec_cv INTO v_rec;' ||v_crlf||
                                       'EXIT WHEN v_rec_cv%NOTFOUND;'||v_crlf||
                        ' END LOOP;'||v_crlf||
                                  'EXCEPTION' ||v_crlf||
                             'WHEN OTHERS THEN'||v_crlf||
                        'Add_Log(''SCD_VALIDATION'',v_user,i_table_name,''ERROR'',''E-0008: Unkown Exception raised in Loop. ORACLE:''||SQLERRM);'||v_crlf||
                        'RAISE ge_raise_error;'||v_crlf||
                                  'END;'||v_crlf||
                                  'END IF;'|| v_crlf||
                        'Close v_rec_cv;'||v_crlf||
                        'EXCEPTION' ||v_crlf||
                   'WHEN OTHERS THEN'||v_crlf||
              'Add_Log(''SCD_VALIDATION'',v_user,i_table_name,''ERROR'',''E-0008: Unkown Exception raised in Loop. ORACLE:''||SQLERRM);'||v_crlf||
              'RAISE ge_raise_error;'||v_crlf||
                   'END;';               
         Add_Log('SCD_UPDATE_VALIDATION',v_user,i_table_name,'INFO','I-0006: Update Validation : '||v_string);     
         EXECUTE IMMEDIATE v_string;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,i_table_name,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    END Update_Validation;

  • XSLT - looking for evaluate() to build dynamic XPATHs

    Hi,
    I am using the oracle api to process an XSLT and was trying to get the xalan:evaluate() function working.
    Having problems as the first param is an ExpressionContext which I am not sure what to set it to.
    Anyone have any experience with this or any of the XPath.evaluate calls from the oracle libraries?
    Cheers

    Set the XPath expression as a String.
    http://xml.apache.org/xalan-j/extensionslib.html#evaluate

  • How to build a full dynamic WHERE expression in ADFBC Faces View Object ?

    Dear Steve
    >
    I need an example about how to build a full dynamic WHERE expression in
    ADFBC View Object
    In UIX I known to do that, but i don't kwown how to do in ADFBC Faces.
    please help me to see an example.
    thanks
    Juan Carlos

    You write an AM level method to set the where clause and you expose it as a client method. (just like you did before)
    Then you can drag this method onto a page as a button and then pressing on this button will execute the method.
    If you want this to be done automatically without pressing a button - you go to the pagedef.xml file for your page and add a methodInvocation binding to that AM method, and then add a method executable to the executables section calling this method.

Maybe you are looking for

  • 2 Separate iPod Users, but 1 iTunes account - how to separate downloads?

    New users here. One computer; one iTunes. My daughter has her iPod; I have my iPod. I don't want her music on my iPod, and vice versa. How do we download or sync and get only the music we have each chosen in iTunes? Thanks for any help you can give m

  • Settlement Rule for Internal Order

    Hi All I have Maintained Settlement rule for Internal order as under CAT - FXA Settlement Receiver - Asset % - 100 Settlement type - Full Now after settlement of above Order in KO88 . I want again use above internal order. Hence i have trying to put

  • How to read a CSV File

    Hi All, I am new to the forum so i dont know if i can post this message in this section or not but i did not find any related section in the menu so i am posting it here. I want to read a .CSV (comma separated file) in a particular location and see i

  • Hyperlinks not visible in UI

    Hi All, My requirement is to add two hyperlinks DISPLAY and CHANGE for the purchase order number. For this I proceeded like this: 1) I created two custom attributes DIS_PO and CH_PO under context node HYPERLINKS of the view IncidentHeader of SRQM_INC

  • PRINTOUT OF QUANTITY CONTRACT

    hi friends, I want to take the print out in qty contract.  kindly give me how to take printout of the same. your suggestions are taken valuable. regards, G.V.SHIVAKKUMAR 9790986272.