Replaceable/Replacement BOs
Introduction
Replaceable Business Objects (BOs) can be substituted by Business Objects either from the same or another Package. These Business Objects are defined as Replacements.
This strategy allows you to change the behavior of a Package without making changes to its Business Objects. For example, you can replace a default Template Screen that comes with a Package with your own version, thereby customizing the look & feel of all Screens to match your preferred style. You could also replace the Data Logic BOs provided by a Package with your specific Data Logic BOs. All this can be done without changing the Package itself.
Defining Replaceable/Replacement Business Objects
Business Object Types
The following Business Object types can be defined as Replaceable or Replacements:
- Data Logic Business Object
- Data Class Business Object (the replacement Data Class must contain only Static Functions)
- Process Business Object
- Script Function
- Screen
- Catalog Business Object
- PDF Output
- PDF Output Table
- Integration Link. In this case, the replacement and original Integration Links must use the Integration Link (Start Element) start component. See Replacing Integration Links in Packages).
- Rule
- Rule Set (currently deprecated)
Replacing Business Objects
Let's assume you have an application built in PackageA, Business Object ScreenA in this Package determines the styling of this application. If you want to adapt the styling of the application without modifying ScreenA, you may use ScreenB from PackageB as a Replacement.
Follow these steps:
- Open PackageA and select the Properties tab. In the Replaceable menu, define the Business Object you want to replace (ScreenA in our example). ScreenA is now a Replaceable Business Object.
- Go to PackageB and select the Properties tab. In the Replacements menu, define the Business Object you want use as a replacement (ScreenB in our example) in the menu. ScreenB is now a Replacement Business Object.
- Go to the configuration of PackageA (Package Overview > Configure Package), and select the Business Objects Replacement menu. Find ScreenA in the list and define ScreenB as its replacement.
Note that the Properties panel of each Business Object (opening on the right when clicking on the Business Object) also shows whether such BO is Replaceable or a Replacement BO.
Further Notes
Consider the following information when replacing Business Objects:
- Replacement is a runtime mechanism: at design-time, you see the original Business Object. In our example, if Screen B (as part of a Process) is a replacement for Screen A, you continue to see the original Screen (A) in the Process Editor. The replacement Screen (B) is only visible when you run the Process.
- Ensure that the Business Object you are using as a replacement respects the constraints of the Business Object being replaced. See the following examples:
- Script Functions: The signature of the replacement Function must match the signature of original Function in terms of output type, input parameters (name and type in the same order).
- Catalogs: The column ids in the original and Replacement Catalogs must match.
- Other Business Objects: The list and types of assigned variables in the original and Replacement BOs must be the same.