Testing and debugging policies

After you develop custom policies, you can test and debug the policies.

Before you begin

Develop a custom policy.

Procedure

  1. In your development environment, open the debugger window by clicking Run > Debug Configurations.
  2. Create a configuration for a remote Java application.
  3. Select your policy project.
  4. Enter the host name and debug port number of your server. The default port is 7777.
  5. Click Apply.
  6. To debug, set a breakpoint in your class where you want to debug. Most of the methods in a policy are called when the policy is added to a process. The test() method is called when the policy is run for operations such as submit, update, state entrance, and timer.
  7. During debugging, you might need to change your governor policy. To do so, export your Java project as a JAR file again, and on the Extensions page, update your existing extension. You do not need to restart your server for these changes to take effect.
    Note: Instead of deleting your governor policy and adding a new one, update the policy. When you delete an existing extension, it is removed from lifecycles and policy processes, even if the extension is recreated, and you must reconfigure your processes.

Feedback