9 Replies Latest reply: Feb 14, 2013 2:44 PM by 984583 RSS

    SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty

    984583
      I need to receive optional jms property from jms message in the BPEL process.

      I use jca.jms.JMSProperty.myPropery in the Receive. It works well if the property exists in the JMS message.

      I am getting selectionFailure BPEL fault on receive if the custom property is unavailble on the JMS message.

      The log information is as follows :

      <bpelFault><faultType>0</faultType><selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>The <from> value is invalid. The result of from-spec is null. Either the from node value or the xpath query in the from node value was invalid. According to BPEL4WS spec 1.1 section 14.3, the from node value should not be empty. Verify the from node value at line number no line in the BPEL source. </summary></part></selectionFailure></bpelFault>

      The error make sense; but Receive is the first activity in the BPEL process.

      How can I check the property to see if it is set before retrieving the property or make the property optiional at Receive activity?
        • 1. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
          RobertMetcalf
          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
          • 2. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
            983647
            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.
            • 3. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
              984583
              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"
              portType="ns6:Consume_Message_ptt" operation="Consume_Message"
              variable="ReceiveIncomingCmsg_Consume_Message_InputVariable"
              createInstance="yes">
              <bpelx:outputProperty name="jca.jms.JMSCorrelationID"
              variable="jmsCorrelationId"/>
              <bpelx:outputProperty name="jca.jms.JMSProperty.Mandatory"
              variable="jmsProperty_Mandatory"/>
              <bpelx:outputProperty name="jca.jms.JMSProperty.Optional"
              variable="jmsProperty_Optional"/>
              </receive>
              • 4. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                983647
                When the optional one is null, the exception was thrown and captured with doing nothing.
                The flow will then terminated.
                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.
                • 5. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                  984583
                  I did as you say.
                  The following is in the receive block:
                  SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                    <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>
                  Ignore the Exception has a side effect of not getting all the properties. In this case, jca.jms.JMSCorrelationID does not get the value.
                  • 6. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                    983647
                    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?
                    • 7. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                      984583
                      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.
                      • 8. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                        984583
                        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.
                        • 9. Re: SOA 11g : Receive optional jms header properties from jca.jms.JMSProperty
                          984583
                          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.