Automated ruleset management sample details

You use the Samples Console to run this sample.

Running this sample

You run commands in the Samples Commands view. Go to Samples Commands > Rule Execution Server > Automated ruleset management > <APPLICATION_SERVER_NAME>. For <APPLICATION_SERVER_NAME>, you select one of the following application servers:
  • Unset for the sample server (direct command in Samples Commands > Rule Execution Server > Automated ruleset management)
  • websphere85 forWebSphere® Application Server 8.5 or 8.5.5
  • weblogic12 for WebLogic Server 12
  • tomcat for Tomcat
Tip: To open the Samples Commands view, click the View sample commands link in the Samples and Tutorials view.

To run this sample:

  1. Double-click the build command to build the sample classes.
  2. Double-click the run command.

    This command does the following operations:

    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 that have 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, 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
    • tomcat for Tomcat
  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 features are enabled in the Liberty sample server configuration file, which you can find at <InstallDir>/shared/samplesServer/wlp/server.xml:

  • restConnector-2.0
  • localConnector-1.0

The following diagram illustrates the infrastructure of the management model.

Image shows the 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, underRule Execution Server > Automated ruleset management.
  2. Switch to the Java perspective.