Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Go to Profile > Project Mapping > Rules

  2. Press Create rule to create a new rule

    Image RemovedImage Added
  3. Once created, press the Edit (Cog Icon) Button.

    Image RemovedImage Added
  4. Once in the Rule configuration press the Edit button to configure a Rule.

    Image RemovedImage Added
  5. Now Press Script Configuration

    Image RemovedImage Added
  6. Once press you will now see the configuration for the Script Rule.

    Image Added
  7. Once the Script has been configured, you will then need to go to Rule Configuration and press Active as this will result in the Rule being enabled.

    Image Removed

Testing Script Rule

...

  1. Image Added

Testing Script Rule

  1. Once the Script has been added, Select a Test Case.

  2. Press Run

    Image Added
  3. Once processed there will be an output of the Results. Allowing you to review if the correct outcome has occurred. For example below.

    Image Added

Results Output

Within the Results output there is 3 sections. These sections are:

  1. Success or Error - This is used to define if the Script was able to be processed correctly or if there was an error with the script. This section also defines if the Test Case was a match or not.

    Image Added
  2. Script Output - This is where the Print values are output, allowing for additional information to be displayed. e.g. using print("Sender is correct: " + message.getHeader('from'));

    Image Added
  3. Script Evaluation Time Metrics - Used to identify how long it took to evaluate the script against the selected Test Case.

    Image Added

How to Rule as a Match

In order for the Rule to be seen as a match you will need to ensure that the Script defines that there was a match. This is done by using the following line within the Script.

Code Block
setMatch(true)

For example, the condition below will only set the rule as a match if the sender is “ryan@thepluginpeople.com”.

Code Block
if (message.getHeader('from') == "ryan@thepluginpeople.com")
{
    print("Sender is correct: " + message.getHeader('from'));
    setMatch(true);
}

Script Examples

See the following page for some example use cases: Use Script Rule