Build it yourself

To build the JMS invocation sample, follow these steps:

Create a common library

Since we will use the same interface in two different projects, we put this interface into a library. Later, we will share this library for the two projects.

Create the library

To create the library for the interface we want to share, complete the following steps:

  1. In the Business Integration view, click the link under Projects to add a business integration project.
  2. The New Business Integration Project window opens. Select Library.
  3. Click Next.
  4. The New Library window opens.

  5. In the Library Name field, enter SharedInterface.
  6. Click Finish.

Create a new interface for the child process

To create the new interface, complete the following steps:

  1. Switch to the Business Integration view.
  2. In the navigation tree, expand SharedInterface.
  3. Right-click Interfaces.
  4. From the pop-up menu, select New > Interface.
  5. The New Interface window opens.

  6. From the Module list, select SharedInterface.
  7. In the Folder field, enter bpc/samples.
  8. In the Name field, enter MPGConverterProcess.
  9. Accept the default value for the namespace.
  10. Click Finish. The Interface Editor opens.
  11. Right-click on the canvas and select Add Request Response Operation or just click the appropriate icon .
  12. Rename the operation from operation1 to convert.
  13. Change the name from input1 to milesPerGallon and the type from string to float.
  14. Change the name from output1 to litresPer100KM and the type from string to float.
  15. On the toolbar, click the Save button .

Develop the child business process

Create a new process module for the child process

To create the new module, complete the following steps:

  1. In the Business Integration view, right-click the canvas.
  2. From the pop-up menu, select New > Project > Module. The New Module window opens.
  3. In the Module Name field, enter MPGConverter.
  4. Click Next.
  5. In the Select Required Libraries pane, select SharedInterface.
  6. Click Finish.

Create the child business process

To create the new business process, complete the following steps:

  1. Switch to the Business Integration view.
  2. In the navigation tree, right-click MPGConverter > Integration Logic.
  3. From the context menu, select New > Business Process.
  4. The New Business Process window opens.

  5. In the Folder field, enter bpc/samples.
  6. In the Name field, enter MPGConverterProcess.
  7. Accept the default value for the namespace.
  8. Click Next.
  9. In the Select a Business Process Type panel, select Long-running process.
  10. Click Next.
  11. In the Select an Interface panel, select Select an interface.
  12. Click Browse and select the MPGConverterProcess interface.
  13. Make sure that convert is selected as operation.
  14. Click Finish. The business process editor opens.
  15. Open the Properties view and proceed to the Details section.
  16. From the Automatically delete the process after completion list, select No.

Add a snippet activity

  1. Click the Snippet icon on the palette. This icon can be found here.
  2. Click the connection between Receive and Reply:
  3. The Snippet activity is added.

Implement the snippet activity

  1. In the business process editor, click the Snippet activity.
  2. In the Properties view, click the Details tab.
  3. Select Java as implementation type.
  4. If the Question dialog appears, click Yes.
  5. In the text area, enter the following Java code:
  6. System.out.println(">>>>>> *CHILD*  Input: "+milesPerGallon+" milesPerGallon");
    // some constants needed
    float mile2km = 1.60934f;
    float gallon2litre = 3.78541f;
    // get value from Input message:
    float mpg = milesPerGallon.floatValue();
    // do the conversion
    float kmPerGallon = mpg * mile2km;
    float kmPerLitre = kmPerGallon / gallon2litre;
    // initialize with "infinite" (fallback for div by 0)
    float litresPerKM = 9999.999f; // poor man's infinite value
    // if no div by zero, get the real value
    if (kmPerLitre > 0) litresPerKM = 1/kmPerLitre;
    // put result back to Output message
    litresPer100KM = new Float(100 * litresPerKM);
    System.out.println(">>>>>> *CHILD* Output: "+litresPer100KM+" litresPer100KM");

  7. On the toolbar, click the Save button and close the business process editor.

Develop the parent business process

Create the process module for the parent process

To create the new module, complete the following steps:

  1. In the Business Integration view, right-click the canvas.
  2. From the pop-up menu, select New > Project > Module. The New Module window opens.
  3. In the Module Name field, enter JMSInvoker.
  4. Click Next.
  5. In the Select Required Libraries pane, select SharedInterface.
  6. Click Finish.
  7. On the toolbar, click the Save button .

Create the interface for the parent business process

