Business Object Inheritance in BPM12c
By Abhishek Mittal-Oracle on Sep 01, 2014
With the release of BPM12c, one of the major OOPS feature is included which was a part of BPM10gR3. Inheritance enables to reuse the data and its behavior defined an BPM business object. This in turn allows us to avoid duplicate data structure, methods, etc making module and project support and maintenance easy and prone to minimal issues.
To use inheritance in BPM12c, you need to define a parent business object containing attributes and methods. Once done, define another business object which will inherit from parent business object. It will be child data object. Hence, this child business object will contain all attributes and methods defined in parent business object. At the same time, we can add more attributes and methods inside the child data object.
Below OOPS concepts can be implemented in BPM12c:
1. Method Overloading
2. Method Overriding
At the design phase, we can mark a business object as 'Abstract'. It means that we can define a business object attributes and methods to reuse in a child data object but we can't use them to create a instance in BPM workflow as the data object is abstract.
Steps to use Inheritance in Business Objects:
1. Open JDEV12c.
2. Create a BPM project.
3. Right click on Business Components and then select 'Business Object'. Name it as 'ParentDataObject'.
4. Define few attributes(like name, city, country) and methods(like modifyDetails()) inside this data object.
5. Right click on Business Components and then select 'Business Object'. Name it as 'ChildDataObject'.
6. Select 'ParentDataObject' as 'Parent' inside this data object. We will find that all the attributes defined under 'ParentDataObject' automatically comes in Attributes section.
7. Add more attributes(like company) inside 'ChildDataObject'.
8. We can even override and overload the method i.e. modifyDetails() defined in 'ParentDataObject' in 'ChildDataObject'.
9. Create a BPM process flow and define a data object like 'v_details' of type 'ChildDataObject'.
10. On testing the process, we will find that inheritance is working as expected in BPM12c.
I have created on PoC for the usage of Inheritance feature in BPM12c and it can be found here.