How to Assign Values

19-24 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Table 19–1 through Table 19–3 list the various possibilities of assignment on constants and properties, payloads, and headers of a message from source to target. Notes: ■ When you assign values to a particular Oracle Mediator property during event publishing, the assigned value does not get propagated to the subscribing event. You can work around this issue by using transformations to include the property as part of the event body. ■ You cannot assign values to the jca.db.userName and jca.db.password properties on Oracle WebLogic Server because their data sources do not support setting the user name or password dynamically to the getConnection method. Table 19–1 Possibilities on Constants and Properties Source Target Example Property Property copy expression=in.property.jca.file.FileName target=out.property.jca.file.FileName Constant Property copy value=ConstantNameAssigned.xml target=out.property.jca.file.FileName Table 19–2 Possibilities on Payload Source Target Example XPath Expression Property copy expression=concatExprPropMed,-,oraext :generate-guid target=out.property.jca.file.FileName xmlns:oraext=http:www.oracle.comXSLTra nsformjavaoracle.tip.pc.services.function s.ExtFunc XPath Expression below part level Property copy expression=in.bodyimp1:requestProductRe qMake target=out.property.jca.file.FileName xmlns:imp1=http:xmlns.oracle.compsft Property XPath Expression below part level copy value=in.property.jca.file.FileName target=out.requestinp1:requestProductRe qModel xmlns:inp1=http:xmlns.oracle.compsft Constant XPath Expression below part level copy value=ConstantModel target=out.requestinp1:requestProductRe qModel xmlns:inp1=http:xmlns.oracle.compsft XPath Expression XPath Expression copy expression=in.body target=out.request Creating Oracle Mediator Routing Rules 19-25

19.2.2.10 What You May Need to Know About the Assign Activity

Note the following issues about the assign activity. ■ The assign activity is executed in the order that is present in the Oracle Mediator copy element. ■ A source XPath expression should always refer to a leaf node while the source is assigned to a target property. Otherwise, all the values of the child nodes in the source get concatenated and are assigned to the target property. Example 19–4 provides details. Example 19–4 XPath Expression Referring to a Leaf Node copy target=out.property.jca.file.FileName expression=in.bodyimp1:requestProductReqMake xmlns:imp1=http:xmlns.oracle.compsft XPath Expression below part level XPath Expression below part level copy expression=in.bodyimp1:requestProductRe qMake target=out.requestimp1:requestProductRe qModel xmlns:imp1=http:xmlns.oracle.compsft Table 19–3 Possibilities on Header Source Target Example XPath Expression below part level Property copy expression=in.header.inp1_ headerinp1:headerName target=out.property.jca.file.FileName xmlns:inp1=http:xmlns.oracle.compsft Property XPath Expression below part level copy value=in.property.jca.file.FileName target=out.header.inp1_ headerinp1:headerName xmlns:inp1=http:xmlns.oracle.compsft Constant XPath Expression below part level copy value=NewID.xml target=out.header.inp1_ headerinp1:headerId xmlns:inp1=http:xmlns.oracle.compsft Constant XPath Expression below part level copy value=sampleusername xmlns:wsse1=http:docs.oasis-open.orgwss 200401oasis-200401-wss-wssecurity-secext -1.0.xsd target=out.header.wsse1_ Securitywsse1:Securitywsse1:UsernameToken wsse1:Username XPath Expression XPath Expression copy target=out.header.inp1_header expression=in.header.inp1_header xmlns:inp1=http:xmlns.oracle.compsft XPath Expression below part level XPath Expression below part level copy target=out.header.inp1_ headerinp1:headerName expression=in.header.inp1_ headerinp1:headerId xmlns:inp1=http:xmlns.oracle.compsft Table 19–2 Cont. Possibilities on Payload Source Target Example