2011-10-22 65 views
1

我試圖在soa套件11g ps3下使用bpel擴展進行事件處理。我正嘗試訂閱來自活動傳遞網絡的活動,但我收到了錯誤消息。Oracle BPEL事件處理與「onEvent」活動和業務事件

這是代碼:

<eventHandlers> 
    <onEvent bpelx:eventName="ns4:discountEvent" variable="discEvent" > 
    <scope name="Scope1"> 
     <sequence name="Sequence1"> 
     <exit name="Exit1"/> 
     </sequence> 
    </scope> 
    </onEvent> 
</eventHandlers> 

編譯器是給我下面的錯誤:

Error(52): Activity <bpel:onEvent> must have "element", "messageType" attribute present. 

我找不到在「的onEvent」活動使用擴展的任何信息。

任何幫助表示讚賞!

謝謝,Chris

回答

1

事件處理程序與其他交互活動略有不同。當接收,調用等工作在以前定義的變量上時,事件處理程序定義自己的變量,這在onEvent的子活動範圍內是可見的。爲了給這個變量賦一個類型,messageType或者一個元素需要被標識爲變量的聲明類型。這就是爲什麼元素或messageType是需要的。

請找到BPEL 2.0規範的相關報價如下:

The variable attribute, if it exists, identifies a variable local to the event handler that will contain the message received from the partner. [SA00087] The messageType attribute specifies the type of the variable by referencing a message type definition using its QName. The type of the variable (as specified by the messageType attribute) MUST be the same as the type of the input message defined by operation referenced by the operation attribute. Optionally the messageType attribute may be omitted and instead the element attribute substituted if the message to be received has a single part and that part is defined with an element type. That element type MUST be an exact match of the element type referenced by the element attribute. The variable and messageType/element attributes constitute the implicit declaration of a variable of that name and type within the associated scope associated of the event handler. If an element attribute is used then the binding of the incoming message to the variable declared in the event handler occurs as specified for the receive activity in section 10.4. Providing Web Service Operations – Receive and Reply .