To create the new business process interface, complete the following steps:

  1. Switch to the Business Integration view.
  2. In the navigation tree, right-click JMSInvoker > Interfaces.
  3. From the pop-up menu, select New > Interface. The New Interface Wizard window opens.
  4. In the Module or Library list, select JMSInvoker.
  5. In the Folder field, enter bpc/samples.
  6. In the Name field, enter JMSInvokerProcess.
  7. Accept the default value for the namespace.
  8. Click Finish. The Interface Editor opens.
  9. Right-click on the canvas and select Add Request Response Operation or just click the appropriate icon .
  10. Select operation1, then click the Add Input icon .
  11. Change the name from input1 to miles and the type from string to float.
  12. Change the name from input2 to gallons and the type from string to float.
  13. Change the name from output1 to litresPer100KM and the type from string to float.
  14. On the toolbar, click the Save button .

Create the parent business process

To create the new business process, complete the following steps:

  1. Switch to the Business Integration view.
  2. In the navigation tree, right-click JMSInvoker > Integration Logic.
  3. From the pop-up menu, select New > Business Process. The New Business Process window opens.
  4. From the Module list, select JMSInvoker.
  5. In the Folder field, enter bpc/samples.
  6. In the Name field, enter JMSInvokerProcess.
  7. Accept the default value for the namespace.
  8. Click Next.
  9. In the Select a Business Process Type panel, select Long-running process.
  10. Click Next.
  11. In the Select an Interface panel, select Select an existing Interface.
  12. Click Browse and select the JMSInvokerProcess interface.
  13. Make sure that operation1 is selected as operation.
  14. Click Finish. The business process editor opens.
  15. Open the Properties view and proceed to the Details section.
  16. From the Automatically delete the process after completion list, select No.
  17. On the toolbar, click the Save button .

Add a new variable

  1. In the business process editor click the Add a global Variable button
  2. The Add a Variable window opens.
  3. Replace the predefined name Variable by mpg.
  4. Type f in the Matching data types panel and click on float.
  5. Click OK.

Add a snippet activity

  1. In the business process editor, click the Snippet icon on the palette.
  2. Click the connection between Receive and Reply. The Snippet activity is added.
  3. Rename the snippet from Snippet to Prepare JMS call.

Finish the snippet activity

  1. In the business process editor, click the Prepare JMS call activity.
  2. In the properties view, click the Details tab.
  3. Select Java as implementation type.
  4. If the Question dialog appears, click Yes.
  5. In the text area, enter the following Java code:
  6. mpg = new Float(miles.floatValue() / gallons.floatValue());

    System.out.println(">>> *PARENT*  Input: "+miles+" miles out of "+gallons+" gallons");
    System.out.println(">>> *PARENT*  ... simplified to "+mpg+" mpg");
    System.out.println(">>> *PARENT*  ... now calling CHILD.");

  7. On the toolbar, click the Save button .

Create Reference Partner

  1. In the navigation tree of the Business Integration view, expand SharedInterface > Interfaces > bpc/samples.
  2. Drag the MPGConverterProcess interface and drop it to the canvas of the business process editor of the JMSInvokerProcess. This operation does not change anything on the canvas, but rather adds the reference partner MPGConverterProcess with the appropriate reference interface.

Add an invoke activity

  1. In the business process editor, right-click the Reply activity and select Insert Before > Invoke.
  2. Change the name of the newly created invoke activity to Call converter process.
  3. Select the new activity Call converter process.
  4. Open the Properties view and proceed to the Details section.
  5. Click the Browse button next to Partner and select the MPGConverterProcess reference partner.
  6. Make sure convert is selected as operation.
  7. Enable Use Data Type Variables.
  8. Click under Read From Variable. A popup with available variables opens.
  9. Select mpg.
  10. Click under Store Into Variable. A popup with available variables opens.
  11. Select litresPer100KM.
  12. The invoke activity properties should now look like this:

Implement another snippet activity

  1. In the business process editor, right-click Reply and select Insert Before > Snippet.
  2. Change the name of the snippet to Display result.
  3. Select the new snippet activity.
  4. In the properties view, click the Details tab.
  5. Select Java as implementation type.
  6. If the Question dialog appears, click Yes.
  7. In the text area, enter the following Java code:
  8. System.out.println(">>> *PARENT* Output: "+litresPer100KM+" liters per 100 kilometers");
    System.out.println(">>> *PARENT* ------------------------------------------");

  9. On the toolbar, click the Save button .
  10. Your business process should now look like this:

  11. Close the business process editor.

Module assembly

