I. BPEL: View Instances
Its always very difficult job to monitor the BPEL instances in console.So, i prefer to monitor the instance state, titile details from Data base shema.
1. SELECT * from cube_instance;
2. SELECT cie.cikey cikey, dmn.domain_id domain_id, cie.state state,cie.creation_date creation_date, cie.domain_ref domain_ref FROM cube_instance cie;
Here you can refer the state code detaials:
STATE CODE
|
STATE NAME
|
0
|
Initiated state
|
1
|
Open,Running state
|
2
|
Open, Suspended state
|
3
|
Open,Faulted state
|
4
|
Closed,Pending-Cancel state
|
5
|
Closed,Completed state
|
6
|
Closed,faulted state
|
7
|
Closed,Cancelled state
|
8
|
Closed,aborted state
|
9
|
Closed,Stale state
|
II. Passing BPEL Variable contents into XSLT as Parameters
Here is an interesting solution for passing content of BPEL variables into XSL Transformations as XSL Parameters.
XSL is executed using the XPath Extension Function ora:processXSLT. The two arguments for this extension function are as follows.
1) The XSL File Name
2) The source variable to be transformed [bpws:getVariableData(...)]
XSL is executed using the XPath Extension Function ora:processXSLT. The two arguments for this extension function are as follows.
1) The XSL File Name
2) The source variable to be transformed [bpws:getVariableData(...)]
But there is one more argument that this XPath function can accept - 'properties'. Note the signature of this function specified in xpath-functions.xml
Signature: ora:processXSLT('template','input','properties'?).
These properties translate to XSL Parameters that can be accessed within the XSL Map using the construct
<xsl:param name="<paramName>"/>
You can retrieve the value of this parameter within your XSLT in a way similar to the way used to extract data from XSL variables.
For e.g. <Name><xsl:value-of select="$param1"/></Name>
The "properties" argument of the XPath function is expected to be an XML Element that has the following structure.
Illustrated below is an example of such a properties XML.
Illustrated below is an example of such a properties XML.
<parameters xmlns:ns2="http://schemas.oracle.com/service/bpel/common" xmlns="http://schemas.oracle.com/service/bpel/common">
<ns2:item> <ns2:name>userName</ns2:name> <ns2:value>govinda</ns2:value> </ns2:item> <ns2:item> <ns2:name>location</ns2:name> <ns2:value>CHENNAI</ns2:value> </ns2:item> </parameters> |
Within the XSLT the parameters are accessible through their names. In this case, the parameter names are "userName" and "location", and their values are "govinda" and "CHENNAI" respectively.
Approach1) Declare a variable that is of the abovementioned dataType [see XML above.]
2) Populate the variable with the contents of the BPEL variable you wish to pass into the XSLT
3) Invoke processXSLT() with the XSL File, source variable, and the parameters variable.
4) Access the parameter contents within the XSLT
Example
BPEL Snippet Code
<!--Step 1: initialize the parameters variable from whatever BPEL variable whose information you need to access from within XSLT -->
<assign name="initializeXSLParameters"> <bpelx:annotation> <bpelx:pattern>transformation</bpelx:pattern> </bpelx:annotation> <copy> <from expression="ora:processXSLT('SetParams.xsl', bpws:getVariableData('inputVariable','payload'))"/> <to variable="propertiesXMLVar"/> </copy></assign> <!--Step 2: Invoke the XSLT with the parameters as the third argument --> <assign name="executeXSLT"> <bpelx:annotation> <bpelx:pattern>transformation</bpelx:pattern> </bpelx:annotation> <copy> <from expression="ora:processXSLT('TestXSLParams.xsl', bpws:getVariableData('inputVariable','payload'), bpws:getVariableData('propertiesXMLVar'))"/> <to variable="outputVariable" part="payload"/> </copy> </assign> |
XSLT Snippet
<xsl:stylesheet version="1.0" ....> <xsl:param name="userName"/>
<xsl:param name="location"/> <xsl:template match="/"> <ns1:TestXSLParamsProcessResponse> <ns1:result> <xsl:value-of select="concat('User : ', $userName, ' Location : ',$location)"/> </ns1:result> </ns1:TestXSLParamsProcessResponse> </xsl:template> </xsl:stylesheet> |
Output
<TestXSLParamsProcessResponse xmlns:ns1="http://xmlns.oracle.com/TestXSLParams" xmlns="http://xmlns.oracle.com/TestXSLParams">
<ns1:result>User : govinda Location : Chennai</ns1:result></TestXSLParamsProcessResponse> |
III. Insert New Line Character in BPEL Payload
The trick to insert the new line character in XML payload from Oracle BPEL is to append in the from expression of assign activity, then check your .bpel file it would have &#13; rather than because Jdeveloper replaces & with its equivalent escape character &. You need to replace & with & so it would become the correct new line character .