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

# Sample Guide - HelloWorld

### Table of Content

- Objective
- Prerequisites
- Overall Idea

### Objective

Explains the basic constructs like <import/>, <partnerLinks/>, <variables/>.

### Prerequisites

- Log in into BPS server admin console.
- Under Business Processes -> Add BPEL.
- Upload the HelloWorld2.zip , (all samples are located at our sample repository.)
- Under the Business Processes -> Processes.
- Under the WSDL details widget -> Create instance

### Overall Idea

If we look at the basic bpel process, we can observe some general bpel constructs which are compulsory to any process. eg - <import/>, <partnerLinks/>, <variables/>. Let's take a look at on a general structure of a bpel process.

    <process
            name="ProcessName"
            targetNamespace="http://wso2.org/bps/samples">

        <import namespace="http://wso2.org/bps/samples/wsdl"
                location="ProcessService.wsdl"
                importType="http://schemas.xmlsoap.org/wsdl/"/>
        <import namespace="http://wso2.org/bps/samples/schema" location="schema.xsd"
                importType="http://www.w3.org/2001/XMLSchema"/>

        <partnerLinks>
            <partnerLink name="PartnerLinkName"
                         xmlns:ns01="http://schemas.xmlsoap.org/wsdl/"
                         partnerLinkType="ns01:ProcessPartnerlinkType"
                         partnerRole="myRole"/>
        </partnerLinks>

        <variables>
            <variable name="VarName"
                      xmlns:ns01="http://schemas.xmlsoap.org/wsdl/"
                      messageType="ns01:ProcessOperationResponse"/>
        </variables>

        <sequence>
            ...
        </sequence>
    </process>

Let's understand what those compulsory elements are.

- <import/> -

      <import location="HelloWorld2.wsdl" namespace="http://ode/bpel/unit-test.wsdl"
              importType="http://schemas.xmlsoap.org/wsdl/"/>

  Used to include WSDL and XSD definitions in the BPEL definition.
  Note - need to define namespace prefix for the namespace of imported resource in the BPEL definition in order to refer the imported resources inside BPEL definition.

- <partnerLinks/> -

      <partnerLinks>
          <partnerLink name="helloPartnerLink"
                       partnerLinkType="test:HelloPartnerLinkType"
                       myRole="me"/>
      </partnerLinks>

  This is where the connections to external parties are defined. If there’s any external interaction, partner link should be defined for each of them. Each partner link has one or two partner link types and roles which are defined in the service WSDL.

  For more details on creating partner links and invoking external parties, refer http://wso2.org/library/articles/writing-simple-ws-bpel-process-wso2-bps-apache-ode#establish-partner-link

- <variables/> -

      <variables>
          <variable name="myVar" messageType="test:HelloMessage"/>
          <variable name="tmpVar" type="xsd:string"/>
          <variable name="tmpDate" type="xsd:dateTime"/>
      </variables>

  BPEL variable are used to store the state of the process in the run-time. The type of a variable can be a WSDL message type or XML schema definition.

  For more details on defining variables, referring and modifying variables, refer http://wso2.org/library/articles/writing-simple-ws-bpel-process-wso2-bps-apache-ode#variable-manipulation