Inactivation Blocking
Background
Many Business Objects contain an "active" flag to indicate whether the record is still valid. Inactivation blocking is the ability of the maintenance document framework to prevent the inactivation of a Business Object if there is another (active) business object that references it. This helps to improve the consistency of the database.
For example, the Object Code BO has a reference to the Object Type BO. Both have active indicators on them. The Object Type may not be inactivated if there is a Object Code record referencing the Object Type record. In this example, we refer to the Object Type as the blocked BO, and the Object Code as the blocking BO.
Configuration of inactivation blocking
Simple configuration
Inactivation blocking is configured within the Data Dictionary file corresponding to the blocking BO. In the file, we specify that this BO will block the inactivation of one or more of its reference objects.
Keep in mind that the Object Code BO has a reference to its Object Type named "financialObjectType". In the above example, to enable the Object Code to block the inactivation of the Object Type BO, we specify the following in the DD of the Object Code BO:
<bean id="ObjectCode-parentBean" abstract="true" parent="BusinessObjectEntry">\ ... <property name="inactivationBlockingDefinitions"> <list> <bean parent="InactivationBlockingDefinition" p:blockedReferencePropertyName="financialObjectType"/> </list> </property> </bean?
By adding the above XML tag to the DD file, whenever we try to inactivate the Object Type (via the Object Type Maintenance Document), the framework will check whether there's an active Object Code that references the Object Type. If such a record exists, then there will be a validation error.
To use the simple configuration option specified in this section, the following conditions must be true:
- The blocking and blocked BOs implementÂ
Inactivatable
, which has theÂsetActive(boolean)
 andÂisActive()
 methods. - The blocking BO has an instance variable namedÂ
active
, and this instance variable is mapped to an OJB field descriptor. - The blocking BO must be queryable viaÂ
BusinessObjectService
'sÂfindMatching(...)
 andÂcountMatching(...)
 methods. In particular, this means thatÂExternalizableBusinessObject
 andÂUniversalUser
 blocking BOs cannot use this simple configuration option. - There must be an OJB or DD defined relationship between the blocked and blocking BO. In particular, the blocking BO needs to have a reference to the blocked BO.