| Modeling and Implementation Guide for Oracle Business Process Management |
This chapter describes how to use Business Objects in a BPM Project. Business Objects allow you to manage the data in your process efficiently and enable you to reuse existing components. They reduce the complexity of your process making it easier to maintain.
This chapter includes the following sections:
Business Objects allow you to model and develop the business entities that are part of your process using the Object Oriented paradigm.
Using Business Objects simplifies the management of the data in your process by encapsulating the data and business behavior associated with the business entity it represents.
A Business Object is composed of a set of attributes and a set of methods. Attributes store the data related to the entity you are modeling. Methods manipulate the value of these attributes, or perform calculations based on their values.
Typically Business Objects represent entities in an actual business, but you can also use them to encapsulate business logic that is not associated to any particular entity.
Generally when your process contains a large number of data objects, you can group those that describe the same identity in a Business Object. For example, in the purchase order process you can group the following data in a Customer object:
Name
Last Name
Address
Telephone
ID
Password
Using Business Objects to manage a group of related data reduces significantly the complexity of your process by replacing multiple process data objects by a single data object of the type of the Business Object you defined. Additionally it provides you other benefits described in the Section 13.1.2, "Benefits of Modeling Using Business Objects".
In a purchase order process you can identify the following business entities:
Customer
Order
Invoice
Product
Each of these entities groups a set of highly related data. This data is represented in the attributes of an Business Object. The attributes define and describe the same business entity. The value of these attributes defines the state of the Business Object.
The Business Objects you define in your BPM project are stored in user-defined modules in the business catalog. When you open a business object, its editor shows you its description and the attributes that compose it .
The way you create a business object determines its characteristics and functionality.
The following are different ways of creating a business object:
Manually: You can build a business object manually by creating it and then adding attributes and documentation.
Based on an XML schema element or complex type: The resulting business object contains one or more attributes that map the selected schema element or complex type. You cannot remove these attributes, but you can add new attributes.
By customizing a synthetic type in the Types: You can customize the types that the business catalog adds to the Types predefined module when you add a Service or a Reference that require them as arguments. When you customize a type you can store it in a custom module, change its name and add attributes to it.
Using business objects to manage the data in your process provides you the following benefits:
Simpler Processes: Using business object reduces the quantity of process data objects in your process. This makes your process simpler and easier to read.
Coupling Reduction: If your process has fewer data objects, the subprocesses and activities that compose it, require less parameters.
Re-use: You can use a business object you defined for a particular process in other processes that do not necessarily belong to the same project. Reusing business objects can dramatically reduce the development time of your project.
Easy Maintenance: If you update or fix a bug in a business object all the processes using it benefit from those changes.
Parallel Development: After you agree on a certain interface for the business objects in your process, some members of your team can work on the development of those business objects while others work on the development of the process.
Unit Testing: You can test each of the business objects in your process separately. Unit Testing reduces the complexity of your test cases and improves significantly the quality of your project.
When you name a business object you should respect the following rules:
Use one or more nouns, or nouns modified by adjectives.
Do not start the name with a number.
Use capital letters only to distinguish internal words.
Keep names simple and descriptive.
Use whole words, avoid using acronyms unless they are widely known.
|
Note: Studio forces the first letter of the name of a business object to uppercase. |
You can add business objects to your BPM project to store data related to the processes it contains. The business objects you add are stored in the business catalog, for more information about the business catalog, see Chapter 12, "Using the Business Catalog".
When developing a business object you can modify it, rename it, or delete them. You can also add documentation that helps you identify the functionality of the business object or describes how to use it.
To add a business object:
Right-click a user-defined module in the business catalog.
Select New and then select Business Object.
Enter a name to identify the new business object.
|
Note: You cannot repeat a name within the same module. However you can assign the same name to business objects in different modules. |
Click OK.
The business object appears in the business catalog. You can use this business object to define the type of the following elements in your BPMN process:
Arguments in data associations
Process data objects
Project data objects
You can modify an existing business object by:
Adding attributes
Deleting attributes
Adding documentation
To delete a business object:
In the BPM Project Navigator, right-click the business object you want to delete.
Select Delete.
A confirmation message appears.
Click OK.
BPM Studio remove the business object from the business catalog. If there are any flow objects in your process that use the removed business object, then you have to remove these references manually.
To Document a business object:
Edit the business object.
In the business object editor, in the business object Editor, click the Edit button next to the Documentation field.
Add the documentation for the business object.
See Section 5.4.1, "Introduction to the Documentation Editor", for details on how to create and edit documentation.
Click Close.
You can use business objects to store data related to your process. To use a business object in your project, add a process data object to your process and set its type to the business object you created. You can update the information in this data object from any of the activities in the process.
To use a business object in a Process:
Add a process data object to your process. Use the business object as the type of the data object.
See Section 8.3.1, "How to Add a Process Data Object", for information on how to add a process data object.
|
Note: When selecting the type of the data object use the Browse More Types... button to display the complete list of types. Then select <Component> to display the list of available business objects. |
Initialize the value of the data object in the process using a Script Task or Data Associations.
The data object you defined has the structure defined in the business object. The type of the data object is the name of the business object. For example, if you define a business object SalesQuote and then create a data object that uses this business object as its type, then the type of the data object is SalesQuote.
You can assign values to the data objects that use these types using data associations and script tasks.
You can create a business object based on an XML schema element or complex type. The XML schema element or complex type you use to create your business object has to be part of your BPM Project. You can add an XML schema that contains the element or complex type to your project, or you can use a use a type defined inline in a WSDL file. For the latter you must add the WSDL file to your project by adding an SOA Adapter of type Web Service.
When you create a business object using an XML schema element, the selected element becomes an attribute of the resulting business object.
When you create a business object using an XML schema element, the selected element becomes an attribute of the resulting business object.
If you create a business object based on a schema contained in a WSDL file, then you cannot use the resulting business object as the type of an attribute of another business object.
Before following this procedure ensure that the business catalog contains the XML schema you want to use as a base for your Business Objects.
To add a business object based on an XML schema or complex type:
Right-click a user-defined module.
Select New and then select Business Object.
Enter a name to identify the new business object.
Select Based on External Type.
Click the Browse button next to the External Type field.
Select the external type from which to create the new business object.
Attributes store data that defines and describes the business object. The attributes in a business object are equivalent to instance variables in Object Orientation.
In the purchase order process you can identify the following attributes in the Product object:
Product ID or SKU
Product description
Price
These attributes describe the product and are relevant to the process. The ID or SKU serves to identify the chosen product. The description is probably used to show the user what the product does. And the price is used to show the customer how much the product costs and later in the process to calculate the total amount due.
When you define an attribute you must specify:
Name: used to identify the attribute.
Type: that defines the type of data you can store in the attribute. Attributes support simple types or other defined business objects.
Additionally you can define the following:
Description: provides details about the attribute that help other process developers to understand its use.
Documentation. See Section 13.6.3, "How to Document a Business Object Attribute".
Custom default value
Not null constraint.
The following table describes the supported data types for an attribute in a business object:
| Data Type | Description |
|---|---|
| Bool | True or false values |
| Int | Integer numbers |
| Decimal | Decimal numbers with defined precision |
| Real | Real numbers |
| String | Alphanumeric values |
| Time | Units of time |
| Interval | Intervals of time |
| Binary | Binary values (For example: images, files) |
| Array | A collection of elements of a specified data type |
| Complex Types | Other business objects |
When you name a attribute of a business object you should respect the following rules:
Use one or more nouns, or nouns modified by adjectives
Use capital letters only to distinguish internal words
Keep names simple and descriptive
Use whole words, avoid using acronyms unless they are widely known
Do not start the name with symbols
Use short but meaningful names
Avoid using one-character names
|
Note: Studio forces the first letter of the name of an attribute to lowercase. |
To model a business object you must add it attributes. These attributes store the data related to your process. You can add, modify and delete attributes as necessary.
You can also add them documentation that describes the data they store and provides any necessary information to the user of the business object.
To add an attribute to an existing business object:
In the Project Navigator Right-click the business object where you want to add the attribute.
Select New and then select Attribute.
|
Note: Another alternative for the previous steps is editing the business object and clicking the Add button in the Attributes section. |
Enter a name to identify the new attribute.
From the type list, select a type for the new attribute, or click the Browse More Types... button to select a complex type.
Click OK.
To delete an attribute from an existing BPM Object:
Edit the Business Object that contains the attribute you want to remove.
In the Attributes section, click the Remove Attribute button next to the attribute you want to remove.
A confirmation message appears.
Click OK.
To document a business object Attribute:
Edit the business object that contains the attribute you want document.
In the Attributes section, expand the business object attribute you want to document.
Click the Edit... button next to the Documentation field.
The Documentation Dialog appears.
Add the text to document the functionality of the selected attribute.
See Section 5.4.1, "Introduction to the Documentation Editor", for details on how to create and edit documentation.