This sample demonstrates how to embed the rule engine into an existing local application.
This sample covers:
-
writing a business rule
-
designing a decision table
-
designing a ruleflow
-
creating a rule engine instance
-
setting the value of a ruleset parameter
-
running the rule engine using the selected rules against the objects present in the working memory
The C# source files of this sample are in the directory <InstallDir>\Samples\Executing\Rule Application\cs.
The Visual Basic source files of this sample are in the directory <InstallDir>\Samples\Executing\Rule Application\vb.
Where <InstallDir> refers to the installation directory of ILOG Rule Studio for .NET.
This sample contains the following files and directories:
-
Application: A project containing the entry point of the application.
-
EntryPoint: The entry point of the application. This is where the rule engine and the ruleset are created, the ruleflow is set on the rule engine, and the objects are created and passed to the ruleflow using ruleset parameters, then the ruleset is executed.
-
BusinessObjectModel: A class library project with an annotated business object model containing:
-
RentalAgreement: A sample rental agreement class.
-
Session: A utility class for displaying messages.
-
Customer: A sample customer class.
-
BusinessRules: A rule project containing one business rule.
-
Pricing.blx: A business rule that calculates the price of the rental.
-
AgeCheck.dtx: A decision table that checks if customers are allowed to drive in the state where they rent their car.
-
Ruleflow.rfx: A ruleflow that manages the execution of the business rule and the decision table.
To run the sample
-
In Visual Studio .NET, open the solution Rule Application.sln.
-
From the Build menu, click Build Solution.
-
From the Debug menu, click Start Without Debugging.
Highlights
This basic sample showing how to run the rule engine and display results on the console.
See Also
Executing Rules