This section is the palette elements reference.
Using the Partner Link Element
Using the CompensateScope Element
Using the Repeat Until Element
A process diagram represents the connected elements in a business process. To edit a diagram, icons in the Design view Palette are dragged and dropped onto the BPEL diagram. These icons represent Web Service activities, basic activities, and structured activities in the business process.
The BPEL Designer diagram provides placeholder the mark places on the diagram where you can insert an element. The behavior of element placeholders illustrates how the BPEL Designer enforces the rules of the WS-BPEL 2.0 specification.
When you drag an element from the Palette, you can see placeholders showing acceptable drop points for this element. These drop points reflect the construction logic of the diagram. As you move the mouse pointer on the diagram, a placeholder that is active for the current mouse pointer position is highlighted. Align the dragged element with one of the placeholders and release the mouse button to insert the element.
Some placeholders are always present on the diagram marking the places where it is necessary to insert an activity so that the BPEL process is valid. These are the places inside container elements, for example the If element.
The Process element is already present in your diagram. The New Project wizards always create a skeletal BPEL file that contains at least a process element. Therefore, the Process element is not part of the Palette. The Process element is assumed to be present, as it is the minimum requirement for a BPEL file.
Right-click the Process element and choose Add from the pop-up menu to add the following:
Specify the name and the target namespace of the Process element in the Properties window, invoked by right-clicking the element and choosing Properties.
A BPEL process can be synchronous or asynchronous. A synchronous BPEL process blocks the client (the one which is using the process) until the process finishes and returns a result to the client. An asynchronous process does not block the client. Rather it uses a callback to return the result (if any). Usually we use asynchronous processes for longer-lasting processes and synchronous for processes that return a result in a relatively short time. If a BPEL process uses asynchronous web services, the process itself is usually also asynchronous.
The Web Service section of the BPEL Designer Palette contains icons for the following business process elements:
These elements represent requests, responses, and agreements between a process and its partner services.
The Invoke element enables the business process to invoke a one-way or request-response operation on a portType offered by a partner. It enables the business process to send messages to partners. The operation is defined in the partner's WSDL file.
In the Design view, drag the Invoke element from the Palette to the diagram.
Perform one of the following procedures to associate the Invoke element with a Partner Link element:
Directly draw a message flow from the Invoke element to the target Partner Link.
Double-click the Invoke element. A dialog opens where you can examine or change the following:
The name of the Invoke element.
The partner link that is invoked.
The operation associated with the Invoke element.
The input variable associated with the Invoke element.
The output variable.
Both input and output variables can be created or browsed through this dialog.
In the Property Editor dialog box, you can either create a variable or use an existing variable to hold input and output data. Click the Create button to create a variable for the Invoke element, and click Browse to choose an existing variable.
Note that when you click the Browse button, the Input Variable Chooser or the Output Variable Chooser dialog boxes opens. In these dialog boxes, a checkbox with the option to show variables with appropriate types appears. This checkbox restricts the list of available variables to those which are of the proper type for the activity you are configuring. In this way the Design view helps you develop valid BPEL code.
Correlation sets on invoke activities, which deal with outbound operations, are used to validate that outgoing messages contain data which is consistent with the data contained within specified correlation set instances. The Correlations tab in the Invoke Property Editor dialog box enables you to examine or specify a correlation set.
The tab shows:
Names of correlation sets
The initiation of a correlator
The pattern associated with the correlation
For more information see Understanding Correlation. Using the Correlation Wizard.
The Receive element allows the business process to do a blocking wait for a particular message to arrive.
In the Design view, drag the Receive element from the Palette to the diagram.
Double-click the Receive element (or right-click it and choose Edit) to configure its properties. Here the example is provided for the Travel Reservation Service sample:
The name of the Receive element (ReceiveItinerary ).
The partner link (Travel).
The operation associated with the Receive element (buildItinerary).
The input variable to the Receive element (ItineraryIn ).
Select Browse for the Input Variable to open the Input Variable chooser, where you can choose other variables associated with this process. Select Create to create a new variable.
Create Instance. If selected, an instance of the BPEL process starts when an associated message arrives. Note that if the Receive activity is the first activity in your business process, the Create Instance checkbox must be selected.
You can also edit some of the element's properties in the Properties window. To open the window, right-click the Receive element and choose Properties or choose Window > Properties (Ctrl-Shift-7) from the main menu. You can edit the information by clicking on the ellipsis button. You cant edit the shadowed information from this window, to change it open the property editor as described above.
The Correlations tab in the Receive Property Editor dialog box enables you to examine or specify a correlation set.
The tab shows:
Names of correlation sets
The initiation of a correlator
For more information see Understanding Correlation. Using the Correlation Wizard.
Use this activity to return a message from the process to the same partner that initiated the operation. The combination of Receive and Reply activities creates a request-response operation.
This activity is used in a synchronous (request/response) operation, and specifies the same partner, port type and operation as the Receive activity that invoked the process.
In the Design view, drag the Reply element from the Palette to the diagram.
Double-click the Reply element (or right-click and choose Edit) to open a Property Editor dialog box for the Reply element. In this dialog box, you can specify the following:
The name of the element.
The Partner Link.
The operation.
Type of response: Normal Response or Fault Response.
Select Normal Response if the Reply element is to be used for the normal response message type. Optionally, specify the output variable: either create a new output variable or browse for an existing variable.
Select Fault Response if the Reply element is to be used to send a fault message. Choose a fault name and, optionally, specify the fault variable: either create a new fault variable or browse for an existing variable.
You can also edit some of the element's properties in the Properties window. To open the window, right-click the Receive element and choose Properties or choose Window > Properties (Ctrl-Shift-7) from the main menu. You can edit the information by clicking on the ellipsis button. You cant edit the shadowed information from this window, to change it open the property editor as described above.
The Correlations tab in the Reply Property Editor dialog box enables you to examine or specify a correlation set.
The tab shows:
Names of correlation sets
The initiation of a correlator
For more information see Understanding Correlation. Using the Correlation Wizard.
Partner Link elements identify the parties that interact with your business process. Each link is defined by a partner link type and a role name.
The type determines the relationship between a process and its partners by defining the roles played by each service in a conversation. The relationship is further determined by specifying the port type provided by each service to receive messages. Each role specifies one port type in the WSDL file.
Roles determine the conversational aspect of this process or its partner. You use a single role for a synchronous operation as the results are returned using the same operation. You use two roles in an asynchronous operation as the partner role switches during a callback.
It is easy to confuse partner links and partner link types, however:
Partner link types and roles are special WSDL extensions defined by the BPEL specification. As such, they are defined in WSDL files, not in the process BPEL file.
Partner Link is a BPEL 2.0 element. It is defined in the process BPEL file.
Partner link types are prerequisites to the Partner Link element definition. A Partner Link element can only be defined by referring to a particular partner link type and role which, as mentioned, must be defined in a WSDL file.
To add the Partner Link element to the BPEL process, do one of the following:
Drag the Partner Link element from the Palette to the diagram.
Drag a WSDL file node from the same project in the Projects window to the diagram.
Drag a WSDL file node from a different project in the Projects window to the diagram.
Drag a web service node from an EJB project or a Web Application project in the Projects window to the diagram.
Note: When you drag the web service node, the BPEL Designer retrieves the WSDL file from the Application Server. To successfully retrieve the WSDL file, the Application Server has to be running and the web service project must be deployed.
When you drag the Partner Link element, a WSDL file node, or a web service node to the diagram, the Partner Link Property Editor appears.
The Partner Link Property Editor dialog box enables you to establish partner links for your BPEL processes.
The Partner Link Property Editor dialog box enables you to establish partner links for your BPEL processes. The Partner Link Property Editor is invoked by double-clicking a Partner Link element on the diagram, or right-clicking the Partner Link element and choosing Edit. The Partner Link Property Editor also appears when you drag the Partner Link element, a WSDL file node, or a web service node to the diagram.
With the Partner Link Property Editor, you can specify:
The Partner Link name
The WSDL file associated with the Partner Link
Further on you can choose whether to use the existing partner link type or create a new partner link type.
If the WSDL file you selected contains partner link types, the Use Existing Partner Link Type option is selected and the Partner Link Type drop-down list is populated with the partner link types found in the WSDL file. You can use one of the existing partner link types or select the Use a Newly Created Partner Link Type option to create a new partner link type.
If the WSDL file does not contain partner link types, the Use a Newly Created Partner Link Type option is selected.
Use Existing Partner Link Type
Choose the partner link type from the drop-down list. The My Role and/or Partner Role fields are filled in automatically.
To swap the roles of the business process itself (My Role) and the partner (Partner Role), click the Swap Roles button.
Use a Newly Created Partner Link Type
Specify the WSDL file in which to add a partner link type. You can do one of the following:
Add the partner link type to the wrapper WSDL file, as suggested by the IDE in the Create in File field by default. If you choose this option, the IDE will automatically create the wrapper WSDL file in your project structure. You can use wrapper WSDL files when the original WSDL file is read-only or when you do not want to modify the original WSDL file. The original WSDL file will be imported to the newly created wrapper WSDL file.
Add the partner link type to a WSDL file within your project. Click Browse and locate the WSDL file in which to add the partner link type.
Specify the partner link type name.
Specify the role of the business process itself (My Role) and/or the role of the partner (Partner Role) as follows:
Select the appropriate checkbox.
Specify the role name.
Choose the port type from the drop-down list.
You can also review and modify the Partner Link's properties in the Properties window invoked by right-clicking the element and choosing Properties.
The partnerlinks are put to the left and to the right margin of the process diagram. Service requestors are placed on the left side, service providers are placed on the right side. To define the role and to choose the appropriate side for each partnerlink the IDE uses the order of roles defined for the partnerLinkType in the WSDL file. The role defined first in the partnerLinkType in the WSDL file is considered to be a service role, the second defined role is considered to be the role for the requestor and callback receiver. If the roles are defined in the reverse order in the wsdl file (the callback receiver role is defined on the first place, and the service role on the second place) then you get the improper partnerlink layout in the BPEL process diagram, though the operation is not damaged. If a partnerlink appears on the wrong side you probably have to go to the WSDL file and swap places for the role definitions in the partnerLinkType.
Sometimes you need to communicate with partner services whose endpoints are not known beforehand or you need to change an endpoint reference (EPR) during the process execution. The Dynamic Partner Links feature allows you to dynamically assign an endpoint reference to the partnerlink. This means you can use one partner link for communication with several web?services as long as these services have the same interface.
Each partner link has abstract information and concrete information defined. While the abstract information describing web-service interface should be static, the concrete access information such as address and port can be discovered and used dynamically.
For successful deployment of the process a partner link should be completely defined. It means that when you deploy the project, the WSDL file for the partner link should contain both the abstract and the concrete information for the partner link defined, including address and port, though later the concrete information can be changed independently from the WSDL file.
The BPEL specification mandates that only the partner EPR can be changed dynamically. In BPEL terms, only the partnerRole of a partnerLink element can have a new value assigned. The myRole value doesn't change after the BPEL has been deployed.
To assign a new EPR to a partner link you can use the standard Assign activity and the BPEL Mapper.
The EPR information can be provided in different ways:
Provide it as a literal (type endpoint reference information manually into a literal) and map it to the partner link
Use an incoming message to extract the endpoint address
Use a variable of the Service Reference type
Copy EPR from one partner link to another
If you use an incoming message, an EPR schema should be defined as a part of the message in WSDL. To assign the EPR to a partner link, use the message variable.
Create a new Assign activity in the process.
Open the BPEL Mapper.
In the target tree on the right, find the partner link to which you want to deliver a new concrete part.
In the source tree, find a variable containing the new endpoint address.
The address of the web-service can be defined in terms of different schemas, and the JBI container requires a special data type called ServiceRefType which is a simple wrapper for any endpoint-describing data type.
To wrap your data:
In the mapper toolbar, choose BPEL -> Wrap with Service Reference.
This function is a doXslTranform function that uses a predefined XSL-style sheet. A new concrete part is assigned to the partner link.
The runtime supports only schemas included into WS-BPEL 2.0 specification. The WS-Addressing schema is not included in the BPEL specification and as a result it is not supported by the BPEL runtime. When the WS-Addressing schema is used for the first time it is copied from NetBeans global catalog to the BPEL Module project source root and further the project refers to the local copy of the schema. The adressing.xsd schema also appears among the Module's procees files in the Projects window.
The Basic Activities section of the BPEL Designer Palette contains icons for the following business process elements:
The Assign activity assigns values to variables. You use the Assign element to copy data from one variable to another, construct and calculate the values of expressions, and store new data in variables. Expressions are required to perform simple computation or operate message selections, properties, and literal constants to produce a new value for variables. The Assign activity can contain one or more elementary assignments.
Use the BPEL Mapper to define the copy rules for the Assign activity or add expressions. For more information, refer to the Assign Activity Scenario section of the guide.
Double-click the Assign activity on the diagram to open Mapper view of the activity. If this window is not visible, you can invoke it manually, by choosing Window -> Other -> BPEL Mapper from the main menu.
The Properties window of the Assign element, invoked by right-clicking the element and choosing Properties, contains two properties:
Assignments Count — The number of assignment rules specified for the element
Documentation — A place to describe the assign activity or purpose
Name — The name of the element
The Empty element has no operation associated with it. It is usually used as a placeholder within a process, to catch and suppress faults, or to help synchronize actions within a flow activity that are executed concurrently.
The Empty element can be used when someone else will be implementing a business process, or when the activities within a flow activity need to be synchronized.
Drag the Empty element from the Palette to the diagram.
Use a Wait element to specify a wait condition based on a unit of time or a duration. Double-click the Wait element on the diagram to open Mapper view of the activity.
Drag the Wait element from the Palette to the diagram. Like other elements, it must be placed in the correct position in the process flow; otherwise you will not see the element in the diagram.
Right-click the element in the diagram and choose Properties to invoke a Properties window. Using the Properties window, you can specify:
The name of the element
A description of the activity
The alarm type. The available options are:
For – specifies a duration for the process to wait
Until – specifies the time until which the process is delayed.
For/Until. Clicking the ellipsis button invokes a dialog box where you specify the time in accordance with the selected expiration type.
Use this activity to signal an internal fault.
In defining the properties of this element, you can specify a fault name and a fault variable. These details can then be passed onto a fault handler that is configured to deal with this kind of exception.
The properties of the Throw element are configured from the Properties window.
The options are:
Name
Fault Name — The Fault Name is a QName. You can use any name. The dialog box lets you choose a standard or already defined fault or specify a new one. The next time the the dialog box is opened, the newly defined faults appear inside of User Defined Faults folder. These are collected from the current BPEL file only. Clicking the ellipsis button (...) invokes the Fault Name dialog box.
You can use the WSDL Editor to add fault definitions to the WSDL file. For more information, see the Configuring Port Types Using the WSDL View section of Using the WSDL Editor.
Fault Variable — Click the ellipsis button to specify the name of the variable, already declared in the BPEL file, that will contain the fault message.
The Rethrow activity can only be used within a fault handler. The Rethrow activity is used to rethrow the fault caught by the fault handler. Before adding the Rethrow element to the BPEL process, you should add a Fault Handler element to the Process or Scope element and add a Catch or Catch All element to the Fault Handler container.
If you have not added a Fault Handler container to the diagram, in the Design view right-click the Scope or Process element and choose Add -> Fault Handlers.
Right-click the Fault Handler container and choose Add -> Add Catch or Add -> Catch All.
Drag the Rethrow element from the Palette to the diagram and place it inside the Catch or Catch all element of the Fault Handler container.
There are no properties to be defined for the Rethrow element as it rethrows the fault caught by the Fault Handler.
Use this activity to halt the execution of an activity or a process: either within the process, within a structured activity, or within a handler.
In the Design view, drag the Exit element from the Palette to the diagram.
Note: The BPEL runtime does not support Exit within the Flow and On Alarm elements, or within the On Event child of the Event Handler element.
The Compensate element is used to start compensation on all inner scopes that have successfully completed. The Compensate activity can only be used within Catch, CatchAll, Compensation Handler or Termination Handler elements.
Before adding Compensate element to the process, be certain to add one of the following to either the Process or Scope element:
A Fault Handler and Catch or Catch All
A Compensation Handler
A Termination Handler
The Compensate activity causes compensation of all scopes immediately enclosed in the scope containing the fault handler, compensation handler, or termination handler with the Compensate activity.
From the Palette, drag the Compensate activity and place it inside the Catch, CatchAll, Compensation Handler or Termination Handler element on the diagram. The Compensate activity requires no property configuration, its behavior is predefined.
The CompensateScope element is used to start compensation on a specific scope that has successfully completed. The CompensateScope activity can only be used within Catch, CatchAll, Compensation Handler or Termination Handler elements.
Before adding the CompositeScope element, add one of the following to the Process or Scope element:
A Fault Handler and Catch or Catch All
A Compensation Handler
A Termination Handler
The Compensate Scope activity enables compensation for one specified Scope or Invoke element enclosed into the scope that contains the handler with the Compensate Scope activity by invoking the compensation handler of the Scope or Invoke element.
From the Palette, drag the CompensateScope activity and place it inside the Catch, CatchAll, Compensation Handler or Termination Handler element on the diagram.
Right-click the CompensateScope element and choose Properties.
In the Properties dialog box, configure the following:
Name — Enter an arbitrary name.
Target — From the drop-down list, select a scope or an invoke activity to be compensated.
Documentation — Optionally, write a comment on the activity.
The Structured Activities section of the BPEL Designer Palette contains icons for the following business process elements:
The If activity supports conditional behavior of a business process instance. The If activity consists of conditional branches defined by the If and Else If elements, followed by an optional Else branch. The conditions on If and Else If branches are evaluated in the order they appear. During execution, the first branch whose condition holds true is taken and provides the activity specified for the If activity. In other words, if there are several Else If branches whose conditions hold true, only the first of them will be executed.
If none of the branches evaluates to true, then the Else path is chosen. If the Else branch is not explicitly specified, this branch is considered to contain an Empty activity. The If activity is complete when the activity of the selected branch completes.
In the Design view, drag the If element from the Palette to the diagram.
Double-click the If element on the diagram or select the Mapper tab on the toolbar. The BPEL Mapper opens.
Specify the condition for the If element using the BPEL Mapper. For more information, refer to the If Activity Scenario section of the guide. You can also specify the condition manually in the Properties window, invoked by right-clicking the element and choosing Properties.
(Optional) In the Properties window, enter the name for the If element.
Add the element that will be executed if the condition is true into the If element. Configure the nested element. If you add another element into the If element, the nested elements are automatically wrapped in the Sequence element.
Add other branches (Else If and Else) as described below.
Right-click the If element and choose Add Else If.
Add an activity to the Else If that will be executed if the condition defined for this Else If element is true. To define a condition, use the BPEL Mapper.
(Optional) Add more Else If activities by choosing Add Else If and add activities to them.
Drag the activity you want to be executed on the Else branch onto the connector path marked with a slash mark. Configure the nested activity.
In the Design view, drag the Else If branch that you want reordered and drop it onto the placeholder that appears next to another Else If branch.
Use the While element to repeatedly execute one or more activities as long as specific conditions are in place at the beginning of each iteration. This element contains other elements that are repeated while success criteria you specify are met. If the condition you specify leads to false, none of the activities listed will be executed.
Note: the While element first checks the validity of the condition and then executes the iterative activity. Conversely, the Using the Repeat Until Element element first executes the activity and then checks the validity of the condition.
In the Design view, drag the While element from the Palette to the diagram.
Drag an activity that will be repeatedly executed and place it inside the While element. If needed, configure the activity's properties.
Use the Properties window to specify the name and condition of the While element. You can enter the condition manually or use the BPEL Mapper to generate the condition for you.
Use the Repeat Until element to repeatedly execute one or more activities as long as specific conditions are in place after the execution of each iteration. This element contains other elements that are repeated until the success criteria you specify are met. If the condition you specify leads to true, the activities listed will be executed once.
Note: the Repeat Until element first executes the iterative activity and then checks the validity of the condition. Conversely, the While element first checks the validity of the condition and then executes the activity.
In the Design view, drag the Repeat Until element from the Palette to the diagram.
Drag activities that will be repeatedly executed and place them inside the Repeat Until element. If needed, configure the activity's properties.
Use the Properties window to specify the name and condition of the Repeat Until element. You can enter the condition manually or use the BPEL Mapper to generate the condition for you.
Use the For Each element to repeatedly execute its contained scope activity exactly N+1 times where N equals the Final Counter Value minus the Start Counter Value.
In the Design view, drag the For Each element from the Palette to the diagram.
Add elements that will be repeatedly executed from the Palette into the For Each element. The elements that you add are automatically wrapped into the Scope element.
Right-click the For Each element and choose Properties to open its Properties window.
The Properties window for the For Each element includes the following properties:
Name — Specifies the name of the For Each element.
Counter Variable Name — Declares the counter variable name.
Start Counter Value — Sets the start counter value. Use the BPEL Mapper to generate an integer value expression.
Final Counter Value — Sets the final counter value. Use the BPEL Mapper to generate an integer value expression.
When the For Each activity is started, the expressions in Start Counter Value and Final Counter Value are evaluated for the first and only time. That is, once the two values are returned they remain constant for the lifespan of the activity. If the Start Counter Value is greater than the Final Counter Value, then no iteration will be performed.
Completion Condition — (Optional) Specifies an integer value expression. After execution of each directly enclosed activity, the number of completed activities is checked against this value. When the number of completed activities equals the value of the specified expression, no further activities are started. When the expression value is greater than the available number of iterations, then no iteration will be started.
Count Completed Branches Only — (Optional) If this checkbox is selected, it tells the runtime to only count the branches that have completed successfully. If this checkbox is cleared, all branches, completed successfully or unsuccessfully, will be counted.
The Pick element blocks the process and waits until one of the specified events occurs. After the specific event occurs, the activity associated with this event is performed. The possible events are the arrival of a message or a timer-based alarm. The occurrence of the events is mutually exclusive. If more than one of the events occurs, then the selection of the activity to perform depends on which event occurred first.
The Pick activity provides two branches, On Message and On Alarm. The branch whose condition is satisfied first (i.e. a message is received or the specified timer expires) is executed. When you add a Pick element to your diagram, it automatically includes one On Message statement in which you specify the properties of the message that the process awaits from a partner service. Each Pick element must include at least one On Message statement. The On Alarm branch contains a timer you can use to specify how long the process is to wait.
In the Design view, drag the Pick element from the Palette to the diagram.
For the On Message branch, configure the properties of the message for which the process is waiting. The configuration is similar to that of the Usage element.
From the Palette, drag the activity that will be executed and place it inside the On Message branch. Configure the activity's properties.
(Optional) Add more On Message branches by choosing Add -> On Message from the pop-up menu and configure them as described above.
(Optional) Add one or more On Alarm branches following the procedure below.
Right-click the Pick element and choose Add -> On Alarm from the pop-up menu.
Configure the timer via the Properties window, invoked by right-clicking the element and choosing Properties. The available options are:
Alarm Type — used to choose the type of alarm. The type can be one of the following:
For — specifies a duration for the process to wait.
Until — specifies a deadline for the process.
For/Until — used to configure the deadline or the duration for the chosen alarm type. Click the ellipsis button (...) to specify the time. You can also use the BPEL Mapper.
Find the activity you want executed after the time expires, and drag it from the Palette to the placeholder inside the On Alarm element.
(Optional) Add one or more On Alarm branches as described above.
The Properties window for the Pick element, invoked by right-clicking the element and choosing Properties, includes the following fields:
Create Instance — If set to yes, a new process instance will be created when the specified event occurs. If you do not plan to start a new process instance, keep the default N/A value.
Name — Specifies the name of the For Each element.
Document — (Optional), Write a comment on the activity.
Use the Flow element to define a set of activities that will execute concurrently (in parallel).
The Flow activity is a structured activity, containing other activities separated into individual control paths or branches. You can embed as many paths in the activity as you want, and they will all be executed simultaneously.
During execution, each path is executed concurrently, and the activities on each are executed in the order in which they appear, unless they are the source of a link. When the activities are the source of a link, the condition of the link and the join condition of the activity must be evaluated. If the link conditions that lead to an activity conflict with those of its join condition, then a fault is thrown on that activity.
In the Design view, drag the Flow Element from the Palette to the diagram.
Drag an element to the placeholder inside the Flow element. If you add another element into the same branch of the Flow element, the elements within a branch are automatically wrapped in the Sequence element.
You can add one or more branches to the Flow element. The Flow element has a special user interaction style. It always shows a placeholder for the next branch that you might wish to add. To add a new branch, drag an element from the Palette to the immediately available "next branch" placeholder.
To change the order of activities inside the Flow element:
In the Design view, right-click the Flow element and select Change Order.
Select an element and use the Move up or Move down buttons to change the position of the element inside the container.
Use the Sequence element to nest a series of activities into your process. The activities within a sequence will execute in strict sequential order. Process execution returns to the business process when the last activity within the nest has completed.
Drag the Sequence element from the Palette to the diagram.
You can add one or more child activities to the Sequence. The Sequence element has a special user interaction style. It always shows one or more valid placeholders for the next activity that you might wish to add. To add a new child activity, drag and drop an element from the Palette onto the immediately available next or previous activity placeholder.
To change the order of activities inside the Sequence element:
In the Design view, right-click the Sequence element and select Change Order.
Select an element and use the Move up or Move down buttons to change the position of the element inside the container.
The Scope activity is essentially a collection of child activities that can have their own Variables, Fault and Event Handlers, and correlation sets. The Scope activity provides the behavior context for the child elements. The attributes defined for a parent Scope have local visibility inside this Scope. For example, the variables declared for a Scope are visible only inside that Scope and all nested Scopes. These variables can then be used for the child activities of this Scope.
In the Design view, drag the Scope element from the Palette to the diagram.
Right-click the element and choose Add from the pop-up menu to add the following:
In the Design view, drag elements from the Palette and place them inside the Scope element.
Configure the elements.
(Optional) Specify the name of the Scope element in the Properties window, invoked by right-clicking the element and choosing Properties.
Variables in BPEL programming function just as they do in other programming languages: they hold temporary values, form parts of expressions, or are passed as parameters to external partners. Normally, you need a variable for every message sent to or received from a partner service. The BPEL Designer supports the following types of variables:
WSDL Message type. These variables correspond to web service message types that are defined in WSDL files imported by the process. In a BPEL file ( .bpel), these variables must specify a value for the messageType attribute. Message type variables are used to hold data in interactions between the process and its partner services.
XML Schema type. These variables correspond to simple or complex XML Schema data types. The XML schema types themselves are defined in XML Schema files (.xsd) or in WSDL files that are imported into the process. In a BPEL file, variables of this type must specify a value for the type attribute.
XML Schema element. These variables correspond to XML Schema elements.The XML schema elements themselves are defined in XML Schema files (.xsd) or in WSDL files that are imported into the process. In a BPEL file, variables of this type must specify a value for the element attribute.
Built-in type. Variables of this type are standard simple types defined in the XML Schema specification.
Global and Local Variables
The variables defined at the Process root are global variables, which have a global visibility throughout the entire process. The variables defined within a particular Scope are visible only inside that Scope and all nested Scopes. These variables are called local variables. A variable defined for an inner Scope element can hide an upper defined variable of the same name.
The name of a variable must be unique among the names of all variables defined within the same Scope.
Right-click the Process or Scope element and select Add > Variable.
In the Create New Variable dialog box, name the variable. The name should be unique within this Scope element.
Expand the node corresponding to the type of the new variable and select its type. You have the following options:
Built-in Types — Expand the Built-in Types node, select the type's name, and click OK.
Message Type — Expand a .wsdl file node, select a message type and click OK.
XML Schema — Expand an .xsd file node or a .wsdl file that contains an embedded schema. Expand the Global Complex Type, Global Simple Type, or Global Elements Simple nodes, select the appropriate type, and click OK.
For your convenience, global types of variables are displayed in bold.
(Optional) Clear the Show Imported Files Only checkbox to view the contents of non-imported WSDL and XML schema files.
Click OK.
By default, the Create New Variable dialog box only shows those files that have already been referenced in the process. However, the project may contain other WSDL and XSD files which have not yet been imported into the process. If you select a type for the new variable that is defined in a non-imported file, the IDE will automatically add the required import to the BPEL process.
You can also add variables from the The Navigator Window window. To add a variable, select BPEL Logical View in the Navigator, expand your BPEL Module project's node, right-click the Variables node and choose Add Variable.