How to Create a Standalone Subprocess that Takes a Partner Link as a Parameter

This section describes how a subprocess takes a partner link as a parameter and uses it to call the partner and return the result. You are essentially using a partner link from subprocess to subprocess.

To create a standalone subprocess that takes a partner link as a parameter:

  1. Create a SOA composite application that includes a BPEL 2.0 process. For this example, a synchronous BPEL 2.0 process is created.
  2. Go to the SOA composite application in the SOA Composite Editor.
  3. Right-click and select Insert > Subprocess.

    The Create Subprocess dialog is displayed.

  4. Accept the default values (for this example, the default name is Subprocess1), and click OK.

    You now create a second process to use as the partner link.

  5. Create a second synchronous BPEL 2.0 process in the SOA composite application for this example, named BPELProcess2). This is the process to call.
  6. From the Components window, drag an Assign activity into the second BPEL 2.0 process.
  7. In the Target section of the Copy Rules tab, drag the Expression Builder icon onto the result variable. Figure 40-33 provides details.

    Figure 40-33 Edit Assign Dialog

    Description of Figure 40-33 follows
    Description of "Figure 40-33 Edit Assign Dialog"
  8. Build an XPath expression, and click OK.
    string("hello from process2")
    
  9. Save the second BPEL 2.0 process, and return to the subprocess.
  10. Click the Partner Links icon, as shown in Figure 40-34.

    Figure 40-34 Partner Link Creation

    Description of Figure 40-34 follows
    Description of "Figure 40-34 Partner Link Creation"

    The Partner Links dialog is displayed.

  11. Click the Add icon.

    The Create Partner Link dialog is displayed. You now define this partner link as a parameter.

  12. Design the partner link (for this example, named PartnerLink1), and click OK. Figure 40-35 provides details. The role of the partner link is as the provider.

    Figure 40-35 Partner Link Creation

    Description of Figure 40-35 follows
    Description of "Figure 40-35 Partner Link Creation"

    The Partner Links dialog looks as shown in Figure 40-36.

    Figure 40-36 Partner Links Dialog

    Description of Figure 40-36 follows
    Description of "Figure 40-36 Partner Links Dialog"

    Figure 40-37 shows the contents of the subprocess.

    Figure 40-37 Subprocess Contents

    Description of Figure 40-37 follows
    Description of "Figure 40-37 Subprocess Contents"
  13. Drag a Scope activity into the subprocess.
  14. Click the Variables icon in the scope activity, and create request and response message type variables. Figure 40-38 provides details.

    Figure 40-38 Request and Response Message Type Variable Creation

    Description of Figure 40-38 follows
    Description of "Figure 40-38 Request and Response Message Type Variable Creation"
  15. Drag a Sequence activity into the subprocess.
  16. Drag an Invoke activity into the subprocess for invoking the partner link.
  17. Design the invoke activity to invoke the partner link in the subprocess, as shown in Figure 40-39. The design includes the output variable (Variable2).

    Figure 40-39 Edit Invoke Dialog

    Description of Figure 40-39 follows
    Description of "Figure 40-39 Edit Invoke Dialog"

    Figure 40-40 shows the subprocess.

  18. Click the Variables icon in the subprocess to create a string variable to return the result.

    The Variables dialog is displayed.

  19. Click the Add icon to invoke the Create Variable dialog.
  20. Create a string variable (for this example, named result).
  21. Drag an assign activity into the subprocess.
  22. Map the result of the partner link invocation to the result variable, and click OK, as shown in Figure 40-41.

    Figure 40-41 Edit Assign Activity

    Description of Figure 40-41 follows
    Description of "Figure 40-41 Edit Assign Activity"

    Subprocess design is now complete.

  23. Return to the main BPEL 2.0 process in Oracle BPEL Designer (BPELProcess1).
  24. Click the Variables icon in the process.
  25. Click the Add icon to create a string variable to contain the result configured in Step 22 and passed back (for this example, named Variable1). Figure 40-42 provides details.
  26. Add an assign activity to assign the string value to Variable1.
  27. Drag a call activity below the assign activity in Oracle BPEL Designer. Figure 40-43 provides details.

    Figure 40-43 Subprocess Added to Main BPEL 2.0 Process

    Description of Figure 40-43 follows
    Description of "Figure 40-43 Subprocess Added to Main BPEL 2.0 Process"
  28. Right-click the Partner Links swimlane, and select Create Partner Link.
  29. Design a partner link to invoke BPELProcess2, as shown in Figure 40-44.

    Figure 40-44 Create Partner Link Dialog

    Description of Figure 40-44 follows
    Description of "Figure 40-44 Create Partner Link Dialog"
  30. Right-click the Call activity, and click Edit.

    The Edit Call dialog shows the partner link created earlier in the subprocess.

  31. In the result row, click the Value column to invoke the Variable Chooser dialog.
  32. Select Variable1, and click OK.
  33. In the PartnerLink1 row, click the Value column to invoke the Partner Link Chooser dialog.
  34. Select PartnerLink1, and click OK. Figure 40-45 shows the Edit Call dialog with design complete. Since the variables are sent by reference, if the subprocess does something to change the partner link (such as copying in another partner link), that impacts the calling process's partner link. This is the same process as with variables.
  35. Drag an Assign activity below the Call activity to return the result.
  36. In the Copy Rules tab, map Variable1 to result to return the result to the caller. Figure 40-46 provides details.

    Figure 40-46 Edit Assign Dialog

    Description of Figure 40-46 follows
    Description of "Figure 40-46 Edit Assign Dialog"
  37. Deploy the SOA composite application.