Business Operations
The Business Operations module is for declaring data processing methods. The module provides the developer with the technologies that allow focusing attention on the inner logic of various business processes.
Business Operations (BO) are intended to transform the input data into the output data. Some BO can perform complex calculations with subsequent changes in the state of business objects, i.e. they can modify the application data. Other BO obtain input parameters and application data and then return the results, i.e. they always work in the read-only mode. Some examples of BO are listed below:
- payroll,
- composing invoices based on existing contracts,
- obtaining price lists,
- MRP (material requirements planning) procedures,
- etc.
Business Operations are an integral part of the interface that interacts with various subsystems. BO are used to maintain compatibility between different versions of the subsystems. BO also provide a special mechanism to override their implementation without recompiling the code. It thus can be used as a point of configuring the target application.
To see the Business Operations module in action, refer to the Xafari Northwind.DC demo installed with Xafari.
Win:
Web:
The application demonstrates several context-dependent and context-agnostic Business Operations. It is possible to create Managed BO. It means that the Managed (extended) Operations object controls the execution of all related BO.
Technically, each BO is composed of several related classes: the BO class itself and the classes of its Implementations. In fact, the BO class defines only its interface. In this class, the developer should declare all parameters of a particular BO. The business logic is defined by the code in BO Implementation classes. The framework provides two main APIs: one is for accessing metadata about the actual BO and the second is for its execution.
Business Operations can be executed either independently or in the context of a certain object. Context-dependent BO start in the context of specified business objects and use the data of these objects. Suppose the developer needs an operation to recalculate the total amount for a waybill. It is rational to run this operation in the context of the waybill instance. For this task, a context-dependent Business Operation should be implemented. Independent BO do not take any context into account. For example, it may be a batch generation of expenditure vouchers or checking the integrity of the DB.
There are 2 types of context-dependent Business Operations:
- single operations are applied to one instance of the entity;
- list comprehensions operations are applied to a list of entity instances.
Any BO may have one or more Implementations, one of which is the default (current) Implementation. The default Implementation executes as soon as the related BO starts.
The Implementations may be represented by different XAF modules. To specify that the Implementation belongs to a certain Business Operation, the developer uses specific attributes. The developer can set the default Implementation via an attribute or straight in the Application Business Model. BO can perform a variety of Implementations with no need to recompile the source code. It is possible to substitute the default Implementation by adding modules that contain Implementations to the application and specifying the current Implementation in the Application Business Model.
To learn more about Business Operations, refer to the following topics:
- End-User Capabilities
- Business Operations Class
- Managed Business Operations Class
- Implementation Class
- How to Register Business Operation Classes
- How to Customize Business Operation in Code
- How to Call Business Operation in Code
- Business Operation Class Attributes
- Business Operation Properties Attributes
- Business Operation Implementation Class Attributes
- Service Classes
- Business Operations in the Application Model