openl:generate

Full name:

org.openl.rules:openl-maven-plugin:5.23.0:generate

Description:

Generate OpenL interface, domain classes, project descriptor and unit tests

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: generate-sources.

Required Parameters

Name Type Since Description
<workspaceFolder> File - Directory containing the generated artifact.
Default value is: ${project.build.directory}/openl-workspace.

Optional Parameters

Name Type Since Description
<classpaths> String[] - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
<createProjectDescriptor> boolean - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default value is: true.
<externalParameters> Map - If you want to override some parameters, define them here.
<generateInterfaces> GenerateInterface[] - Deprecated. Obsolete. Replaced with the smart generator. Use interfaceClass instead.
<generateSpreadsheetResultBeans> boolean 5.23.0 Generate custom spreadsheet result bean classes
<interfaceClass> String 5.19.1 A generated Java interface from an OpenL project. If it is empty then generation will be skipped.
<isProvideRuntimeContext> boolean 5.19.1 Add IRulesRuntimeContext arguments to the generated interface.
<isProvideVariations> boolean 5.19.1 Add additional methods to the generated interface to support variations.
<outputDirectory> File - An output directory of generated Java beans and OpenL java interface.
Default value is: ${project.build.directory}/generated-sources/openl.
<overwriteProjectDescriptor> boolean - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default value is: true.
<projectName> String - Deprecated. Obsolete. No needs to generate rules.xml from Maven.
<sourceDirectory> File 5.19.0 Folder that contains all OpenL-related resources (OpenL rules, project descriptor etc.). For example: "${project.basedir}/src/main/openl".
Default value is: ${project.build.sourceDirectory}/../openl.
<superInterface> String 5.19.1 Comma-separated list of interfaces which are used for extending of the generated interface.

Parameter Details

<classpaths>

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default classpath entries in rules.xml. Default value is {"."} Used only if createProjectDescriptor == true.
  • Type: java.lang.String[]
  • Required: No

<createProjectDescriptor>

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
If true, rules.xml will be generated if it does not exist. If false, rules.xml will not be generated. Default value is "true".
  • Type: boolean
  • Required: No
  • Default: true

<externalParameters>

If you want to override some parameters, define them here.
  • Type: java.util.Map
  • Required: No

<generateInterfaces>

Deprecated. Obsolete. Replaced with the smart generator. Use interfaceClass instead.
Tasks that will generate classes or data type.

Object Properties

Name Type Required Description
srcFile String false *Reference to the Excel file for which an interface class must be generated.
targetClass String false *Full name of the interface class to be generated. Optional; if missed interface not generated. OpenL Tablets WebStudio recognizes modules in projects by interface classes and uses their names in the user interface. If there are multiple wrappers with identical names, only one of them is recognized as a module in OpenL Tablets WebStudio.
isUsedRuleXmlForGenerate boolean (true/false) false *Should system generate class and datatypes from rules.xml. If yes srcFile ignored; targetClass is required.
displayName String false *End user oriented title of the file that appears in OpenL Tablets WebStudio. Default value is Excel file name without extension.
targetSrcDir String false *Folder where the generated interface class must be placed. For example: "src/main/java". Default value is: "${project.build.sourceDirectory}"
openlName String false *OpenL configuration to be used. For OpenL Tablets, the following value must always be used: org.openl.xls. Default value is: "org.openl.xls"
userHome String false *Location of user-defined resources relative to the current OpenL Tablets project. Default value is: "."
userClassPath String false *Reference to the folder with additional compiled classes imported by the module when the interface is generated. Default value is: null.
ignoreTestMethods boolean false *If true, test methods will not be added to interface class. Used only in GenerateInterface. Default value is: true.
generateDataType boolean false *Generate or not dataType for current task.
  • Type: org.openl.rules.maven.gen.GenerateInterface[]
  • Required: No

<generateSpreadsheetResultBeans>

Generate custom spreadsheet result bean classes
  • Type: boolean
  • Since: 5.23.0
  • Required: No

<interfaceClass>

A generated Java interface from an OpenL project. If it is empty then generation will be skipped.
  • Type: java.lang.String
  • Since: 5.19.1
  • Required: No

<isProvideRuntimeContext>

Add IRulesRuntimeContext arguments to the generated interface.
  • Type: boolean
  • Since: 5.19.1
  • Required: No

<isProvideVariations>

Add additional methods to the generated interface to support variations.
  • Type: boolean
  • Since: 5.19.1
  • Required: No

<outputDirectory>

An output directory of generated Java beans and OpenL java interface.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/openl

<overwriteProjectDescriptor>

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
If true, rules.xml will be overwritten on each run. If false, rules.xml generation will be skipped if it exists. Makes sense only if createProjectDescriptor == true. Default value is "true".
  • Type: boolean
  • Required: No
  • Default: true

<projectName>

Deprecated. Obsolete. No needs to generate rules.xml from Maven.
Default project name in rules.xml. If omitted, the name of the first module in the project is used. Used only if createProjectDescriptor == true.
  • Type: java.lang.String
  • Required: No

<sourceDirectory>

Folder that contains all OpenL-related resources (OpenL rules, project descriptor etc.). For example: "${project.basedir}/src/main/openl".
  • Type: java.io.File
  • Since: 5.19.0
  • Required: No
  • Default: ${project.build.sourceDirectory}/../openl

<superInterface>

Comma-separated list of interfaces which are used for extending of the generated interface.
  • Type: java.lang.String
  • Since: 5.19.1
  • Required: No

<workspaceFolder>

Directory containing the generated artifact.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/openl-workspace