Custom rule basic coding requirements

Here are some basic custom rule coding requirements:

  • The class for rules must extend com.workbrain2.ta.publ.api.RuleScriptable. The rule code example in this section will illustrate this requirement.
  • Static methods, static fields and static code blocks are not permitted. If a static method, field or code block is defined in the script and executed, an exception will be thrown. Static methods, fields and code blocks can also lead to performance issues.
  • The script must contain an execute() method.
  • The class for rules should use only methods and fields that are available in the WFM Java API. You can refer to the published Javadoc for more information. See Accessing the WFM Java API Javadoc.
  • All methods/properties written in custom scripts cannot be private.
  • For custom rules that accept parameters, the method getParameterInfo() must be created in addition to creating configuration screens for the parameters. Please see the code example in Custom rule code example for an example of how this is done.