Rule Builder > Debugging and Profiling > Testing the Execution of a Ruleset > Connecting a Remote Engine

If your engine is embedded in a rule application, you need to start it from the application. You can then connect this engine remotely to the Rule Builder, and choose whether you want to use the Rule Builder as a debugging or profiling tool, or if you want to use the complete functionality of the Rule Builder in your application.

Use the following code to instantiate an engine in your rule application:

public class Main 
{
public static void main(String[] args) {
// create a context
IlrContext context = new IlrContext();
// Initialize the working memory
. . . . . .
// Give control to the Rule Builder
context.delegateControl();
// close the context
context.retractAll();
context.end();
}
}

To connect the application to the Rule Builder, you need to set a Java property in the virtual machine that executes the application.

You can set the property directly inside your Java code, or you can pass it in the command line that launches the application. For example, you could write the following command (with no blank between the -D and port value) to start the Java program MyEngine.Main:

java -D<property>[=[<hostName>][:<port>]] MyEngine.Main

where the square brackets [] enclose the following optional values:

If you want to connect the Rule Builder with only the stepping and controlling capabilities, you need to use the following combination of properties:

java -DIlrRemoteStepper=[[hostName][:port]] 
-DIlrRemoteController=[[hostName][:port]]
application_name

A connection API is also available to control the connection between the application and the Rule Builder. For details, see the method IlrContext.connectTool.


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT