WSO2 Business Process Server v3.1.0 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

# Flexible Assigns

- Auto Complete Copy Destination (L-Value)
- Add support for the ignoreMissingFromData attribute in <copy>

## Auto Complete Copy Destination (L-Value)

A lot of times, users expect the <copy> operation in a WS-BPEL assign activity to behave such that the path specified by the destination ("to-spec") is automatically created, if it doesn't already exist. By default, if the to-spec used within a <copy> operation does not select exactly one XML information item during execution, then the standard fault bpel:selectionFailure is thrown (as mandated by the spec).

To override this default behavior, we introduce a insertMissingToData attribute in the <copy> operation, which if it is set to "yes", will instruct the runtime to complete the (XPath) L-value specified by the to-spec, if no items were selected. For the sake of simplicity, we will complete the to-spec if and only if:

1. It's a path expression whose steps are separated by "/", and
2. Its steps have an axis, which is either "child" or "attribute", and
3. Its steps have no following predicates, and
4. Its steps test the name of a node, without the use of wild cards.

Formally, the grammar of the to-spec, for which auto-complete is enabled, may be defined in terms of these productions:

                PathExpr ::= ("/" RelativePathExpr?) | RelativePathExpr
                RelativePathExpr ::= ForwardStep (("/" ) ForwardStep)*
                ForwardStep ::= (ForwardAxis QName) | AbbrevForwardStep
                AbbrevForwardStep ::= "@"? QName
                ForwardAxis ::= ("child" "::") | ("attribute" "::")

The example below illustrates the use of the insertMissingToData attribute. Let's say that the variable "response" is uninitialized. In that case, the first <copy> operation will fail, whereas the second one will succeed.

## Add support for the ignoreMissingFromData attribute in <copy>

The attached patch adds support for the following attributes in the BPEL assign activity's copy operation:

1. The optional @ignoreMissingFromData attribute, which if it has the value of "yes", and the from-spec returns zero XML information items, then no bpel:selectionFailure is thrown, and the to-spec is not evaluated.
2. An extension @ignoreUninitializedFromVariable attribute, which if it has the value of "yes", and the from-spec contains an uninitialized variable, then no bpel:uninitializedVariable is thrown, and the to-spec is not evaluated.

The informal syntax of the above attributes is shown below:

                <copy ignoreMissingFromData="yes|no"? ignoreUninitializedFromVariable="yes|no"?>
                      from-spec to-spec
                </copy>