|
Page Edited :
ODExSITE :
BPEL Extensions
BPEL Extensions has been edited by Alex Boisvert (Nov 08, 2007). Content:ODE extends the WS-BPEL in areas that aren't covered by the spec. This page details these extensions. Implicit CorrelationsIntroductionBPEL process instances are stateful — therefore, a client interacting with the BPEL engine must identify the particular instance with which it intends to interact in all of its communications. The BPEL specification defines a mechanism — correlation — which allows the process designer to specify which parts of an incoming message (i.e. a message going from a client to the BPEL server) should be used to identify the target process instance. Correlation is a powerful mechanism — however it is a bit complicated and relies on "in-band" message data to associate a messages with a process instance. To keep simple cases simple, ODE provides an alternative correlation mechanism — implicit correlation — that automatically handles correlation through "out-of-band" session identifiers. The mechanism is simple: a unique session identifier is associated with every every partner link instance. When a message is sent on a partner link, the session identifier is sent along with the message. The recipient is then able to use the received session identifier in subsequent communications with the process instance. Messages received by the BPEL engine that have a session identifier are routed to the correct instance (and partner link) by that session identifer. There are two major use cases for the implicit correlation mechanism requiring different levels of familiarity with the mechanism's details: process to process and process to service interactions. The former case deals with situations where the ODE BPEL process instance is communicating with another ODE process instance. The latter deals with situations where a ODE BPEL process instance is communicating with an external (non-ODE) service. Process to Process Interaction Use CaseWhen an ODE process needs to communicate with other ODE processes, using implicit correlations is quite simple. Simply omit the <correlations> element from the <receive>, <pick>, and <invoke> activities. The following is an example showing one process (processA) starting another (processB) and then being called back:
In the above example, ODE will use the implicit correlation mechanism because no explicit correlations are specified. Communication between the two processes will reach the correct instance as long as the same partner link is used. For a complete example check MagicSession Process to Service Interaction Use CaseSee the Stateful Exchange Protocol. Activity Failure and RecoveryThere are several types of error conditions. In this document we introduce a class of error condition called failures, distinct from faults, and describe how failures are caught and handled by the process engine. A service returns a fault in response to a request it cannot process. A process may also raise a fault internally when it encounters a terminal error condition, e.g. a faulty _expression_ or false join condition. In addition, processes may raise faults in order to terminate normal processing. In contrast, failures are non-terminal error conditions that do not affect the normal flow of the process. We keep the process definition simple and straightforward by delegating failure handling to the process engine and administrator. For example, when the process is unable to perform DNS resolution to determine the service endpoint, it generates a failure. An administrator can fix the DNS server and tell the process engine to retry the activity. Had the DNS error been reported as a fault, the process would either terminate or require complex fault handling and recovery logic to proceed past this point of failure. In short, failures shields the process from common, non-terminal error conditions while retaining simple and straightforward process definitions that do not need to account for these error conditions. From Failure to RecoveryCurrently, the Invoke activity is the only activity that supports failure handling and recovery. The mechanism is identical for all other activities that may support failure handling and recovery in the future. In case of the Invoke activity, a failure condition is triggered by the integration layer, in lieu of a response or fault message. The Invoke activity consults its failure handling policy (specified here) and decides how to respond. Set faultOnFailure to yes, if you want the activity to throw a fault on failure. All other failure handling settings are ignored. The activity will throw the activityFailure fault. The activityFailure fault is a standard fault, so you can use the exitOnStandardFault attribute to control whether the process exits immediately, or throws a fault in the enclosing scope. Set retryFor to a positive integer if you want the activity to attempt self-recovery and retry up to that number of times. Set retryDelay to a reasonable time delay (specified in seconds) between retries. For example, if you set retryFor=2, retryDelay=30, the activity will retry after 30 and 60 seconds, for a total of three attempts, before entering activity recovery mode. If the activity retries and succeeds, it will complete successfully as if no failure occurred. Of course, the activity may retry and fault, e.g. if the invoked service returns a fault. If the activity has exhausted all retry attempts, it enters activity recovery mode. By default retryFor is zero, and the activity enters recovery mode after the first failure. When in recovery mode, you can recover the activity in one of three ways:
Specifying Failure BehaviorUse the failureHandling extensibility element defined in the namespace http://ode.apache.org/activityRecovery <ext:failureHandling xmlns:ext="http://ode.apache.org/activityRecovery"> <ext:faultOnFailure> _boolean_ </ext:faultOnFailure> <ext:retryFor> _integer_ </ext:retryFor> <ext:retryDelay> _integer_ </ext:retryDelay> </ext:failureHandling> The faultOnFailure, retryFor and retryDelay elements are optional. The default values are false for faultOnFailure, and zero for retryFor and retryDelay. An activity that does not specify failure handling using this extensibility element, inherits the failure handling policy of its parent activity, recursively up to the top-level activity of the process. You can useinheritence to specify the failure handling policy of a set of activities, or all activities in the process, using a single failureHandling extensibility element. Note that due to this behavior, if activity S specifies failure handling with the values retryFor=2, retryDelay=60, and has a child activity R that specifies failure handling with the values retryFor=3, the retryDelay value for the child activity R is 0, and not 60. Using the failureHandling element without specifying one of its value elements will apply the default value for that element. ExamplesA simple invoke with the ext:failureHandling extension: <bpel:invoke inputVariable="myRequest" operation="foo" outputVariable="aResponse" partnerLink="myPartner" portType="spt:SomePortType"> <ext:failureHandling xmlns:ext="http://ode.apache.org/activityRecovery"> <ext:faultOnFailure>false</ext:faultOnFailure> <ext:retryFor>2</ext:retryFor> <ext:retryDelay>60</ext:retryDelay> </ext:failureHandling> </bpel:invoke> And a sequence activity that converts failures into faults: <bpel:sequence> <ext:failureHandling xmlns:ext="http://ode.apache.org/activityRecovery"> <ext:faultOnFailure>true</ext:faultOnFailure> </ext:failureHandling> ... <bpel:invoke inputVariable="myRequest" operation="foo" outputVariable="aResponse" partnerLink="myPartner" portType="spt:SomePortType"> <bpel:catchAll> ... </bpel:catchAll> </bpel:invoke> </bpel:sequence> Process Instance ManagementThe process instance management provides the following information:
Use the recoverActivity operation to perform a recovery action on an activity in recovery mode. The operation requires the process instance ID, the activity instance ID and the recovery action to perform (one of retry, fault or cancel). You can also determine when failure or recovery occurred for a given activity instance from the execution log. XPathApache ODE extends the default XPath coverage provided by the WS-BPEL XPath 2.0To use XPath 2.0 in your processes just use the following queryLanguage and expressionLanguage attributes: queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" If you want support at the process just add these attributes to your root process element. If you want to stick with XPath 1.0 but want XPath 2.0 support for a specific assignment you can also define these attributes on an assign element. Extension FunctionsAll extension fucntions are defined in the ODE extension namespace: http://www.apache.org/ode/type/extension splitToElementsIt's impossible to split a given string into a sequence of elements using assignments. The only possible alternative is XSL which is a lot of complexity for a very simple usage pattern. The ode:splitToElements function splits a given string (that can be a variable reference) into several elements by using a specific separators. Here is an example: <assign> <from>ode:splitToElements($authorizeMessage.credential/userList, ',', 'user')</from> <to>$authorizedUsers</to> </assign> If the source element contains a list like "joe, paul, fred" the target variable will be assigned the sequence of elements: <user>joe</user> <user>paul</user> <user>fred</user> Alternatively this function can take a fourth parameter that would be the namespace of the elements used to wrap the split strings: ode:splitToElements(stringToSplit, separator, targetElement, targetNamespace) External VariablesUnable to render {include} Couldn't find a page to include called: External Variables |
Unsubscribe or edit your notifications preferences
