New Features
Enhanced Features
O/R Mapping
Tips and Tricks
UML Diagrams
VP Suite

Generate BPEL for JBoss workflow engine (jbpm)

Since Oracle BPEL requires some system resource and may not suitable for all users. A more light weight workflow engine JBoss jBPM is also supported for generating BPEL.

Drawing BPEL Business Process Diagram

As the name implies, BPEL Business Process Diagram is a Business Process Diagram for BPEL (Business Process Execution Language).

Creating Participant for Pool

According to the specification of BPEL, each BPEL is described by WSDL. Within BPEL Business Process Diagram, there is a corresponding property called Participant of Pool. The steps below demonstrate how to create Participant for Pool by using template.

  1. Open or create Business Process Diagram.
  2. Rename Pool.
    generatebpelforjboss_diagram_rename.jpg

  3. Open Specification of Pool.
    generatebpelforjboss_diagram_openspec.jpg

  4. Create Participant using template.
    generatebpelforjboss_diagram_createparticipant_crop.jpg

  5. Click OK several times to apply and close all dialog boxes.

Create option Creation result
Create Participant... Empty Participant
Create asynchronous Participant... Participant of asynchronous template
Create synchronous Participant... Participant of synchronous template

Asynchronous Participant

When using asynchronous Participant, the BPEL process will become asynchronous at runtime. As implied by the name, interaction of asynchronous process may not reply immediately. Therefore, another operation should be defined for the callback purpose. In our asynchronous template, two sets of partnerLinkType, portType and operation are included, which are used for caller and callback.

Synchronous Participant

Contrary to asynchronous Participant, synchronous Participant will cause BPEL process become synchronous at runtime. Any interactions of synchronous Participant must reply immediately. Therefore, only one operation is required and the synchronous template includes only one set of partnerLinkType, portType and operation.

Creating and setting Partner Link

Partner Link is a reference of Web Service used within BPEL. In BPEL Business Process Diagram, Pool is used to define Partner Link.

  1. Open Specification of Pool.
    generatebpelforjboss_pool_openspec_crop.jpg

  2. Normally, Pool with Partner Link will be set as black box.
    generatebpelforjboss_pool_blackbox.jpg

  3. Create Partner Link.
    generatebpelforjboss_pool_createpartnerlink_crop.jpg

  4. Since Partner Link is separated from Pool, name of Partner Link should be maintained manually.
    generatebpelforjboss_partnerlink_rename_crop.jpg

  5. Participant of Partner Link is used to describe which Web Service it refers to.
    generatebpelforjboss_partnerlink_selectparticipant_crop.jpg

  6. Partner Link Type of Partner Link represents the interaction of BPEL and Web Service.
    generatebpelforjboss_partnerlink_selectpartnerlinktype_crop.jpg

  7. My Role and Partner Role is used for identifying responsibility of interaction. In synchronous process, only one role is required because it is a single direction invocation. In asynchronous process, two roles are required which describe caller role and callback role.
    generatebpelforjboss_partnerlink_selectmyrole_crop.jpg

Setting BPEL properties

For executing the business process, some related properties are required to set. Basic properties are described using the example below. In the example, the Business Process will start by receiving a message. Then it will make some modification to the message. Finally, the modified message will return back.

  1. Draw Business Process.
    generatebpelforjboss_diagram_overview_noproperty.jpg

  2. Start by receive a message.
    1. Open Specification of Task.
      generatebpelforjboss_receivetask_openspec_crop.jpg

    2. Open Specification of Task Type.
      generatebpelforjboss_receivetasktype_openspec_crop.jpg

    3. Check Instantiate if message will create a process instance. Since process will start when message is received, Instantiate should be checked.
      generatebpelforjboss_receivetasktype_inputinstantiate.jpg

    4. Select Partner Link of receiving message. Since message is from other to current process, the Partner Link should be “Client” which is the Web Service interface of current process.
      generatebpelforjboss_receivetasktype_selectpartnerlink_crop.jpg

    5. Select Operation to be invoked by other.
      generatebpelforjboss_receivetasktype_selectoperation_crop.jpg

    6. Select the corresponding Varaible. Since the Variable does not exist, create one for it.
      generatebpelforjboss_receivetasktype_createvariable_crop.jpg

    7. Select the corresponding Message. Select Process1_RequestMessage since the Operation required it as input message.
      generatebpelforjboss_variable_selectmessage_crop.jpg

    8. Click OK several times to apply and close all dialog boxes.
  3. Modify the received message.
    1. Open Specification of Task.
      generatebpelforjboss_task_openspec_crop.jpg

    2. Create Assignment.
      generatebpelforjboss_task_createassignment.jpg

    3. Create From.
      generatebpelforjboss_assignment_selectfrom_crop.jpg

    4. Input Expression of the value to be copied from. In this example, the expression is concat(’Hello ‘, bpws:getVariableData(’Variable’, ‘Greeting_RequestMessage_Part’, ‘/Greeting_RequestMessage_Part/value’))
      generatebpelforjboss_from_inputexpression_crop.jpg

    5. Create To.
      generatebpelforjboss_assignment_selectto_crop.jpg

    6. Create To Variable. Create a Variable for storing modified message and return back.
      generatebpelforjboss_to_createvariable.jpg

    7. Select the corresponding Message. Select Process1_ResponseMessage since the Operation for return required it as input message.
      generatebpelforjboss_variable_selectmessage2_crop.jpg

    8. Select Part of Variable to be copied to.
      generatebpelforjboss_to_selectpart_crop.jpg

    9. Input Query of the value to be copied to.
      generatebpelforjboss_to_inputquery_crop.jpg

    10. Click OK several times to apply and close all dialog boxes.
  4. Return modified message back.
    1. Open Specification of Task.
      generatebpelforjboss_sendtask_openspec_crop.jpg

    2. Open Specification of Task Type.
      generatebpelforjboss_sendtasktype_openspec_crop.jpg

    3. Check Reply if process is synchronous. Since process is synchronous, the reply should be checked.
      generatebpelforjboss_sendtasktype_inputreply_crop.jpg

    4. Select Partner Link of return message.
      generatebpelforjboss_sendtasktype_selectpartnerlink_crop.jpg

    5. Select Operation to be used for return.
      generatebpelforjboss_sendtasktype_selectoperation_crop.jpg

    6. Select the corresponding Varaible.
      generatebpelforjboss_sendtasktype_selectvariable_crop.jpg

    7. Click OK several times to apply and close all dialogs.

