Class DrlHeaderCustomRuleDecorator

java.lang.Object
ch.tocco.nice2.optional.drools.api.util.DrlHeaderCustomRuleDecorator
All Implemented Interfaces:
CustomRuleDecorator

public class DrlHeaderCustomRuleDecorator extends Object implements CustomRuleDecorator
A custom rule decorator that optionally prepends a package statement and a header to a given rule.
  • Constructor Details

  • Method Details

    • decorate

      public org.kie.api.io.Resource decorate(org.kie.api.io.Resource resource, RuleSource source, String packageName) throws IOException
      Description copied from interface: CustomRuleDecorator
      Decorate a custom rule.
      Specified by:
      decorate in interface CustomRuleDecorator
      Parameters:
      resource - The Drools `Resource` that is being loaded.
      source - The RuleSource the rules are being loaded from.
      packageName - A package name to be used for the rules.
      Returns:
      A Drools `Resource` for the decorated custom rules.
      Throws:
      IOException - If an I/O error occurs.