Programming Styles

Describes PBL, Java, and Visual Basic programming styles

Studio supports different programming styles to reduce the time needed to learn how to program business process methods. Each style mimics a well-known programming language as precisely as possible and adds the features that are required to write your business rules effectively.

Oracle BPM Studio supports the following programming styles:

All available styles are functionally identical except where specifically noted. In other words, the Java and Visual Basic styles are not Java or Visual Basic. They are actually PBL formatted with Java or Visual Basic syntax as a programming aid to people familiar with these languages.

PBL Programming Style

This is the native and recommended style. Also, most of the programming examples in this documentation are in the native PBL style. The following example shows some of the characteristics of the PBL programming style:
firstName as String
lastName as String
selectedButton as String

// Ask the person's name
input "First Name:" : firstName, "Last Name:" : lastName
    using title = "Enter Your Name", buttons = ["Done", "Cancel"]
    returning selectedButton = selection

// Check the button pressed 
if selectedButton = "Done" then
   display "Hello " + firstName + "!"
else
   display "Hello!"
end

Java Programming Style

This style emulates Java syntax and adds several features to match PBL expressions. These added features include:
  • Output arguments
  • Input and display statements
  • Variable auto-initialization
  • Transformations
The following example shows some of the characteristics of the Java programming style:
String firstName;
String lastName;
String selectedButton;

// Ask the person's name
input("First Name:" firstName,
      "Last Name:" lastName, title : "Enter Your Name", buttons : { "Done", "Cancel" }, out selection : selectedButton);

// Check the button pressed 
if (selectedButton == "Done")
{
    display("Hello " + firstName + "!");
}
else
{
    display("Hello!");
}

Visual Basic Programming Style

This style emulates Microsoft Visual Basic syntax. However, unlike Visual Basic, the Visual Basic style is case sensitive. This programming style also has several additional features including:
  • Input and display statements.
  • Variable auto-initialization.
  • Transformations.
The following example illustrates the Visual Basic programming style:
Dim firstName As String
Dim lastName As String
Dim selectedButton As String

' Ask the person's name
Input "First Name:" : firstName,
      "Last Name:" : lastName, title := "Enter Your Name", buttons := { "Done", "Cancel" }, Out selection := selectedButton

' Check the button pressed 
If selectedButton = "Done" Then
    Display "Hello " & firstName & "!"
Else
    Display "Hello!"
End If