This content has been marked as final. Show 9 replies
I am not sure this will work for you but I have got round the "result of from-spec is null" error before by adding a call to the text( ) function to the entire from spec.
e.g. if the from spec it "Blah" change it to "text(Blah)"
This worked in another situation for me and maybe will work when reading optionial properties as well
If all of your jms properties are optional, then keep the receive activity by itself inside a new scope and add a catch block, to catch selection failure fault, moreover, you may do nothing inside the catch block.
I've tried this already.
There are two properties mandatory and one optional.
When the optional one is null, the exception was thrown and captured with doing nothing.
The flow will then terminated.
Only one of two manadatory properties has a value.
Since the from spec is inside the receive activity, I do not know how to use text function either.
The source of the Receive :
<receive name="ReceiveIncomingmsg" partnerLink="InMsgReceiver"
When the optional one is null, the exception was thrown and captured with doing nothing.I guess you have added the catch block for the main scope. Did you create a new scope and added just the receive activity in it? Share your BPEL.
The flow will then terminated.
I did as you say.
The following is in the receive block:
SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
Ignore the Exception has a side effect of not getting all the properties. In this case, jca.jms.JMSCorrelationID does not get the value.
<faultHandlers> <catchAll> <sequence name="Sequence_2"> <scope name="NotificationService"> ....... </scope> <terminate name="Terminate_1"/> </sequence> </catchAll> </faultHandlers> <sequence name="main"> <scope name="Scope1"> <faultHandlers> <catch faultName="bpws:selectionFailure"> <empty name="SupressSelectionFault"/> </catch> </faultHandlers> <receive name="ReceiveIncomingMsg" partnerLink="InMsgReceiver" portType="ns6:Consume_Message_ptt" operation="Consume_Message" variable="ReceiveIncomingCDSXmsg_Consume_Message_InputVariable" createInstance="yes"> <bpelx:outputProperty name="jca.jms.JMSCorrelationID" variable="jmsCorrelationId"/> <bpelx:outputProperty name="jca.jms.JMSProperty.Msg_Type" variable="msgType"/> <bpelx:outputProperty name="jca.jms.JMSProperty.msgId" variable="jmsPropertyMsgId"/> </receive> </scope>
When you said the composite instance is being terminated, are you seeing your "Terminate_1" activity...
If that is the case, your bpel is faulting else where, later after "receive" activity. Are you not using your variable "jmsCorrelationId" later in the bpel, if so did you handle it?
Thanks for your help.
I did some more testing.
After catching the selectionFault Exception, the flow does continue on to finish.
Basically, this process receive a message and forwarded to another application.
The process need to pass jmsCorrelationId to message going to the destination application.
Any more help on this?
I still cannot resolve my problem. Ignoring the exception will not work for me since I need to retrieve all the available properties. When exception is thrown,
some header properties are not retrieved.
Oracle support confirmed that :
" I have received confirmation from Product Management that this use case is not currently supported. There is no such thing as "optional" properties in a receive activity, if they are defined they need to be there.
I have raised an Enhancement Request under bug 16322823 to review this and add a mechanism to make it possible to have optional properties in the receive activity for future versions of the product. "
No solution for now.