WSO2 Business Process Server v3.0.1 Documentation

##### Overview

- Home
- Release Note
- WS-BPEL Compliance
- License

##### Downloads

- Releases

##### Installation Guide

- Installing WSO2 BPS

##### Quick Start Guide

- Modeling the process
- Deploying the process
- Testing the process

##### User Guide

- Deploying BPEL Processes
- Deploying Human Tasks
- Managing BPEL processes
- Managing BPEL process instances
- QoS for BPEL processes
- Securing BPEL processes
- Invoking secured partner services
- Versioning
- Management API

##### Human Task Guide

- Human Tasks Quick Start Guide
- Deploying HumanTasks
- Managing Tasks
- Developing a Human Task Artifact
- Human Task Management and Configuration
- Human Task Concepts

##### Administrator Guide

- External data sources Configuration
- Registry Configuration
- Events
- Unified Endpoints
- BPEL Extensions
- Transaction Factory Configuration
- Message Exchange Interceptors
- OpenJPA specific properties
- JMS Transport Configuration
- Process Instance Cleanup Tasks
- Process Hydration and Dehydration
- Enabling Peer-to-Peer(P2P) Communication
- Setting up a BPS Cluster

##### Best Practices

- Process Deployment Best Practices

##### Concepts

- Process Versioning
- Process instance events
- Partner links

##### WS-BPEL Extensions

- Activity Failure and Recovery
- Extension Activities and Extensible Assign Operations
- XPath Extensions
- Iterable ForEach
- Flexible Assigns
- BPEL4People Extension

##### Samples

- HelloWorld
- If-Else
- ForEach
- While
- Repeat Until
- Flow and Links
- Pick
- Synchronous and Asynchronous Service Invocations
- Fault Handling
- Split
- XslTransform
- Compensation Handler
- Event Handler

##### Resources

- FAQ
- External Articles
- Library
- Source Code

##### Community

- Forum
- Mailing Lists

##### Project Information

- Issue Tracking

# Activity Failure and Recovery

- BPEL Extensibility
  - Extension Activities
  - Extensible Assign Operations
- Using BPEL Extensibility in WSO2 Business Process Server
  - Installation of extensions
- Developing Extension Bundles

## BPEL Extensibility

Since BPEL 2.0, it is possible to extend the language by user-defined activities and custom variable assignment mechanisms. WSO2 Business Process Server (>= 1.1.0) supports these extensibility mechanisms and provides a plug-in architecture that allows for registering third-party extensions.

BPEL extensions must be declared for use in the process preamble to tell the engine which extensions must be available and which are optional. This can be done by adding an <extension> element to your BPEL process model:

    <bpel:process...>

        <bpel:extensions>
            <bpel:extension namespace="#extension-namespace#"
                            mustUnderstand="#yes|no#"/>
        </bpel:extensions>

    ...
    </bpel:process>

This snippet declares the given extension namespace and tells the engine what to do if no extension bundle is registered for this namespace. If mustUnderstand is yes and no extension bundle is registered the engine complains during the deployment of the process model and refuses the execution of the process model. If mustUnderstand is no, the engine logs a warning but continuous with deployment and execution. Unregistered extension activities are then executed like an <empty> activity.

- Extension Activities

      <extensionActivity>
          <anyElementQName standard-attributes>
              standard-elements
          </anyElementQName>
      </extensionActivity>

- Extensible Assign Operations

      <assign validate="yes|no"? standard-attributes>
          standard-elements
          <extensionAssignOperation>
              assign-element-of-other-namespace
          </extensionAssignOperation>
      </assign>

## Using BPEL Extensibility in WSO2 Business Process Server

Warning: WSO2 Business Process Server version
BPEL extensions are only available in WSO2 Business Process Server 1.1.x.

In WSO2 Business Process Server, extension activities and extension assign operations are grouped into so called Extension Bundles. Extension bundles are associated with an extension namespace and may provide several Extension Operations. Extension operations are the actual implementations of extension code and can be used for both, extension activities and extension assign operations.

### Installation of Extensions

Copy the extension jar to BPS_HOME/repository/components/lib directory. Then add a configuration entry to bps.xml in BPS_HOME/conf directory.

    <bps xmlns="http://wso2.org/bps/config">
      ...
        <extensionBundles>
            <runtimes>
               <runtime>org.wso2.bps.samples.extension</runtime>
            </runtimes>
            <validators>
               <validator>class name of the validator</validator>
            </validators>
        </extensionBundles>
       ...
    </bps>

## Developing Extension Bundles

You can find a sample extension implementation here.