In ILOG Rules for .NET a business object model is associated with a class library project, which is referred to as the business object model project.
The business object model can contain types that are defined in this project, as well as types that are defined in the references of the project. A reference can be either another project in the solution, a .NET assembly, or a COM Interop assembly.
To create a business object model
-
Add a new class library project to a standard Visual Studio .NET solution, or select an existing project in the solution.
-
In the Business Object Model View, click
.
-
Select the class library you added in the first step, and click Finish.
A new business object model appears in the
Business Object Model View. The name of the business object model is the same as its associated project.
You can now import the types that are accessible from the class library project into the business object model.
To import classes and class members into the business object model
-
Build the solution.
-
In the Business Object Model View, select a business object model, and click
.
The
Business Object Model Wizard opens. In this wizard you can browse the contents of the project associated with the business object model, as well as the contents of its referenced assemblies.
-
Check the classes you want to import, and click OK.
The
Business Object Model Wizard imports the classes you selected into the business object model.
| Note |
| When a class is imported, its Visible property is set to True, while the Visible property for its members keeps its default value. This means that for each member, the Visible property will inherit the value of the declaring type. For more information on this property and the other properties of the members of a business object model, see the tables for the business object model properties of classes and class members in the User Interface Reference.
|
You can also import other business object models to create one, merged business object model.
To import a business object model
-
In the Business Object Model View, right-click the first node in the tree.
-
On the shortcut menu, click Import Model.
-
Go to the business object model file (Model.bmx) you want to import and click Open.
The
Business Object Model View includes the types and members described and verbalized in the Model.bmx file you selected in the current business object model.
The business object model is automatically saved (in a file called Model.bmx) when you build it or when you close the solution. You can also save explicitly it to make sure that the version of the business object model in memory is the same as the one in the file.
To save a business object model
-
In the Business Object Model View, right-click the first node in the tree.
-
On the shortcut menu, click Save <Business Object Model>.
The
Business Object Model View saves the current business object model.
Including CLR Classes in a Business Object Model
The class library project that hosts the business object model must be a C#, VB .NET or J# class library project. You can, however, write business rules against classes that are defined in any language supported by the .NET Framework.
For example, suppose that you want to use classes that are defined in a Managed C++ library. To set up the business object model you:
-
Create a business object model project using a C#, VB .NET or J# class library project, and add a reference to your Managed C++ library.
-
In the Import Project wizard, import the business object model project.
-
Then in the Business Object Model wizard, you can import the types in your managed C++ library, and verbalize them in the Business Object Model View, and write rules against these classes.
See Also
Removing Members from the Business Object Model | Modifying Native Data Types in the Business Object Model | Including XML-based Classes in a Business Object Model