Menu

Problem in UI end while trying to use method table

Help
2023-02-23
2023-02-24
  • MANAS HALDER

    MANAS HALDER - 2023-02-23

    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.!

     
  • Elena Kosolapova

    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

     
  • MANAS HALDER

    MANAS HALDER - 2023-02-23

    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.

     
  • Elena Kosolapova

    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.

     
  • MANAS HALDER

    MANAS HALDER - 2023-02-24

    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!

     

Log in to post a comment.