Generating JBoss BPEL

As JBoss jBPM requires lots of user interactions, there are many assumptions applied when generating BPEL for JBoss. And since only basic validation is provided, an invalid BPEL may also be generated and it may fail at deployment generation.

  1. Open Export Dialog.
    generatebpelforjboss_openexportdialog_crop.jpg

  2. Select Output Directory.
    generatebpelforjboss_exportdialog_inputoutputdirectory_crop.jpg

  3. Select Target Server.
    generatebpelforjboss_exportdialog_selecttargetserver_crop.jpg

  4. Configure Target Server.
    generatebpelforjboss_openconfiguretargerserverdialog_crop.jpg

    1. Select jBPM Home.
      generatebpelforjboss_configuretargetserverdialog_inputjbpmhome_crop.jpg

    2. Select jBPM Configure File.
      generatebpelforjboss_configuretargetserverdialog_inputjbpmconfigurefile_crop.jpg

    3. Input jBPM Host.
      generatebpelforjboss_configuretargetserverdialog_inputjbpmhost_crop.jpg

    4. Input jBPM Port.
      generatebpelforjboss_configuretargetserverdialog_inputjbpmport_crop.jpg

    5. Select WSDP Home.
      generatebpelforjboss_configuretargetserverdialog_inputwsdphome_crop.jpg

    6. Select SDK Home.
      generatebpelforjboss_configuretargetserverdialog_inputsdkhome_crop.jpg

    7. Input Partner Link Map.
      generatebpelforjboss_configuretargetserverdialog_inputpartnerlinkmap_crop.jpg

  5. Check Auto Overwrite if overwrite existing files.
    generatebpelforjboss_exportdialog_inputautooverwrite.jpg

  6. Start Export.
    generatebpelforjboss_exportdialog_okay.jpg

  7. Wait until export finished.
    generatebpelforjboss_exportingdialog_working.jpg

    generatebpelforjboss_exportingdialog_okay.jpg

  8. Review Export Result.
    generatebpelforjboss_exportresultdialog.jpg

    Double-click on a list item may open a dialog with file content.
    generatebpelforjboss_exportresultdialog_xmlfile.jpg

  9. Debug Feature. Since it is not easy to debug a diagram with message only, an export details is provided.
    generatebpelforjboss_openexporttracedialog_crop.jpg

    generatebpelforjboss_exporttracedialog.jpg

    Double-click on an list item may open a dialog with details.
    generatebpelforjboss_traceitemdialog.jpg

Export Details

Export Details is the actual steps of exporting BPEL for debugging usage. In exporting BPEL, there are six major procedures. Each procedure depends on its previous procedure and will be executed one by one. Any error within the procedure will be stored, then try to continue the procedure. If procedure has error occurred, the next procedure will not be executed and the whole progress will be canceled.

The Export Trace dialog, is used to display the steps of each procedure. In other words, it show the diagram’s execution sequence of each procedure. With the Export Trace dialog, it is possible to show details by double-clicking on a list item. However, some item is not possible to visualize. Therefore, double-clicking on those items will have no effect.

Deploying and testing BPEL

After generated JBoss BPEL, a set of files are created at the selected output directory. If files do not exist, there must be problem in the diagram. Please refer to the export details and try to fix it.

Deploy BPEL into JBoss

  1. Open browser and open file deployTool.html.
    generatebpelforjboss_deploytool.jpg

    generatebpelforjboss_deploytool_success.jpg

  2. Copy or move *.ear to the JBoss deploy folder. For example, JBOSS_HOME\server\default\deploy.
    generatebpelforjboss_bpelprocess.jpg

Test BPEL of JBoss

A customize testing program must be created manually because JBoss jBPM does not provide any client application.

This is the example testing class.

package test;

import greeting.*;
import java.rmi.*;
import javax.xml.rpc.*;

public class TestGreeting {
  public static void main(String[] args) {
    Greeting_RequestType lGreeting_RequestType = new Greeting_RequestType("Your Name");
    try {
      PortType lPortType = new GreetingService_Impl().getClientPort();
      PortType_Stub lPortType_Stub = (PortType_Stub) lPortType;
      lPortType_Stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
          "http://localhost:8080/Greeting/Client?wsdl");
      Greeting_ResponseType lGreeting_ResponseType = lPortType
          .greeting_InitiateOperation(lGreeting_RequestType);
      System.out.println(lGreeting_ResponseType.getValue());
    } catch (RemoteException lRemoteException) {
      lRemoteException.printStackTrace();
    }
  }
}

This is the example testing project.
generatebpelforjboss_testingproject.jpg

Notice that one of the libraries is generated by export.
generatebpelforjboss_clientlibrary.jpg

Samples

Click on the link below to download:

 
 
Last modified: 2006/09/09 00:24
 
 
Home | Recent Topics | Highlights | UML Diagrams | Tips and Tricks | Object-Relational Mapping
visual-paradigm.com Home | Training Center | UML Center | VP Gallery | Discussion Forum | UML Open Directory