For the JMS invocation sample, we have to assemble two modules, the child module first.

Assemble the child module

To do this, complete the following steps:

  1. In the Business Integration view, open the assembly editor for the MPGConverter project by double-clicking MPGConverter > Assembly Diagram. The assembly editor opens.
  2. Drag the MPGConverterProcess to the assembly editor.
  3. In the assembly editor, right-click on the MPGConverterProcess component and select Generate Export > Message Binding > JMS Binding.
  4. The Configure JMS Export Service wizard opens:

  5. For End-point configuration select Configure new messaging provider resources.
  6. In the Default data format section, click on Select. The Data Transformation Configuration window opens.
  7. Select Serialized Java object (JMS).
  8. Click Finish.
  9. Accept the default value, One operation function selector, for the Function selector.
  10. If server security is enabled, specify the J2C Authentication data entry. The default is SCA_Auth_Alias.
  11. Click OK.
  12. On the toolbar, click the Save button and close the assembly editor.

Assemble the parent module

To do this, complete the following steps:

  1. In the Business Integration view, open the assembly editor for the JMSInvoker project by double-clicking JMSInvoker > Assembly Diagram. The assembly editor opens.
  2. Drag the JMSInvokerProcess to the assembly editor.
  3. In the navigation tree, expand MPGConverter > Assembly Diagram.
  4. Drag the MPGConverterProcessExport to the assembly editor. This automatically generates an Import which already contains all definitions needed to call the other module, including all JNDI names of the involved JMS queues.
  5. Accept the warning which instructs you to deploy the child project first and the parent process second:
  6. Rename the Import from Import1 to MPGConverterProcessExport.
  7. In the assembly editor, right-click on the JMSInvokerProcess component and select Wire to Existing.
  8. On the toolbar, click the Save button .

Test the business process in the integrated test environment

Install the JMSInvocation sample to the test environment

  1. In the Servers view, click the Servers tab.
  2. Ensure that the status of WebSphere Process Server v7.0 is Started. If the status is Stopped or not displayed, right-click WebSphere Process Server v7.0 and select Start.
  3. From the table, right-click WebSphere Process Server v7.0.
  4. From the pop-up menu, select Add and Remove Projects. The Add and Remove Projects window opens.
  5. Important: Select MPGConverterApp first from the list of available projects and click Add.
  6. Click Finish. Wait for the project to be published.
  7. From the pop-up menu, select Add and Remove Projects again. The Add and Remove Projects window opens.
  8. Select JMSInvokerApp from the list of available projects and click Add.
  9. Click Finish. Wait for the project to be published.

Run the sample using BPC Explorer

Refer to the Run the Sample section on how to run JMSInvoker sample. For further information on using BPC Explorer refer to the product documentation.

Export runnable applications

If you want to run this sample business process on a WebSphere Process Server, you have to create two enterprise applications. Then you can install these enterprise applications to your WebSphere Process Server, the client Process first.

To create an enterprise application for the MPGConverterApp business process, follow these steps:

  1. From the menu, select File > Export.
  2. In the Export window, expanc J2EE and click EAR file.
  3. Click Next.
  4. In the EAR project list, select MPGConverterApp.
  5. In the Destination list, specify your destination directory.
  6. Click Finish.
  7. Repeat steps 1 through 6 for the JMSInvokerApp EAR project.

Install and run the service invocation sample to WebSphere Process Server

Note: If you do not have a WebSphere Process Server other than the one in the integrated test environment, you can skip this chapter.

Install the MPG Converter application

  1. In a browser, open the administrative console.
    The default URL is
  2. If security is enabled, enter a valid User ID and Password. Click Log in.
  3. In the navigation pane, select Applications > New Application.
  4. Click New Enterprise Application.
  5. Click Browse and select the MPGConverterApp.ear file you created earlier.
  6. Click Next several times and accept all the defaults until you reach Step 3: Summary.
  7. Review the options in the Summary dialog. Click Finish.
  8. Wait until the deployment has finished. This may take some time.
  9. Click Save directly to the master configuration.
  10. In the navigation pane, select Applications > Application Types > WebSphere enterprise applications.
  11. Select MPGConverterApp and click the Start button.

The MPGConverterApp application is deployed and started now.

Install JMS Invoker application

Install JMSInvokerApp in the same way. Additional details for install and hints for uninstall can be found in the HelloWorld sample.

Run your business process using the BPC Explorer

Refer to the Run the Sample section on how to run the invoker process.