What You May Need to Know About Simultaneous onMessage Branches in BPEL 2.0

14-8 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite standard-elements receive This type uses the bpelx:for attribute to specify a static value or an XPath expression that must evaluate to an XML schema type duration. Only one of the bpelx:for or bpelx:until attributes is permitted for an activity. If the XPath expression evaluates to a negative duration, the timeout is ignored and an event is logged to the instance audit trail indicating that the duration value is invalid. Once a valid duration value is retrieved, the expiration date for the activity is set to the current node time or cluster time after this is available, plus the duration value. For example, the duration value bpelx:for=PT5M specifies that the activity expects an inbound message to arrive no later than five minutes after the activity has started execution. Timeout durations can only be specified on the following: ■ Midprocess receive activities ■ Receive activities that do not specify createInstance=true A receive activity can only time out after it has been instantiated, which is not the case with entry receive activities.

14.3.2 Timeout Settings as an Absolute Date Time

You can specify a timeout setting as an absolute deadline for request-response receive activities. This type uses the syntax shown in Example 14–3 . Example 14–3 Timeout Settings as an Absolute Date Time receive bpelx:until=deadline-expr standard-elements receive The expected expiration time for the bpelx:until attribute must be at least two seconds ahead of the current time. Otherwise, the timer scheduling is ignored and skipped, just as if the timer was never specified. The bpelx:until attribute specifies a static value or an XPath expression that must evaluate to an XML schema type datetime or date. Only one of the bpelx:for or bpelx:until attributes is permitted for an activity. XPath version 1.0 is not XML schema-aware. Therefore, none of the built-in functions of XPath version 1.0 can create or manipulate dateTime or date values. However, it is possible to perform one of the following: ■ Write a constant literal that conforms to XML schema definitions and use that as a deadline value ■ Extract a field from a variable part of one of these types and use that as a deadline value XPath version 1.0 treats that literal as a string literal, but the result can be interpreted as a lexical representation of a dateTime or date value. Note: The timeout setting attribute does not apply to the onMessage branch of a pick activity because the same functionality currently exists with the onMessage and onAlarm branches of that activity. Using Events and Timeouts in BPEL Processes 14-9 Once a valid datetime or date value has been retrieved, the expiration date for the activity is set to the specified date. For example, the datetime value bpelx:until=2009-12-24T18:00+01:00 specifies that the activity expects an inbound message to arrive no later than Dec 24, 2009 6:00 pm UTC+1 after the activity has started execution. Timeout dates can only be specified on the following activities: ■ Midprocess receives ■ Receive activities that do not specify createInstance=true A receive activity can only time out after it has been instantiated, which is not the case with entry receive activities.

14.3.3 Timeout Settings Computed Dynamically with an XPath Expression

The timeout setting for request-response receive and onMessage branches of pick activities can be set using an XPath expression instead of entering a static duration or datetime value. In this case, the value of the expression must return either: ■ A string that can be interpreted as a static XML duration or datetime value ■ An XML schema duration or datetime type Example 14–4 shows the syntax for using XPath expressions. Example 14–4 Timeout Settings Computed Dynamically with an XPath Expression bpelx:for=bpws:getVariableDatainput, payload, tns:waitValuetns:for bpelx:until=bpws:getVariableDatainput, payload, tns:waitValuetns:until If the returned expression value cannot be interpreted as an XML schema duration or datetime type, an event is logged in the instance audit trail indicating that an invalid duration and datetime value was specified, and no activity expiration time can be set.

14.3.4 bpelx:timeout Fault Thrown During an Activity Timeout

If a valid XML schema duration or datetime value is returned from the bpelx:for or bpelx:until attribute, a bpelx:timeout fault is thrown from the timed-out activity. This fault can be caught by any catch or catchAll block and handled like a regular BPEL fault. The message of the fault is the name of the activity. In addition, an event is logged to the instance audit trail indicating that the activity has timed out because the expected callback message failed to be received before the timeout duration. If the activity receives a callback from the partner before the timeout period, no fault is thrown. If a callback is received while the activity is being timed out, the callback message is not delivered to the activity and it is marked as canceled in the delivery message table. If a timeout action is attempted at the same time that a callback Note: The timeout setting attribute does not apply to the onMessage branch of a pick activity because the same functionality currently exists with the onMessage and onAlarm branches of the pick activity.