Thursday 6 June 2013

XML Declataion : BPEL 10G vs 11G

Consider a simple BPEL 10G process that invokes as external webservice.
Using TCPMon (or any tunneling utility) , we would observe that the SOAP requests to the external webservice contains XML declaration (<?xml version="1.0" encoding="UTF-8"?>)
While in 11G the XML decelerations are  absent.

10G :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>



11G :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>

Please note that both these SOAP requests are valid.


NOTE:
--------
On BPEL 10G , there is no way for any external code (BPEL or otherwise) to modify/remove the XML declaration from the SOAP requests.

SOA 11G Human Task Email Subject Customization

SOA 11G allows only limited customizations of notification email subjects.
Advanced customization would be available from 12c.

This subject is dealt with in Oracle KM Note
"HumanTask Email Notification Customization in SOA 11g [ID 1420793.1]"

However , this note is slightly misleading.

EXPLANATION:
------------------
The "Email Subject" is built based on the following resource:
bpm-services.jar#\bpel\services\workflow\resource\WorkflowLabels.properties

The key-value for the subject line is :
TASK_NOTIF_MSG.SECURE_NOTIFICATION_SUBJECT=Task {0} requires your attention.

The above subject string(Task {0} requires your attention.)  contains two types of attributes
A. Static
B. Dynamic [these attributes are the represented as {}]

Following the document 1420793.1 , we can only customize the static aspects of the subject.

However, the dynamic values [{0}] are generated by the code and cannot be
customized
(e.g) "TASK_NOTIF_MSG.SECURE_NOTIFICATION_SUBJECT",new String[] {taskNumber}
where taskNumber = {0}.

Customizing the dynamic aspects of the subject line would require changes to the existing HWF code and is tracked via
Enhancement Bug 13706421 - [ENH] CHANGE THE SUBJECT OF THE EMAIL NOTIFICATION
FROM HUMAN WORKFLOW

Debug : Actionable Email Approval


SOA relies on SDPM layer to send/receive notifications.
If the human tasks are not updated after being actioned upon by  emails , there could be issues with SDPM layer.

1. During SOA Start up
Generally , when the SOA server starts , we should observe the following trace in the diagnostic log

[NOTIFICATION] [] [oracle.sdp.messaging.driver.email] [tid:
[ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default
(self-tuning)'] [userId: <anonymous>] [ecid:
0000JrlbamN9pYppKOCCye1HPCGg000002,0] [APP: usermessagingdriver-email] Email
Server: {email_server_name}

[NOTIFICATION] [] [oracle.sdp.messaging.driver.email] [tid:
[ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default
(self-tuning)'] [userId: <anonymous>] [ecid:
0000JrlbamN9pYppKOCCye1HPCGg000002,0] [APP: usermessagingdriver-email]
MailDriver: receiver on

[NOTIFICATION] [SDP-26033] [oracle.sdp.messaging.driver.base] [tid:
[ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default
(self-tuning)'] [userId: <anonymous>] [ecid:
0000JrlbamN9pYppKOCCye1HPCGg000002,0] [APP: usermessagingdriver-email]
Started messaging driver:
Farm_soa_domain/soa_domain/soa_server1/usermessagingdriver-email:oracle_sdpmes
sagingdriver_email#Email-Driver


It's important to check for the following trace messages in the log
MailDriver: receiver on &
Started messaging driver


If these messages appear in the log , it means that SDPM is up and running.

If not , the diagnostic log would contain  an exception message ,

for (e.g)
1. exception javax.mail.AuthenticationFailedException

SOLUTION:
---------
Confirm that the user password in the mail  server matches with the one
provided in Email Driver Configuration page.


2.An unexpected exception was caught.[[
javax.mail.MessagingException: sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target;


This exception indicates that the configured user was not able to connect to
the email store , hence incoming notifications would not be intercepted

This exception generally happens because the mail server is secured and the
certificate is not imported to the server's trust store.


SOLUTION:
---------
Import the Mail server's certificate into SOA server's trust store.


 

2. After Actionable Email 
we should observe the following trace in the diagnostic log
[NOTIFICATION] [SDP-26036] [oracle.sdp.messaging.driver.dispatcher] [tid:
LongRunning Work-email-adapter.rar-0] [userId: <anonymous>] [ecid:
0000JrlRSy^9pYppKOCCye1HPBUc000002,1:29402] [APP: usermessagingdriver-email]
Receiver received message with id: 51656360.7040206@oracle.com.



[NOTIFICATION] [] [oracle.soa.services.notification] [tid: Workmanager: ,
Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\r\n] [userId:
<anonymous>] [ecid: 0000JrlRSy^9pYppKOCCye1HPBUc000002,1:29403] [APP:
soa-infra] <.> HWFMailer: Received an incoming Notification Message from SDPM
[NOTIFICATION] [] [oracle.sdp.messaging.driver.email] [tid: LongRunning
Work-email-adapter.rar-0] [userId: <anonymous>] [ecid:
0000JrlRSy^9pYppKOCCye1HPBUc000002,1:29402] [APP: usermessagingdriver-email]
Message processed successfully - {Subject_Email}


It's important to check for the following trace messages in the logReceiver received message with id
Message processed successfully

If these messages appear in the log , it means that actionable email has been received by the SDPM layer.