Skip Headers
Oracle® Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management
11g Release 1 (11.1.1.6.3)

Part Number E15176-11
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

13 Modeling Business Objects

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:

13.1 Introduction to Business Objects

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 Sales Quote example you can group the following data in a Quote object:

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 Sales Quote example you can identify the following business entities:

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.

Oracle BPM Studio provides an editor to view and edit the structure of a business object. The editor enables you to:

Figure 13-1 shows the Business Object Editor editing a Quote object created manually.

Figure 13-1 Business Object Editor

Description of Figure 13-1 follows
Description of "Figure 13-1 Business Object Editor"

13.1.1 Types of Business Objects

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 user-defined module, change its name and add attributes to it.

13.1.2 Benefits of Modeling Using Business Objects

Using business objects to manage the data in your process provides you the following benefits:

  • Simpler Processes: Using business objects 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.

13.1.3 Naming Conventions for Business Objects

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:

Oracle BPM Studio forces the first letter of the name of a business object to uppercase.

13.2 Working with Business Objects

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.

13.2.1 How to Add a Business Object

You can add business objects to the business catalog to model the business entities to store the data in your BPMN process.

To add a business object:

  1. Right-click a user-defined module in the business catalog.

  2. Select New and then select Business Object.

  3. 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.

  4. Click OK.

13.2.2 What Happens When You Add a Business Object

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

13.2.3 How to Modify a Business Object

You can modify an existing business object by:

13.2.4 How to Delete a Business Object

You can delete a business object that you do not use or need. If your project contains flow objects or data associations that use the deleted business object, then you must remove them manually.

To delete a business object:

  1. In the BPM Project Navigator, right-click the business object you want to delete.

  2. Select Delete.

    A confirmation message appears.

  3. Click OK.

13.2.5 What Happens When You Delete a Business Object

Oracle BPM Studio removes the business object from the business catalog. If there are any flow objects in your process that use the removed business object, then you must remove these references manually.

13.2.6 How to Document a Business Object

You can add documentation to a business object for other process developers to understand its functionality and data structure.

To Document a business object:

  1. Edit the business object.

  2. In the business object editor, in the business object Editor, click the Edit button next to the Documentation field.

  3. Add the documentation for the business object.

    See Section 5.6.1, "Introduction to the Documentation Editor", for details on how to create and edit documentation.

  4. Click Close.

13.2.7 What Happens When You Document a Business Object

The documentation is available for other process developers to read and modify.

13.3 Using a Business Object in a Process

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.

13.3.1 How to Use a Business Object in a Process

You can create a complex data object in your process that defines its type using a business object.

To use a business object in a Process:

  1. 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.

  2. Initialize the value of the data object in the process using a Script Task or Data Associations.

13.3.2 What Happens When You Use a Business Object in a Process

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.

13.4 Adding Business Objects Based on a XML Schema Element or Type

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.

13.4.1 How to Add a Business Object Based on a XML Schema Element or Type

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:

  1. Right-click a user-defined module.

  2. Select New and then select Business Object.

    The Create Business Object Dialog appears.

  3. Enter a name to identify the new business object.

  4. Select Based on External Type.

  5. Click the Browse button next to the External Type field or add a new XML schema following the procedure described in Section 13.4.3, "How to add an XML Schema to Your BPM Project".

  6. Select the external type from which to create the new business object.

13.4.2 What Happens When You Create a Business Object Based on an XML Schema Element or Type

You cannot modify or add attributes to the business object. The structure of the business object is based on the structure of the XML schema element or type.

13.4.3 How to add an XML Schema to Your BPM Project

From the Create Business Object dialog you can add an XML schema to your project.

