Translating business rules to IRL using the API

You can translate business rules into IRL using the API.

About this task

Deprecated feature:

Deprecation icon Support for custom business rule languages is deprecated in V8.8.1. This feature will be removed in a future release of the product. See Deprecated features for migration details.

Translate business rules into IRL using the API.

Procedure

To translate business rules into IRL by code:

  1. Get an instance of IlrTranslatorInput. You can also use an instance of IlrBRLRuleTranslatorInput.
    IlrTranslatorInput translatorInput = ...;
  2. Create an instance of IlrBRLTranslator using an IlrIRLCodeGenerator and an IlrBOMTranslationSupport.
    IlrBRLTranslator translator = new IlrBRLTranslator(new    
    IlrIRLCodeGenerator(), new IlrBOMTranslationSupport());
  3. Set the translator input.
    translator.setTranslatorInput(translatorInput);
  4. Create a java.io.Writer to receive the translation, and call the method printTranslation() using this writer.
    Writer writer = new StringWriter();
    translator.printTranslation(writer);