Hello Openl Tablets,
I stuck on a project where I have to take input from UI end and then this input will go to a service which is written in Java code and also a rule written in spreadsheet. But I got an error while doing this. kindly help me to solve it. I am attaching a picture of the error. Feel free to reply whatever other information you need.
Thank you from India.!
Hello,
For each datatype table OpenL Tablets generates a java class bytecode at runtime. All generated classes are written to the generated sources folder during maven build with openl-maven-plugin.
I share you some code with you how to build a maven artifact with generated openl datatype classes for use them as dependency in Maven:
Add following lines to your pom.xml file with openl rules, if you have already maven-assembly-plugin add only execution with id datatypes-jar:
<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-assembly-plugin</artifactid>
<executions>
<execution>
<id>zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/runnable-zip.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>datatypes-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/datatypes-jar.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
Create assembly\datatypes-jar.xml with following content:
<assembly>
<id>datatypes</id>
<formats>
<format>jar</format>
</formats>
<includebasedirectory>false</includebasedirectory>
<filesets>
<fileset>
<directory>target/classes</directory>
<outputdirectory>/</outputdirectory>
</fileset>
</filesets>
</assembly>
Build a project to register a new artifact with openl generated classes. Now you can add them to any maven project like this:
<dependency>
<groupid>org.openl.rules.example</groupid>
<artifactid>rules-example2</artifactid>
<version>1.0-SNAPSHOT</version>
<classifier>datatypes</classifier> /// This is a classifier, read more in Maven documentation
</dependency>
Additional if you change <packaging>openl</packaging> to <packaging>openl-jar</packaging> build will generate jar and it can be used without assemble plugin in another Maven modules.
Best Regards,
Elena Kosolapova
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, would it be possible for you to provide an peace of example that we could run locally? It would also be helpful if you could explain in detail what you are trying to achieve.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, possible.
It is my heartiest request to you to kindly go to below link on Github openl discussion where I post the problem and codes from there you can take the codes from google drive: https://github.com/openl-tablets/openl-tablets/discussion/857
Kindly if you found solution, please provide me it is very much important for my project.
Thank you on advance from India!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Openl Tablets,
I stuck on a project where I have to take input from UI end and then this input will go to a service which is written in Java code and also a rule written in spreadsheet. But I got an error while doing this. kindly help me to solve it. I am attaching a picture of the error. Feel free to reply whatever other information you need.
Thank you from India.!
Hello,
For each datatype table OpenL Tablets generates a java class bytecode at runtime. All generated classes are written to the generated sources folder during maven build with openl-maven-plugin.
I share you some code with you how to build a maven artifact with generated openl datatype classes for use them as dependency in Maven:
Add following lines to your pom.xml file with openl rules, if you have already maven-assembly-plugin add only execution with id datatypes-jar:
<plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-assembly-plugin</artifactid>
<executions>
<execution>
<id>zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/runnable-zip.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>datatypes-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/datatypes-jar.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
Create assembly\datatypes-jar.xml with following content:
<assembly>
<id>datatypes</id>
<formats>
<format>jar</format>
</formats>
<includebasedirectory>false</includebasedirectory>
<filesets>
<fileset>
<directory>target/classes</directory>
<outputdirectory>/</outputdirectory>
</fileset>
</filesets>
</assembly>
Build a project to register a new artifact with openl generated classes. Now you can add them to any maven project like this:
<dependency>
<groupid>org.openl.rules.example</groupid>
<artifactid>rules-example2</artifactid>
<version>1.0-SNAPSHOT</version>
<classifier>datatypes</classifier> /// This is a classifier, read more in Maven documentation
</dependency>
Additional if you change <packaging>openl</packaging> to <packaging>openl-jar</packaging> build will generate jar and it can be used without assemble plugin in another Maven modules.
Best Regards,
Elena Kosolapova
No but this solution does not match with requirement. I need to access the rules table from the UI end and then I have to show the results to UI end.
Hello, would it be possible for you to provide an peace of example that we could run locally? It would also be helpful if you could explain in detail what you are trying to achieve.
Thank you.
Yes, possible.
It is my heartiest request to you to kindly go to below link on Github openl discussion where I post the problem and codes from there you can take the codes from google drive:
https://github.com/openl-tablets/openl-tablets/discussion/857
Kindly if you found solution, please provide me it is very much important for my project.
Thank you on advance from India!