Skip Headers
Oracle® BPEL Process Manager Developer's Guide
10g (10.1.3.1.0)

Part Number B28981-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

D XPath Extension Functions

Oracle provides additional XPath extension functions that use built-in BPEL capabilities and XPath standards.

This appendix contains the following topics:

See Also:

D.1 Advanced Functions

This section describes the following functions:

D.1.1 create-nodeset-from-delimited-string

The function takes a delimited string and returns a nodeSet.

Signature:

orcl:create-nodeset-from-delimited-string(qname, delimited-string, delimiter)

Arguments:

  • qname - The qualified name in which each node in the node set must be created. The QName can be represented in two forms:

    • task:assignee

    • {http://mytask/task}assignee

  • delimited-string - The sting of elements separated by the delimiter.

  • delimiter - The character that separates the items in the input string; for example, a comma or a semicolon.

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.1.2 generate-guid

Generates a unique GUID.

Signature:

orcl:generate-guid()

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.1.3 lookup-dvm

Note:

Only use lookup-dvm with Oracle Enterprise Service Bus. Use of this function with Oracle BPEL Process Manager is not currently supported.

This function returns a string by looking up the value for the target column in the domain value map (DVM), where the value for source column is equal to the source value. The source value is an XPath expression bound to the source document of the XSLT transformation. The expression is evaluated during the transformation and the result value is passed as the source value for lookup.

Signature:

orcl:lookup-dvm(dvmName as string, sourceColumn as string, sourceValue as string, targetColumn as string, defaultValue as string)

Arguments:

  • dvmName - The DVM name.

  • sourceColumn - The source column name.

  • sourceValue - The source value (an XPath expression bound to the source document of the XSLT transformation).

  • targetColumn - The target column name.

  • defaultValue - If the value is not found, the default value is returned.

Example:

You want to convert from abbreviated state names in the United States to their full names:

orcl:lookup-dvm('State Code','code','CA','state','Not Found')

This attempts to convert an abbreviated CA to its full name of California. The default value is Not Found.

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.1.4 lookup-xml

This function returns the string value of an element defined by lookupXPath in an XML file (docURL) given its parent XPath (parentXPath), the key XPath (keyXPath), and the value of the key (key).

Example: orcl:lookup-xml('file:/d:/country_data.xml', '/Countries/Country', 'Abbreviation', 'FullName', 'UK') returns the value of the element FullName child of /Countries/Country where Abbreviation = 'UK' is in the file D:\country_data.xml.

Signature:

orcl:lookup-xml(docURL, parentXPath, keyXPath, lookupXPath, key)

Arguments:

  • docURL - The XML file

  • parentXPath - The parent XPath

  • keyXPath - The key XPath

  • lookupXPath - The lookup XPath

  • key - The key value

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.2 BPEL Extension Functions

This section describes the following functions:

D.2.1 getLinkStatus

This function returns a Boolean value indicating the status of the link. If the status of the link is positive the value is true, otherwise the value is false. This function can only be used in a join condition.

The linkName argument refers to the name of an incoming link for the activity associated with the join condition.

Signature:

bpws:getLinkStatus ('linkName')

Arguments:

  • variableName - The source variable for the data

  • propertyName - The QName of the property

Property IDs:

  • namespace-uri: http://schemas.xmlsoap.org/ws/2003/03/business-process/

  • namespace-prefix: bpws

D.2.2 getVariableData

This function extracts arbitrary values from BPEL variables.

When only the first argument is present, the function extracts the value of the variable, which in this case must be defined using an XML Schema simple type or element. Otherwise, the return value of this function is a node set containing the single node representing either an entire part of a message type (if the second argument is present and the third argument is absent) or the result of the selection based on the locationPath (if both optional arguments are present). If the given locationPath selects a node set of a size other than one during execution, the standard fault bpws:selectionFailure is thrown.

Signature:

bpws:getVariableData ('variableName', 'partName'?, 'locationPath'?)

Arguments:

  • variableName - The source variable for the data

  • partName - The part to select from the variable (optional)

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (optional).

Property IDs:

  • namespace-uri: http://schemas.xmlsoap.org/ws/2003/03/business-process/

  • namespace-prefix: bpws

D.2.3 getVariableProperty

This function extracts arbitrary values from BPEL variables.

If the given property selects a node set of a size other than one during execution, the standard fault bpws:selectionFailure is thrown.

Signature:

bpws:getVariableProperty ('variableName', 'propertyname')

Arguments:

  • variableName - The source variable for the data

  • propertyName - The QName of the property

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (optional).

Property IDs:

  • namespace-uri: http://schemas.xmlsoap.org/ws/2003/03/business-process/

  • namespace-prefix: bpws

D.3 BPEL XPath Extension Functions

This section describes the following functions:

D.3.1 addQuotes

This function returns the content of a string with single quotes added.

Signature:

ora:addQuotes(string)

Arguments:

  • string - The string to which this function adds quotes

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.2 appendToList

Note:

While the appendToList function is still available for use, Oracle recommends that you use the bpelx:append extension of an assign activity to append data to a node list.

This function appends to a node list. The node list with which to append should not be null or empty.

Signature:

ora:appendToList('variableName', 'partName'?, 'locationPath'?, Object)

Arguments:

  • variableName - The source variable for the data

  • partName - The part to select from the variable (optional)

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (optional).

  • Object - The object can be either a list or a single item. If the object is a list, this function appends each item in the list. Each appended item is either an element, or an element with the string value of the node created.

Property IDs:

  • deprecated

    Use the bpelx:copyList or bpelx:append extension activity to append to a list. This extension activity is demonstrated in sample SOA_Oracle_Home\bpel\samples\tutorials\126.DataAggregator.

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.3 copyList

Note:

While the copyList function is still available for use, Oracle recommends that you use the bpelx:copyList extension to copy a node list or a node.

This function copies a node list or a node. The node list to be copied to should not be null or empty.

Signature:

ora:copyList('variableName', 'partName'?, 'locationPath'?, Object)

Arguments:

  • variableName - The source variable for the data

  • partName - The part to select from the variable (optional)

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (optional)

  • Object - The object can be either a list or a single item. If the object is a list, each item in the list is copied. Each item to be copied is either an element, or an element with the string value of the node created.

Property IDs:

  • deprecated

    Use the bpelx:copyList extension activity to append to a list. This extension activity is demonstrated in sample SOA_Oracle_Home\bpel\samples\tutorials\126.DataAggregator.

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.4 countNodes

Note:

While the countNodes function is still available for use, Oracle recommends that you use version 1.0 of the XPath count() function to return the size of the elements as an integer.

This function returns the size of the elements as an integer.

Signature:

ora:countNodes('variableName', 'partName'?, 'locationPath'?)

Arguments:

  • variableName - The source variable for the data

  • partName - The part to select from the variable (optional)

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (optional)

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.5 doc

This function returns the content of an XML file.

Signature:

ora:doc('fileName','xpath'?)

Arguments:

  • fileName - The name of the XML file

  • xpath - The path to the file

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.6 formatDate

This function converts standard XSD date formats to characters suitable for output.

Signature:

ora:formatDate('dateTime', 'format')

Arguments:

  • dateTime - Contains a date-related value in XSD format. For nonstring arguments, this function behaves as if a string() function were applied. If the argument is not a date, the output is an empty string. If it is a valid XSD date and some fields are empty, this function attempts to fill unspecified fields. For example, 2003-06-10T15:56:00.

  • format - Contains a string formatted according to java.text.SimpleDateFormat format

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

See Also:

"Assigning Date or Time" for an example of using this function

D.3.7 generateGUID

Generates a unique GUID.

Signature:

ora:generateGUID()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.8 getContentAsString

This function returns the content of an element as an XML string.

Signature:

ora:getContentAsString(NodeList elementAsNodeList)

Arguments:

  • NodeList - The node list (source for the data).

  • elementAsNodeList - The element as the node list.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.9 getConversationId

This function returns the conversation ID.

Signature:

ora:getConversationId()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.10 getCreator

This function returns the instance creator.

Signature:

ora:getCreator()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.11 getCurrentDate

This function returns the current date as a string.

Signature:

ora:getCurrentDate('format'?)

Argument:

  • format - (Optional) Specifies a string formatted according to java.text.SimpleDateFormat format (optional).

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

See Also:

"Assigning Date or Time" for an example of using this function

D.3.12 getCurrentDateTime

This function returns the current date time as a string.

Signature:

ora:getCurrentDateTime('format'?)

Argument:

  • format - (Optional) Specifies a string formatted according to java.text.SimpleDateFormat format (optional).

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.13 getCurrentTime

This function returns the current time as a string.

Signature:

ora:getCurrentTime('format'?)

Argument:

  • format - (Optional) Specifies a string formatted according to java.text.SimpleDateFormat format (optional).

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.14 getDomainId

This function returns the current domain ID.

Signature:

ora:getDomainId()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.15 getElement

This function returns an element using index from the array of elements.

Signature:

ora:getElement('variableName', 'partName', 'locationPath', index)

Arguments:

  • variableName - The source variable for the data

  • partName - The part to select from the variable (required)

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (required)

  • index - Dynamic index value. The index of the first node is 1.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

See Also:

"Dynamically Indexing with the BPEL getElement Function" for an example of using this function

D.3.16 getGroupIdsFromGroupAlias

This function returns a List of user Ids for a group alias specified in the TaskServiceAliases section of the BPEL suitcase descriptor.

Signature:

ora:getGroupIdsFromGroupAlias(String aliasName)

Arguments:

  • aliasName - The alias for a list of users or groups as defined in the bpel.xml file

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.17 getInstanceId

This function returns the instance ID.

Signature:

ora:getInstanceId()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.18 getNodeValue

This function returns the value of a DOM node as a string.

Signature:

ora:getNodeValue(node)

Arguments:

  • node - The DOM node

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.19 getNodes

This function get a node list. This is implemented as an alternate to bpws:getVariableData, which does not return a node list.

Signature:

ora:getNodes('variableName', 'partName'?, 'locationPath'?)

Arguments:

  • variableName - The source variable for the data

  • partName - The part to select from the variable (optional)

  • locationPath - Provides an absolute location path (with / meaning the root of the document fragment representing the entire part) to identify the root of a subtree within the document fragment representing the part (optional).

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.20 getPreference

This function returns the value of a property specified in the preferences section of the BPEL suitcase descriptor.

Signature:

ora:getPreference(String preferenceName)

Arguments:

  • preferenceName - The name of the preference as specified in the BPEL suitcase descriptor.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.21 getProcessId

This function returns the ID of the current BPEL process.

Signature:

ora:getProcessId()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.22 getProcessOwnerId

This function returns the ID of the user who owns the process, if specified in the TaskServiceAliases section of the BPEL suitcase descriptor.

Signature:

ora:getProcessOwnerId()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.23 getProcessURL

This function returns the root URL of the current BPEL process.

Signature:

ora:getProcessURL()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.24 getProcessVersion

This function returns the current process version.

Signature:

ora:getProcessVersion()

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.25 getUserAliasId

This function returns the user ID for an alias specified in the TaskServiceAliases section of the BPEL suitcase descriptor.

Signature:

ora:getUserAliasId (String aliasName)

Arguments:

  • aliasName - The alias for a list of users or groups as defined in the bpel.xml file.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.26 integer

This function returns the content of the node as an integer.

Signature:

ora:integer(node)

Arguments:

  • node - The input node

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.27 parseEscapedXML

This function parses a string to DOM.

Signature:

ora:parseEscapedXML(contentString)

Arguments:

  • contentString - The string that this function parses to a DOM.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

See Also:

"Converting from a String to an XML Element" for an example of using this function

D.3.28 processXQuery

This function returns the result of an XQuery transformation.

Signature:

ora:processXQuery('template','context'?)

Arguments:

  • template - The XSLT template

  • input - The input data to be transformed

  • properties - The properties as defined in the bpel.xml file

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.29 processXSLT

This function returns the result of XSLT transformation using the Oracle XDK XSLT processor.

Signature:

xdk:processXSLT('template','input','properties'?)

Arguments:

  • template - The XSLT template

  • input - The input data to be transformed

  • properties - The properties as defined in the bpel.xml file

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: xdk

See Also:

D.3.30 processXSQL

This function returns the result of the XSQL request.

Signature:

ora:processXSQL('template','input','properties'?)

Arguments:

  • template - The XSLT template

  • input - The input data to be transformed

  • properties - The properties as defined in the bpel.xml file

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.31 readBinaryFromFile

This function reads data from a file.

Signature:

ora:readBinaryFromFile(fileName)

Arguments:

  • fileName - The file name from which to read data.

Property IDs:

  • namespace-uri:http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.3.32 readFile

This function returns the content of the file.

Signature:

ora:readFile('fileName','nxsdTemplate'?,'nxsdRoot'?)

Arguments:

  • fileName - The name of the file. This argument can also be an HTTP URL.

    This function by default reads files relative to the suitcase JAR file for the process. If the file that you want to read is located in a different directory path, you must specify an extra directory slash ( /) to indicate that this is an absolute path. For example:

    ora:readFile('file:///c:/temp/test.doc')
    
    

    If you specify only two directory slashes (//), you receive an error similar to the following:

    XPath expression failed to execute.
    Error while processing xpath expression,
    the expression is "ora:readFile("file://c:/temp/test.doc")",
    the reason is c. Please verify the xpath query. 
    
    
  • nxsdTemplate - The NXSD template for the output

  • nxsdRoot -The NXSD root

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

See Also:

"Setting E-mail Attachments" for an example of using this function

D.3.33 writeBinaryToFile

This function writes the binary bytes of a variable (or part of the variable) to a file of the given file name.

Signature:

ora:writeBinaryToFile(varName[, partName][, query])

Arguments:

  • varName - The name of the variable.

  • partName - The name of the part in the case of a messageType variable.

  • query - The query string to a child of the root element.

Property IDs:

  • namespace-uri:http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.4 Database Functions

This section describes the following functions:

D.4.1 lookup-table

This function returns a string based on the SQL query generated from the parameters.

The string is obtained by executing:

SELECT outputColumn FROM table WHERE inputColumn = key

against the data source that can be either a JDBC connect string (jdbc:oracle:thin:username/password@host:port:sid) or a data source JNDI identifier. Only Oracle Thin Driver is supported if the JDBC connect string is used.

Example: orcl:lookup-table('employee','id','1234','last_name','jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')

Signature:

orcl:lookup-table(table, inputColumn, key, outputColumn, datasource)

Arguments:

  • table - The table from which to draw the data

  • inputColumn - The column within the table

  • key - The key

  • outputColumn - The column to output the data

  • datasource - The source of the data

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.4.2 query-database

This function returns a node-set by executing the SQL query against the specified database.

Signature:

orcl:query-database(sqlquery as string, rowset as boolean, row as boolean, datasource as string)

Arguments:

  • sqlquery - The SQL query to perform

  • rowset - Indicates if the rows should be enclosed in an element

  • row - Indicates if each row should be enclosed in an element

  • datasource - Either a JDBC connect string (jdbc:oracle:thin:username/password@host:port:sid) or a JNDI name for the database

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.4.3 sequence-next-val

Returns the next value of an Oracle sequence.

The next value is obtained by executing

SELECT sequence.nextval FROM dual

against a data source that can be either a JDBC connect string (jdbc:oracle:thin:username/password@host:port:sid) or a data source JNDI identifier. Only Oracle Thin Driver is supported if a JDBC connect string is used.

Example: orcl:sequence-next-val('employee_id_sequence','jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')

Signature:

orcl:sequence-next-val(sequence as string, datasource as string)

Arguments:

  • sequence - The sequence number in the database

  • datasource - Either a JDBC connect string or a data source JNDI identifier

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.5 Date Functions

This section describes the following functions:

D.5.1 add-dayTimeDuration-to-dateTime

This function returns a new date time value adding dateTime to the given duration.

If the duration value is negative, then the resulting value precedes dateTime.

Signature:

xp20:add-dayTimeDuration-from-dateTime(dateTime as string, duration as string)

Arguments:

  • dateTime as string - The dateTime to which the function adds the duration, in string format.

  • duration as string - The duration to add to the dateTime, or subtract if the duration is negative, in string format.

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.2 current-date

This function returns the current date in ISO format YYYY-MM-DD.

Signature:

xp20:current-date(object)

Arguments:

  • Object - The time in standard format

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.3 current-dateTime

This function returns the current datetime-value in ISO format CCYY-MM-DDThh:mm:ssTZD.

Signature:

xp20:current-dateTime(object)

Arguments:

  • object - The time in standard format

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

See Also:

"Setting Dynamic Values at Run Time" for an example of using this function

D.5.4 current-time

This function returns the current time in ISO format. The format is hh:mm:ssTZD.

Signature:

xp20:current-time(object)

Arguments:

  • object - The time in standard format

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.5 day-from-dateTime

This function returns the day from dateTime. The default day is 1.

Signature:

xp20:day-from-dateTime(object)

Arguments:

  • object - The time in standard format as a string

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.6 format-dateTime

This function returns the formatted string of dateTime using the format provided.

Signature:

xp20:format-dateTime(dateTime as string, format as string)

Arguments:

  • dateTime - The dateTime to be formatted

  • format - The format for the output

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.7 hours-from-dateTime

This function returns the hour from dateTime. The default hour is 0.

Signature:

xp20:hours-from-dateTime(dateTime as string)

Arguments:

  • dateTime as string - The dateTime

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.8 implicit-timezone

This function returns the current time zone in ISO format +/- hh:mm, indicating a deviation from UTC (Coordinated Universal Timezone).

Signature:

xp20:implicit-timezone(object)

Arguments:

  • object - The time in standard format

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.9 minutes-from-dateTime

This function returns the minute from dateTime. The default minute is 0.

Signature:

xp20:minutes-from-dateTime(dateTime as string)

Arguments:

  • dateTime as string - The dateTime

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.10 month-from-dateTime

This function returns the month from dateTime. The default month is 1 (January).

Signature:

xp20:month-from-dateTime(dateTime as string)

Arguments:

  • dateTime as string - The dateTime to be formatted

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.11 seconds-from-dateTime

This function returns the second from dateTime. The default second is 0.

Signature:

xp20:seconds-from-dateTime(dateTime as string)

Arguments:

  • dateTime as a string - The dateTime as a string

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.12 subtract-dayTimeDuration-from-dateTime

This function returns a new dateTime value after subtracting duration from dateTime.

If the duration value is negative, then the resultant dateTime value follows input-dateTime value.

Signature:

xp20:subtract-dayTimeDuration-from-dateTime(dateTime as string, duration as string)

Arguments:

  • dateTime as string - The dateTime from which the function subtracts the duration, in string format.

  • duration as string - The duration to subtract to the dateTime, or add if the duration is negative, in string format.

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.13 timezone-from-dateTime

This function returns the timezone from dateTime. The default timezone is GMT+00:00.

Signature:

xp20:timezone-from-dateTime(dateTime as string)

Arguments:

  • dateTime as string - The dateTime for which this function returns a time zone

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.5.14 year-from-dateTime

This function returns the year from dateTime.

Signature:

xp20:year-from-dateTime(dateTime as string)

Arguments:

  • dateTime - The dateTime

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.6 Mathematical Functions

This section describes the following function.

D.6.1 abs

This function returns the absolute value of inputNumber.If inputNumber is not negative, the inputNumber is returned. If the inputNumber is negative, the negation of inputNumber is returned.

Example: abs(-1) returns 1.

Signature:

xp20:abs(inputNumber as number)

Arguments:

  • inputNumber as number - The number for which the function returns an absolute value.

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.7 Identity Service Functions

This section describes the following functions:

D.7.1 getDefaultRealmName

This function returns the default realm name.

Signature:

ids:getDefaultRealmName()

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.2 getGroupProperty

This function returns the property value for the given group. If the group or attribute does not exist, it returns null.

Signature:

ids:getGroupProperty(groupName, attributeName, realmName)

Arguments:

  • groupName - The group name.

  • attributeName - The name of the group attribute. The name is one of the following values:

    1. name

    2. displayName

    3. description

    4. email

    If the identity service uses the LDAP providerType or JAZN LDAP-based providers, configure the LDAP server to enable searching by those attributes.

  • realmName - The realm name. This is optional. If not specified, the default realm is assumed.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.3 getManager

This function gets the manager of a given user. If the user does not exist or there is no manager for this user, it returns null.

Signature:

ids:getManager(userName, realmName)

Arguments:

  • userName - The user name.

  • realmName - The realm name. This is optional. If not specified, the default realm is assumed.

Property IDs:

  • namespace-uri:http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.4 getReportees

This function gets the reportees of the user. If the user does not exist, it returns null. The function returns a list of nodes. Each node in the list is a user.

Signature:

ids:getReportees(userName, upToLevel, realmName)

Arguments:

  • userName - The user name.

  • upToLevel- Defines the levels of indirect reportees to be included into the result. If the value is 1, it returns only direct reportees. If the value is -1, it returns all levels of reportees. It can be either an element with value xsd:number or a string, for example '1'.

  • realmName - The realm name. This is optional and if not specified, the default realm is assumed.

Property IDs:

  • namespace-uri:http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.5 getSupportedRealmNames

This function returns the supported realm names.

Signature:

ids:getSupportedRealms()

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.6 getUserProperty

This function returns the property of the user. If the user or attribute does not exist, it returns null.

Signature:

ids:getUserProperty(userName, attributeName, realmName)

Arguments:

  • userName - The user name.

  • attributeName - The name of the user attribute. The attribute name is one of the following values:

    1. name

    2. displayName

    3. description

    4. title

    5. firstName

    6. middleName

    7. lastName

    8. workPhone

    9. homePhone

    10. mobile

    11. pager

    12. fax

    If the identity service uses the LDAP providerType or JAZN LDAP-based providers, configure the LDAP server to enable searching by those attributes.

  • realmName - The realm name. This is optional. If not specified, the default realm name is assumed

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.7 getUserRoles

This function gets the user roles. This function returns a list of objects, either application roles or groups, depending on the roleType. If the user or role does not exist, it returns null.

Signature:

ids:getUserRoles(userName, roleType, direct)

Arguments:

  • userName - The user name.

  • roleType - The role type — this is one of three values: ApplicationRole, EnterpriseRole, or AnyRole.

  • direct - A Boolean flag indicating if direct or indirect roles are fetched. This is optional. If not specified, only direct roles are fetched. It can be either an element with value xsd:boolean or string 'true'/'false'.

Property IDs:

  • namespace-uri:http://xmlns.oracle.com/bpel/services/IdentityService

  • namespace-prefix: ids

D.7.8 getUsersInGroup

This function gets the users in a group. If the group does not exist, it returns null. The function returns a list of nodes. Each node in the list is called user.

Signature:

ids:getUsersInGroup(groupName, direct, realmName)

Arguments:

  • groupName - The group name.

  • direct - A Boolean flag. If true, the function returns direct user grantees; otherwise, all user grantees are returned. It can be either an element with value xsd:boolean or string 'true'/'false'.

  • realmName - The realm name. This is optional. If not specified, the default realm name is assumed.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.9 isUserInRole

This function verifies if a user has a given role, returning a Boolean true or false. If the user does not exist, it returns null.

Signature:

ids:isUserInRole(userID, roleName, realmName)

Arguments:

  • userID - The user name.

  • roleName - The role or group name

  • realmName - The realm name. This is optional. If not specified, the default realm name is assumed.

Property IDs:

  • namespace-uri:http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.10 lookupGroup

This function gets the group. If the group does not exist, it returns null.

Signature:

ids:lookupGroup(groupName, realmName)

Arguments:

  • groupName - The group name.

  • realmName - The realm name. This is optional. If not specified, the default realm name is assumed.

Property IDs:

  • namespace-uri:http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.7.11 lookupUser

This function gets the user object. If the user does not exist, it returns null.

Signature:

ids:lookupUser(userName, realmName)

Arguments:

  • userName - The user name.

  • realmName - The realm name. This is optional. If not specified, the default realm name is assumed.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/services/IdentityService/xpath

  • namespace-prefix: ids

D.8 Workflow Service Functions

This section describes the following functions:

D.8.1 clearTaskAssignees

This function clears the current task assignees.

Signature:

hwf:clearTaskAssignees(taskID)

Arguments:

  • task - The task ID of the task.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.2 createWordMLDocument

This function creates a Microsoft Word ML document as a base 64-encoded string.

Signature:

hwf:createWordMLDocument(node, xsltURI)

Arguments:

  • node - The node

  • xsltURI - The XSLT used to transform the node (the first argument) to Microsoft Word ML

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.3 getNotificationProperty

This function retrieves a notification property. The function evaluates to corresponding values for each notification. Only use this function in the notification content XPath expression. If used elsewhere, it returns null.

Signature:

hwf:getNotificationProperty(propertyName)

Arguments:

  • propertyName - The name of the notification property. It can be one of the following values:

    • recipient - The recipient of the notification.

    • recipientDisplay - The display name of the recipient.

    • taskAssignees - The task assignees.

    • taskAssigneesDisplay - The display names of the task assignees.

    • locale - The locale of the recipient.

    • taskId - The task ID of the task for which the notification is meant.

    • taskNumber - The task number of the task for which the notification is meant.

    • appLink - The HTML link to the Oracle BPEL Worklist Application task details page.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

See Also:

D.8.4 getNumberOfTaskApprovals

This function computes the number of times the task was approved.

Signature:

hwf:getNumberOfTaskApprovals(taskId)

Arguments:

  • taskId - The ID of the task

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.5 getPreviousTaskApprover

This function retrieves the previous task approver.

Signature:

hwf:getPreviousTaskApprover(taskId)

Arguments:

  • taskId - The ID of the task

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.6 getTaskAttachmentByIndex

This function retrieves the task attachment at the specified index.

Signature:

hwf:getTaskAttachmentByIndex(taskId, attachmentIndex)

Arguments:

  • taskId - The task ID of the task

  • attachmentIndex - The index of the attachment. The index begins from 1. The attachmentIndex argument can be a node whose value evaluates to the index number as a string (all node values are strings). If specified statically, it can be specified as '1'.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.7 getTaskAttachmentByName

This function retrieves the task attachment by the attachment name.

Signature:

hwf:getTaskAttachmentByName(taskId, attachmentName)

Arguments:

  • taskId - The task ID of the task.

  • attachmentName - The name of the attachment.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.8 getTaskAttachmentContents

This function retrieves the task attachment contents by the attachment name.

Signature:

hwf:getTaskAttachmentContents(taskId, attachmentName)

Arguments:

  • taskId - The task ID of the task.

  • attachmentName - The name of the attachment.

Property IDs:

  • namespace-uri:http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.9 getTaskAttachmentsCount

This function retrieves the number of task attachments.

Signature:

hwf:getTaskAttachmentsCount(taskId)

Arguments:

  • taskId - The task ID.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.10 getTaskResourceBundleString

This function returns the internationalized resource value from the resource bundle associated with a task definition.

Signature:

hwf:getTaskResourceBundleString(taskId, key, locale?)

Arguments:

  • taskId - The task ID of the task.

  • key - The key to the resource.

  • locale - (Optional) The locale. This value defaults to system locale. This returns a resourceString XML element in the namespace http://xmlns.oracle.com/bpel/services/taskService, which contains the string from the resource bundle.

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

See Also:

"Specifying Multilingual Settings" and "Configuring Messages in Different Languages" for additional details about this function

D.8.11 wfDynamicGroupAssign

This function gets the name of an identity service group, selected according to the specified assignment pattern. The group is selected from either the subordinate groups of the specified group (if a single group name is supplied), or from the list of groups (if a list of user names is supplied). If the identity service is configured with multiple realms, the realm name for the group and groups must also be supplied. Additional assignment pattern specific parameters can be supplied. These additional parameters are optional, depending on the details of the specific assignment pattern used.

There are two signatures of this function.

Signature 1:

hwf:wfDynamicGroupAssign('patternName','groupName','realmName'?,'patternParam1'?,'patternParam2'?,...,'patternParamN'?)

Argument 1:

  • patternName - The name of the assignment pattern (for example, ROUND_ROBIN)

  • groupName - The name of the group from which to select a subordinate group.

  • realmName - The name of the identity service realm to which the group belongs.

  • patternParam1...patternParamN - Any additional parameters required by the assignment pattern implementation (may be optional, depending on pattern).

Signature 2:

hwf:wfDynamicGroupAssign('patternName','groupList','realmName'?,'patternParam1'?,'patternParam2'?,...,'patternParamN'?)

Argument 2:

  • patternName - The name of the assignment pattern (for example, ROUND_ROBIN).

  • groupList - The list of groups from which to select a group.

  • realmName - The name of the identity service realm to which the groups belong.

  • patternParam1...patternParamN - Any additional parameters required by the assignment pattern implementation (may be optional, depending on the pattern).

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.8.12 wfDynamicUserAssign

This function returns the name of an identity service user, selected according to the specified assignment pattern. The user is selected from either the subordinate users of the specified group (if a single group name is supplied), or from the list of users (if a list of user names is supplied). If the identity service is configured with multiple realms, the realm name for the group and users must also be supplied. Additional assignment pattern specific parameters can be supplied. These additional parameters are optional, depending on the details of the specific assignment pattern used.

There are two signatures for this function.

Signature 1:

hwf:wfDynamicUserAssign('patternName','groupName','realmName'?,'patternParam1'?,....,'patternParam2'?,...,'patternParamN'?)

Arguments 1:

  • patternName - The name of the assignment pattern (for example, ROUND_ROBIN).

  • groupName - The name of the group from which to select a subordinate user.

  • realmName - The name of the identity service realm to which the group belongs.

  • patternParam1 ... patternParamN - Any additional parameters required by the assignment pattern implementation (may be optional, depending on the pattern).

Signature 2:

hwf:wfDynamicUserAssign(patternName,userList,realmName?,patternParam1?,patternParam2?,...,patternParamN?)

Arguments 2:

  • patternName - The name of the assignment pattern (for example, ROUND_ROBIN).

  • userList - The list of users from which to select a user.

  • realmName - The name of the identity service realm to which the users belong.

  • patternParam1...patternParamN - Any additional parameters required by the assignment pattern implementation (may be optional, depending on the pattern).

Property IDs:

  • namespace-uri: http://xmlns.oracle.com/bpel/workflow/xpath

  • namespace-prefix: hwf

D.9 String Functions

This section describes the following functions.

D.9.1 compare

This function returns the lexicographical difference between inputString and compareString comparing the unicode value of each character of both the strings.

This function returns -1 if inputString lexicographically precedes the compareString.

This function returns 0 if both inputString and compareString are equal.

This function returns 1 if inputString lexicographically follows the compareString.

Example: xp20:compare('Audi', 'BMW') returns -1

Signature:

xp20:compare(inputString as string, compareString as string)

Arguments:

  • variableName - The source variable for the data

  • propertyName - The qualified name (QName) of the property

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.9.2 compare-ignore-case

This function returns the lexicographical difference between inputString and compareString while ignoring case and comparing the unicode value of each character of both the strings.

This function returns -1 if inputString lexicographically precedes the compareString.

This function returns 0 if both inputString and compareString are equal.

This function returns 1 if inputString lexicographically follows the compareString.

Example: xp20:compare-ignore-case('Audi','bmw') returns -1

Signature:

xp:compare-ignore-case(inputString as string, compareString as string)

Arguments:

  • inputString as string - The input string

  • CompareString as string - The string to compare against the input string

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.9.3 create-delimited-string

This function returns a delimited string created from nodeSet delimited by delimiter.

Signature:

orcl:create-delimited-string(nodeSet as node-set, delimiter as string)

Arguments:

  • nodeSet - The node set to be converted into a delimited string

  • delimiter - The character that separates the items in the output string; for example, a comma or a semicolon.

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.9.4 ends-with

This function returns true if inputString ends with searchString.

Example: xp20:ends-with('XSL Map','Map') returns true

Signature:

xp20:ends-with(inputString as string, searchString as string)

Arguments:

  • inputString - The string of data to be searched

  • searchString - The string for which the function searches

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.9.5 format-string

This function returns the message formatted with the arguments passed. At least one argument is required and supports up to a maximum of 10 arguments.

Example: orcl:format-string('{0} + {1} = {2}','2','2','4') returns '2 + 2 = 4'

Signature:

orcl:format-string(string,string,string...)

Arguments:

  • string - One of the strings to be used in the formatted output

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.9.6 get-content-as-string

This function returns the XML representation of the input element.

Signature:

orcl:get-content-as-string(element as node-set)

Arguments:

  • element as node-set - The input element that the function returns as an XML representation

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.9.7 get-localized-string

This function returns the locale-specific string for key. This function uses language, country, variant, and resource bundle to identify the correct resource bundle.

The resource bundle in obtained by resolving resourceLocation against the resourceBaseURL. The URL is assumed to be a directory only if it ends with /.

Usage: orcl:get-localized-string(resourceBaseURL as string, resourceLocation as string, resource bundle as string, language as string, country as string, variant as string, key as string)

Example: orcl:get-localized-string('file:/c:/','','MyResourceBundle','en','US','','MSG_KEY') returns a locale-specific string from a resource bundle 'MyResourceBundle' in the C:\ directory

Signature:

orcl:get-localized-string(resourceURL,resourceLocation,resourceBundleName,language,country,variant,messageKey)

Arguments:

  • resourceURL - The URL of the resource

  • resourceLocation - The subdirectory location of the resource

  • resourceBundleName - The name of the zip file containing the resource bundle

  • language - The language of the localized output

  • country - The country of the localized output

  • variant - The language variant of the localized output

  • messageKey - The message key in the resource bundle

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

See Also:

"Configuring Messages in Different Languages" for an example of using this function

D.9.8 index-within-string

This function returns the zero-based index of the first occurrence of searchString within the inputString.

This function returns -1 if searchString is not found.

Example: orcl:index-within-string('ABCABC, 'B') returns 1

Signature:

orcl:index-within-string(inputString as string, searchString as string)

Arguments:

  • inputString - The string to be searched

  • searchString - The string for which the function searches in the inputString

Property IDs:

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.9.9 last-index-within-string

This function returns the zero-based index of the last occurrence of searchString within inputString.

This function returns -1 if searchString is not found.

Example: orcl:last-index-within-string('ABCABC', 'B') returns 4

Signature:

orcl:last-index-within-string(inputString as string, searchString as string)

Arguments:

  • inputString - The string to be searched

  • searchString - The string for which the function searches in the inputString

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.9.10 left-trim

This function returns the value of inputString after removing all the leading white spaces.

Example: orcl:left-trim(' account ') returns 'account '

Signature:

orcl:left-trim(inputString)

Arguments:

  • inputString - The string to be left-trimmed

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

See Also:

"Chaining Functions" for an example of using this function in the XSLT Mapper

D.9.11 lower-case

This function returns the value of inputString after translating every character to its lower-case correspondent.

Example: xp20:lower-case('ABc!D') returns 'abc!d'

Signature:

xp20:lower-case(inputString)

Arguments:

  • inputString - The input string

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.9.12 matches

This function returns true if intputString matches the regular expression pattern regexPattern.

Example: xp20:matches('abracadabra', '^a.*a$') returns true

Signature:

xp20:matches(intputString, regexPattern)

Arguments:

  • inputString - The input string

  • regexPattern - The regular expression pattern

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.9.13 right-trim

This function returns the value inputString after removing all the trailing white spaces.

Example: orcl:right-trim(' account ') returns ' account'

Signature:

orcl:right-trim(inputString as string)

Arguments:

  • inputString - The input string to be right-trimmed

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

See Also:

"Chaining Functions" for an example of using this function in the XSLT Mapper

D.9.14 upper-case

This function returns the value of inputString after translating every character to its upper-case correspondent.

Example: xp20:upper-case('abCd0') returns 'ABCD0'

Signature:

xp20:upper-case(inputString as string)

Arguments:

  • inputString - The input string

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20

  • namespace-prefix: xp20

D.10 Utility Functions

This section describes the following functions.

D.10.1 authenticate

This function authenticates a lightweight directory access protocol (LDAP) user and returns true or false.

Signature:

ldap:authenticate('properties','userId','password')

Arguments:

  • properties - The name of the directory specified in the directories.xml file

  • userId - The LDAP user's ID

  • password - The LDAP user's password

Property IDs:

  • namespace-uri:http://schemas.oracle.com/xpath/extension/ldap

  • namespace-prefix: ldap

D.10.2 batchProcessActive

This function returns the number of active processes in the batch.

Signature:

ora:batchProcessActive(String batchId, String processId)

Arguments:

  • batchId - The ID of the batch

  • processId - The ID of the process

Property IDs:

  • namespace-uri:http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.3 batchProcessCompleted

This function returns the number of completed processes in the batch.

Signature:

ora:batchProcessCompleted(String batchId, String processId)

Arguments:

  • batchId - The ID of the batch

  • processId - The ID of the process

Property IDs:

  • namespace-uri:http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.4 format

This function formats a message using Java's message format.

Signature:

ora:format(formatStrings, args+)

Arguments:

  • formatStrings - The string of data to be formatted

  • args+ -

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.5 genEmptyElem

This function generates a list of empty elements for the given QName.

Signature:

ora:genEmptyElem('ElemQName',size?, 'TypeQName'?, xsiNil?)

Arguments:

  • ElemQName - The first argument is the QName of the empty elements

  • size - The second optional integer argument for the number of empty elements. If missing, the default size is 1.

  • TypeQName - The third optional argument is the QName, which is the xsi:type of the generated empty name. This xsi:type pattern matches SOAPENC:Array. If missing or an empty string, the xsi:type attribute is not generated.

  • xsiNil - The fourth optional Boolean argument is to specify whether the generated empty elements are XSI - nil, provided the element is XSD-nillable. The default is false. If missing or false, xsi:nil is not generated.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.6 getChildElement

This function gets a child element for the given element.

Signature:

ora:getChildElement(element, index)

Arguments:

  • element - The source for the data

  • index - The integer value of the child element index

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.7 getMessage

This function gets a message based on the arguments.

Signature:

ora:getMessage(locale, relativeLocation, resourceName, resourceKey, resourceLocation?)

Arguments:

  • locale - The locale of the message

  • relativeLocation - The subdirectory or message

  • resourceName - The name of the message resource

  • resourceKey - The key of the resource

  • resourceLocation - The location of the resource

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.8 listUsers

This function returns a list of LDAP users.

Signature:

ldap:listUsers('properties','filter')

Arguments:

  • properties - The properties name as defined in the directories.xml file

  • filter - The LDAP filter

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension/ldap

  • namespace-prefix: ldap

D.10.9 max-value-among-nodeset

This function returns the maximum value from a list of input numbers, the node-set inputNumber.

The node-set inputNumber can be a collection of text nodes or elements containing text nodes.

In the case of elements, the first text node's value is considered.

Signature:

orcl:max-value-among-nodeset(inputNumber as node-set)

Arguments:

  • inputNumber - The node-set of input numbers

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.10.10 min-value-among-nodeset

This function returns the minimum value from a list of input numbers, the node-set inputNumbers.The node-set can be a collection of text nodes or elements containing text nodes.In the case of elements, the first text node's value is considered.

Signature:

orcl:min-value-among-nodeset(inputNumbers as node-set)

Arguments:

  • inputNumber - The node-set of input numbers

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.10.11 search

This function returns a list of LDAP entries.

Signature:

ldap:search('properties','filter','scope'?)

Arguments:

  • properties - The properties name as defined in the bpel.xml file

  • filter - The filter for the entries

  • scope -The scope of the search

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension/ldap

  • namespace-prefix: ldap

D.10.12 square-root

This function returns the square root of inputNumber.

Example: orcl:square-root(25) returns 5

Signature:

orcl:square-root(inputNumber as number)

Arguments:

  • inputNumber - The input number for which the function calculates the square root

Property IDs:

  • namespace-uri: http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc

  • namespace-prefix: orcl

D.10.13 translateFromNative

This function translates the input stream to an XML file.

Signature:

ora:translateFromNative('string','nxsdTemplate'?,'nxsdRoot'?)

Arguments:

  • string - The data to be converted into an XML file.

  • nxsdTemplate - The XSD file used to define how the translation is performed.

  • nxsdRoot - The root element defined in the XSD file.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.10.14 translateToNative

Translates the XML to the native data.

Signature:

ora:translateFromNative('string','nxsdTemplate'?,'nxsdRoot'?)

Arguments:

  • string - The XML file to be converted into a string.

  • nxsdTemplate - The XSD file used to define how the translation is performed.

  • nxsdRoot -The root element defined in the XSD file.

Property IDs:

  • namespace-uri: http://schemas.oracle.com/xpath/extension

  • namespace-prefix: ora

D.11 Adding a Custom XPath Function

This section describes how you can create and add your own XPath functions to Oracle BPEL Process Manager. In this example, a function named is getNodeValue(arg1) is created.

  1. Implement the com.oracle.bpel.xml.xpath.IXPathFunction interface for your XPath function. The IXPathFunction interface has one method named call(context, args). The signature of this method is as follows:

    Object call(IXPathContext context, List args) 
        throws XPathFunctionException;
    
    

    For the following example, a function named getNodeValue(arg1) is implemented that gets a value of w3c node:

    package com.collaxa.cube.xml.xpath.dom.functions;
    
    public class GetNodeValue  implements IXPathFunction  {
     Object call(IXPathContext context, List args) throws XPathFunctionException {
            org.w3c.dom.Node node = (org.w3c.dom.Node) args.get(0);
            return node.getNodeValue()
       }
    }
    
    

    You now register the getNodeValue XPath function with Oracle BPEL Server.

  2. Open the following file:

    SOA_Oracle_Home\bpel\system\config\xpath-functions.xml
    
    
  3. Add the getNodeValue XPath function under the <bpel-xpath-functions> section.

    <function id="getNodeValue" arity=Ó1Ó>
      <classname>com.collaxa.cube.xml.xpath.dom.functions.GetNodeValueFunction
         </classname>
            <property id="namespace-uri">
                <value>http://boo.com/xpath/function</value>
                <comment>Namespace URI for this function</comment>
            </property>
            <property id="namespace-prefix">
                <value>boo</value>
                <comment>Namespace prefix for this function</comment>
            </property>
     </function>
    
    
  4. Note the following function syntax details:

    • <function> has the following attributes:

      • id — Defines the XPath function name

      • arity — Defines the number of required arguments that the function can accept (for example, a function takes 5 arguments, but the last 2 arguments are optional; in this case, the value for arity is 3).

    • <classname> — Defines the XPath implementation class name.

  5. Specify the following initialization properties for each function:

    • namespace-uri — Associate each XPath with a namespace.

    • namespace-prefix — Specify a namespace prefix for this XPath function.

    For example, assume you want to call the XPath function from Oracle BPEL Process Manager. You must define the namespace uri in the <process> section as follows:

    <process name="XPathFunction"
         targetNamespace="http://samples.cxdn.com"
         suppressJoinFailure="yes"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:boo="http://boo.com/xpath/function"
         xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    
    <copy>
         <from expression="boo:getNodeValue(bpws:getVariableData
            ('output','payload','/invoice/lineItems/item[3]/@sku'))"/>
         <to variable="mySKU"/>
       </copy>
    </process>
    
    
  6. Go to the following directory to see how this function is used in a sample:

    SOA_Oracle_Home\bpel\samples\references\XPathFunction
    
    
  7. Review the getNodeValue() XPath function code shipped with this sample.

    package com.collaxa.cube.xml.xpath.dom.functions;
    
    import java.util.List;
    import com.oracle.bpel.xml.xpath.IXpathFunction;
    import com.oracle.bpel.xml.xpath.IXPathContext;
    import com.oracle.bpel.xml.xpath.XPathFunctionException;
    
    import org.w3c.dom.Node;
    
    /**
     * Returns the value of the dom node as String
     * 
     * Usage: String ora:getNodeValue(Node node)
     *  Node - dom node
     *
     */
    public class GetNodeValueFunction implements IXPathFunction
    {
    
        public Object call(IXPathContext context, List args) throws
     XPathFunctionException
        {
            try
            {
                if (args.size() == 1)
                {
                    return evaluate( args.get(0 );
                }
            }
            catch(Exception e)
            {
               throw new XPathFunctionException (e.getMessage());
            }
            throw new XPathFunctionException ("getNodeValue() requires one argument
     which is a dom node.");
        }
    
        public Object evaluate( Object node ) throws Exception {
            
            if (node != null)
            {
                if (node instanceof Node)
                    return ((Node)node).getNodeValue();
                else
                    return String.valueOf(node);        
            }
            return null;
        }
    }
    

D.12 Summary

This appendix lists the XPath extension functions, along with their descriptions, signature, argument descriptions, and property ID information.