Implementation of Documentum Business Object Framework (BOF)
Business Object framework is the object oriented framework provided by Documentum to build, deploy, test and execute reusable business logic component known as Business Objects.
Types of BOF Modules:
- TBO – Type Based Business Object
- SBO – Service Based Business Object
- Simple Module
Steps to Create different type of Modules
As TBO depends on persistence object type, we can either modify the existing functionality of the persistence object or we can add new functionality.
We will discuss below how to modify the default save functionality as well we add new functionality.
- For writing TBO we must have a persistence object type. It is always a good practice to create a sub type of existing documentum types without trying to modify the default one. So in our case we will create an object type my_document_tbo. We can create the object type in different ways here we will do it via composer.
- We can now install the documentum project to create the object type in the docbase or we can do it after writing the TBO.
- Create the interface class by extending the corresponding DFC type class associated with super type of the object type. The interface class needs to directly or indirectly extends IDfBusinessObject. In our case, the interface class implements IDfDocument which in turn extends the IDfSysObject, which ultimately extends IDfBusinessObject .
- Create the implementation class. The implementation class must extend the DFC type class of the associated super type and it must implements IDfDynamicInheritence.
In this example, we are modifying the existing save functionality.
- Create interface jar don’t mix Implementation and interface classes together. We need to create separate jars for both of them.
Select only the interface class and browse the location to save the interface jar file as shown below:
- Create the implementation jar following the above steps.
- Once the jar files are created we have to create Jar file definition in Composer.
Select type as Interface and File points to the interface jar we created in previous steps.
- Same we have to do for implementation jar.
- Now we have to create the module definition. The TBO name must be the same as the object type for which we are creating the TBO.
- Install the documentum project into the repository.
Provide the login details of docbase and install the documentum project. Once the project is installed the TBO is ready to consume.
- To check the doSave method modification you can simply use DA to import or create file of our custom object type.
- In order to test the new functionality, we can write a client code to create an object of custom object type.
In client code we have add the interface jar in the class path.
Service Based Business Object is independent of object type and repository. The SBO is installed in the global repository.
Building and deploying SBO using Composer:
- Create an interface which extends IDfService and define your business method
- Add the business method which you want to expose to the user.
- Create the implementation class
- Add the business logic. In this example, it is shown how to create session in SBO and used it to get the docbase name.
- Create the interface jar
- Create the implementation jar
- Once the interface and implementation jars are created. It’s time to create the jar definition for both interface and implementation jars.
- Create the SBO module. Use full qualified name for the SBO. Generally the interface name is the SBO name.
- Install documentum Project to install the SBO into global repository
- To test the SBO which we have installed in the above, we have to create a client.
Create a client documentum project and add the interface jar in the class.
- Create a SBO client to call the SBO
- Simple Module:
Steps to create simple module:
- Create the interface class. The interface class will extend the IDfModule
- Create the implementation class extending DfSingleDocbaseModule and implements the interface created in step 1.
- Create the interface and implementation jars separately.
- Similar create the implementation jar
- Create jar file for both interface and implement
- Create the jar definition of interface and implementation jar
- Create the module definition
- Install the documentum Project to intall the simple module into the repository
- Create Client to run Simple Module. Add the Interface jar in the class path of the documentum project created for client.
- Implementation of Job and Method using BOF
- Create the implementation class. The implement class must implements IDfModule and IDfMethod
- Export the implementation class and create the jar.
- Create the jar definition of the exported jar.
- Create the module definition. The module name should be the fully qualified name.
- Create the method definition (dm_method), preferable to create in DA.
Note: Do not check Use as Workflow method, otherwise once the Job will run it will go to running state forever.
- Create the job definition same preferable to create in DA, as something the method is not detected stating that unable to find the method.
- Install the Documentum Project
- Once the project is successfully installed in the repository, run the job. Cheers