Automated ruleset management sample details

You use the samples console to run this sample.

Running this sample

To run this sample:

  1. In the Samples Commands view, go to Samples Commands > Rule Execution Server > Automated ruleset management > <APPLICATION_SERVER_NAME>.

    The <APPLICATION_SERVER_NAME> variable is one of the following application servers:

    • websphere85 forWebSphere® Application Server 8.5 or 8.5.5
    • weblogic12 for WebLogic Server 12
    • tomcat7 for Tomcat 7
    Tip: To open the Samples Commands view, you can click the View sample commands link in the Samples and Tutorials view.
  2. Double-click the run command to run it.

    This command has the following effects:

    1. Creates the connection to the server.
    2. Retrieves the server information.
    3. Deploys the samples/jmxremote/data/JmxRuleappSample.jar RuleApp archive on Rule Execution Server.

      The deployed RuleApp archive contains two rulesets with two properties:

      • effectiveDate: The ruleset effective date.
      • expirationDate: The ruleset expiration date.

      In the code sample, the method checkStatusDate enables the ruleset status if [effective date] < current date < [expiration date]

    4. Displays the content of the JmxRuleappSample RuleApp.
  3. Run the displayruleapp command to display the contents of the RuleApp in the Rule Execution Server console.

Rebuilding this sample

To rebuild this sample:

  1. Make sure that you are in the Samples Console perspective.
  2. In the Samples Commands view, go to Samples Commands > Rule Execution Server > Automated ruleset management > <APPLICATION_SERVER_NAME>.
    Tip: To open the Samples Commands view, you can click the View sample commands link in the Samples and Tutorials view.

    The <APPLICATION_SERVER_NAME> variable is one of the following application servers:

    • websphere85 for WebSphere Application Server 8.5 or 8.5.5
    • weblogic12 for WebLogic Server 12
    • tomcat7 for Tomcat 7
  3. Run the build command to build the Java™ client classes.

How this sample works

The Rule Execution Server JMX infrastructure provides a standard way to deploy, manage, and monitor the execution resources of the Rule Execution Server. The various MBeans of the Rule Execution Server model are the runtime proxies on each entity of the Rule Execution Server model.

The following diagram illustrates the infrastructure of the management model.

Infrastructure of the management mode

Source files

You can find this sample in <InstallDir>/executionserver/samples/jmxremote/src/jmxremote.

You can also view and modify the sample source files in Rule Designer.

To import the sample into your workspace:

  1. Click Import projects in the Samples and Tutorials view, under Rule Execution Server/Automated ruleset management.
  2. Switch to the Java perspective.