BEA Logo BEA WLI Release 2.1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   WLI Doc Home   |   BPM Topics   |   Programming BPM Plug-Ins   |   Previous Topic   |   Next Topic   |   Contents   |   Index   |   View as PDF

BPM Plug-In Sample

 

This section describes the BPM plug-in sample in detail. It includes the following sections:

 


Plug-In Sample Contents

The BPM plug-in sample provides a set of plug-in classes that represent common plug-in scenarios, and is provided with the software in the WLI_HOME/samples/bpm_api/plugin/src/com/bea/wlpi/tour/po/plugin directory. The sample includes two workflow templates, Plug-in Order Processing and Plug-in Order Fulfillment. Excerpts from the plug-in sample are referenced throughout this document.

Note: The plug-in sample is loosely based on a generic Web-based sales order scenario that is described in detail in Introduction to WebLogic Integration and the Example Workflows in Learning to Use BPM with WebLogic Integration.

The following table describes the plug-in sample, shown in the figure Plug-In Sample Workflow Templates, listing the workflow component and the associated example source files located in the WLI_HOME/samples/bpm_api/plugin/src/com/bea/wlpi/tour/po/plugin directory. Plug-ins 1 through 3 are provided as part of the Plug-in Order Processing workflow template. Plug-ins 4 and 5 are provided as part of the Plug-in Order Fulfillment workflow template.

Table 10-1 Plug-In and Related Source File Descriptions

#

Workflow Component

Description

Related Source File(s)

1

Start Node

Triggered by the plug-in event, Start Order, to start workflow upon receipt of a plug-in message type (semicolon -delimited text string).

2

Action: Check Inventory

Checks available inventory for an item.

3

Event Node: Wait for Confirmation

Triggered by plug-in event, Confirm Order Event, to pause a workflow until the receipt of a plug-in message type (semicolon -delimited text string).

4

Function: CalculateTotalPrice

Calculates total price of an order based on an item number, quantity, and state/province of the shipping destination.

5

Action: Confirm Order Fulfillment

Generates an event message to trigger a Confirm Order Event node.


 

The following table defines the additional source files that exist in the WLI_HOME/samples/bpm_api/plugin/src/com/bea/wlpi/tour/po/plugin directory.

Table 10-2 Additional Plug-in Sample Source Files

File

Description

Sample.gif

Custom icon that appears in the upper-right corner of the Start and Event nodes that contain customized plug-in properties when the WebLogic Integration Studio interface view is enabled. You can specify a custom plug-in icon when creating the remote plug-in object interface, as described in Plug-In Home Interface.

SampleBundle.java

Bundle of localized resources.

SamplePlugin.properties

Resource strings.

SamplePluginBean.java

Plug-in session EJB.

SamplePluginConstants.java

Plug-in constants file.

StartOrderDriver.java

Driver for triggering order processing.


 

 


Using the Plug-In Sample

The plug-in sample is ready to use out-of-the-box. For your convenience, the plug-in sample JAR, WAR, and deployment descriptor files are deployed to the appropriate directories when you install WebLogic Integration.

The following sections describe how to import and run the sample plug-in.

Importing the Plug-In Sample

To import the plug-in sample, use the Studio import package tool. The Studio import package tool enables you to import a workflow package, in the form of a JAR file, that can contain one or more of the following objects: templates, template definitions, event keys, and business operations.

To import the plug-in sample package:

  1. Invoke the Studio design client.

    For more information, see Using the WebLogic Integration Studio.

  2. Choose Tools—>Import Package.

    The Import wizard Select File dialog box is displayed.

  3. Click Browse and navigate to the WLI_HOME/samples/bpm_api/plugin directory to open the file sample_plug_in.jar.

  4. Click Next.

    The Select Components to Import dialog box appears, with the target organization set to the current organization, and all workflow objects in the import file selected by default.

  5. Select the Activate workflows after import check box in order to activate the plug-in sample workflows.

    Note: You must activate a workflow before you can run it. Alternatively, you can activate a workflow after it has been imported, as described in Using the WebLogic Integration Studio.

  6. Click Import to import the entire package, consisting of templates, template definitions, business operations, and event keys.

    The Review Import Summary dialog box appears with a summary of the objects imported.

  7. Click Close to close the dialog box.

    The imported templates and template definitions now appear in the folder tree.

For more information about importing and exporting workflow packages, see Importing and Exporting Workflow Packages in Using the WebLogic Integration Studio.

Running the Plug-In Sample

The plug-in sample can be run by triggering the Plug-in Order Processing workflow template using a plug-in-defined event. For your convenience, a generic driver file, StartOrderDriver.java, is provided in the WLI_HOME/samples/bpm_api/plugin/src/com/bea/wlpi/tour/po/plugin directory. This driver generates a plug-in defined event that supplies the Plugin Order Processing workflow with the customer order information. This information is stored in the Plugin Order Processing workflow variables and is used to process the order.

To run the example:

  1. Import the plug-in sample package, as described in Importing the Plug-In Sample.

    Note: You must activate a workflow before you can run it. Alternatively, you can activate a workflow after it has been imported, as described in Using the WebLogic Integration Studio.

  2. Start BEA WebLogic Integration using the samples domain, as described in "Configuring and Starting the Samples Domain" in Getting Started in Starting, Stopping, and Customizing BEA WebLogic Integration.

  3. Start the BPM Worklist tool, and log on using the following login and password:

    The admin user has been defined as a member of all of the roles used in the sample workflows. For more information, see "Logging On to the Worklist Application" in Executing and Monitoring the Example Workflows in Learning to Use BPM with WebLogic Integration.

    You will need to interact with the plug-in sample using the Worklist tool.

  4. Select the CDExpress organization from the drop-down list in the Worklist tool.

  5. Run the WLI_HOME/samples/bpm_api/plugin/StartOrder.cmd script to execute StartOrderDriver.

    The Check Customer Credit task appears in the admin user's task list.

  6. Refer to the following sections in Executing and Monitoring the Example Workflows in Learning to Use BPM with WebLogic Integration, for information on executing the Order Processing and Order Fulfillment workflow tasks, respectively:

 

back to top previous page next page