官术网_书友最值得收藏!

Creating sample BPEL business processes

  1. Start JDeveloper from the Start menu with the default role. In JDeveloper, from the Application tab, click on New and select SOA Application and then click on Next, as shown in the following screenshot:
  2. Enter the Project Name and click on Finish, as shown in the following screenshot:
  3. It will load the JDeveloper's Design view for developing SOA applications, as shown in the following screenshot:
  4. Drag-and-drop a BPEL Process from Component Pallet to the JDeveloper canvas. The Create BPEL Process screen will appear on the JDeveloper console.
  5. As shown in the following screenshot, you can name your BPEL process. In this case the name is the default BPELProcess1. In the Template field, select Synchronous BPEL Process. Executing Synchronous BPEL processes returns a result. The Asynchronous BPEL processes may not return any value:
  6. As shown in the following screenshot, double-click on BPELProcess1 to view the BPEL:
  7. After double-clicking on the BPEL process, a window, as shown in the following screenshot, will appear:
  8. The next step is to debug the basic BPEL process. Currently, the business process has only receiveInput and replyOutput activity. Click on Run (or Make) to compile the project, as shown in the following screenshot:
  9. After selecting Debug, the following dialog is displayed as no Default Run Target was specified in Run/Debug page of the Project Properties dialog.
  10. Use the dialog in the following screenshot to specify the Default Run Target. Ignore any warning message about the non-existence of the src folder:
  11. From the Activities toolbar on the right-hand side of your window, drag an Assign activity and drop it between receiveInput and replyOutput. The following screenshot will appear after the changes:
  12. You can rename it by double-clicking on Assign1.

An Assign activity is usually used for manipulating data. For example, Assign activity can be used for copying the contents of one variable to another.

Assign activity is mainly used for copying the XML data contained in one BPEL variable to another BPEL variable. The data in a variable is visible and shared among all process activities.

Partner Link represents a link to services. JDeveloper's Source tab allows you to make the changes to the sources if required. The following screenshot shows how the Copy Rules tab can be used for creating a copy rule and connecting the source and target types:

In the sample BPEL process being shown in the preceding screenshot, input data from an input string is being copied to an output string using the concat function of XPath.

XPath is language for navigating through elements and attributes in an XML document and finding information within an XML document. The syntax of XPath's concat function is as follows:

fn:concat(string,string,...)

It returns the concatenation of the strings. For example, concat("My","first","XPATH function!") gives the output as My first XPATH function.

While copying the value of an input string to an output string, use the concat function of XPath to combine the strings together to manipulate the data. The Assign activities in BPEL build the XPath queries.

It is recommended to use the drag-and-drop feature for copying and assembling functions. The source code example of the Assign activity is given as follows (you can view the source code from JDeveloper' Source tab):

<assign>
   <copy>
      <from expression="concat('BPEL working ',
         bpws:getVariableData('input', 'payload', '/p:input))"/>
      <to variable="output" part="payload" query="/p:result/p:message"/>
   </copy>
</assign>

Assign activity in BPEL can do the following:

  • Copy data of one XML variable from input to output
  • Calculate the value of an expression and store it in a variable

The Assign syntax of the copy function is as follows:

<copy> <from...> <to...> </copy>
主站蜘蛛池模板: 景洪市| 会昌县| 鄂温| 喀喇沁旗| 凌海市| 庆安县| 正宁县| 弥勒县| 商丘市| 景东| 潜江市| 灵寿县| 东源县| 滦南县| 贵州省| 萝北县| 中西区| 虞城县| 岳普湖县| 天台县| 宝兴县| 高密市| 阳西县| 平南县| 成武县| 宜章县| 大埔区| 玛曲县| 榆社县| 西平县| 元谋县| 渝中区| 子洲县| 龙井市| 呼伦贝尔市| 鹤壁市| 苏尼特左旗| 东阳市| 德惠市| 兴文县| 绿春县|