To add an XML schema to your BPM project:

  1. In the Create Business Object Dialog, click the Schema Browser button.

    The Type Chooser dialog appears.

  2. In the upper right corner, click the Import Schema Files button.

    The Import Schema File dialog appears.

  3. Click the Browse Resources button next to the URL field.

    The SOA Resource Browser appears.

  4. Browse your file system and select a schema file.

  5. Select Copy to Project.

  6. Click OK.

    If the XML schema contains references to other types a dialog to confirm their import appears.

    The Browse Resources dialog closes and the Type Chooser dialog appears.

  7. Select an element to use as the base of your business object.

13.4.4 What Happens When You Add a Schema File to Your Project

The Schema Browser copies the selected XML schema to the xsl directory in your project. You can use it to create new business objects without having to re-add it.

13.5 Introduction to Business Object Attributes

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 Sales Quote example you can identify the following attributes in the Quote object:

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:

Additionally you can define the following:

13.5.1 Supported Data Types for Business Object Attributes

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


13.5.2 Naming Conventions for Business Object Attributes

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.

13.6 Working with Business Object Attributes

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.

13.6.1 How to Add a Business Object Attribute

To model a business object that you created from the start, you must add attributes.

To add an attribute to an existing business object:

  1. In the BPM Project Navigator Right-click the business object where you want to add the attribute.

  2. 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.

  3. Enter a name to identify the new attribute.

  4. From the type list, select a type for the new attribute, or click the Browse More Types... button to select a complex type.

  5. Click OK.

13.6.2 How to Delete a Business Object Attribute

To delete an attribute from an existing BPM Object:

  1. Edit the Business Object that contains the attribute you want to remove.

  2. In the Attributes section, click the Remove Attribute button next to the attribute you want to remove.

    A confirmation message appears.

  3. Click OK.

13.6.3 How to Document a Business Object Attribute

You can add documentation to a business object attribute for other process developers to understand its functionality.

To document a business object Attribute:

  1. Edit the business object that contains the attribute you want document.

  2. In the Attributes section, expand the business object attribute you want to document.

  3. Click the Edit... button next to the Documentation field.

    The Documentation Dialog appears.

  4. Add the text to document the functionality of the selected attribute.

    See Section 5.6.1, "Introduction to the Documentation Editor", for details on how to create and edit documentation.

13.6.4 What Happens When You Document a Business Object Attribute

The documentation is available for other process developers to read and modify

13.7 Sharing Business Objects

You can share business objects between different projects by exporting them to a file and then importing them.

You can choose to export a single business objects or multiple business objects. When exporting multiple business objects you can also export exceptions. The file that contains the exported business object has the extension .bob. If the business object depends on other business objects, then those dependencies are also included in the export file.

You can import the business objects from the export file in any other project. When you import a business object, Studio also imports the module where it was stored if the module does not exist already.

13.7.1 How to Export a Business Object

To export a business object:

  1. In the BPM Project Navigator, right-click the business object.

  2. Select Export.

    The Select Object File dialog appears.

  3. Select a directory where to store the exported business object.

  4. In the File Name field, enter a name for the exported business object.

  5. Click Save.

    The exported business object file is stored to the selected directory.

13.7.2 How to Export Multiple Business Objects and Exceptions

To export multiple business objects:

  1. In the BPM Project Navigator, right-click the Business Catalog node.

  2. Select Export Business Objects and Exceptions.

    The Choose Objects dialog appears.

  3. Select the business objects and exceptions to export:

    1. From the Search list select a business object or exception.

    2. Click the Select button.

      The business object or exception appear in the Selected list.

  4. Click OK.

    The Select Object File dialog appears.

  5. Select a directory where to store the exported business object.

  6. In the File Name field, enter a name for the exported business object.

  7. Click Save.

    The exported file is stored to the selected directory.

13.7.3 How to Import Business Objects from a File

To import business objects from a file:

  1. In the BPM Project Navigator, right-click the Business Catalog node.

  2. Select Import Business Objects.

    The Select Object File dialog appears.

  3. Select the file that contains the exported business objects.

  4. Click Open.

    The business objects contained in the selected file appear in the business catalog.