{"id":3784,"date":"2025-12-24T10:00:24","date_gmt":"2025-12-24T15:00:24","guid":{"rendered":"https:\/\/www.mymiller.name\/wordpress\/?p=3784"},"modified":"2025-12-24T10:00:24","modified_gmt":"2025-12-24T15:00:24","slug":"integrating-openl-tablets-with-a-spring-boot-microservice","status":"publish","type":"post","link":"https:\/\/www.mymiller.name\/wordpress\/spring_ai\/integrating-openl-tablets-with-a-spring-boot-microservice\/","title":{"rendered":"Integrating OpenL Tablets with a Spring Boot Microservice"},"content":{"rendered":"\n<p>This post explains how to integrate OpenL Tablets with your Spring Boot microservice. We&#8217;ll cover adding the necessary dependencies, configuring OpenL Tablets, and creating a service to use it.<\/p>\n\n\n\n<p><strong>1. Project Setup and Dependencies<\/strong><\/p>\n\n\n\n<p>Begin by creating a Spring Boot project. Then, add the following OpenL Tablets dependencies to your <code>pom.xml<\/code> (Maven) or <code>build.gradle<\/code> (Gradle) file:<\/p>\n\n\n\n<p><strong>Maven:<\/strong><\/p>\n\n\n\n<p>XML<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;dependency&gt;\n    &lt;groupId&gt;org.openl.rules&lt;\/groupId&gt;\n    &lt;artifactId&gt;org.openl.rules.ruleservice&lt;\/artifactId&gt;\n    &lt;version&gt;5.27.8&lt;\/version&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.openl.rules&lt;\/groupId&gt;\n    &lt;artifactId&gt;org.openl.rules.ruleservice.spring&lt;\/artifactId&gt;\n    &lt;version&gt;5.27.8&lt;\/version&gt;\n&lt;\/dependency&gt;\n<\/code><\/pre>\n\n\n\n<p><strong>Gradle:<\/strong><\/p>\n\n\n\n<p>Gradle<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>implementation 'org.openl.rules:org.openl.rules.ruleservice:5.27.8'\nimplementation 'org.openl.rules:org.openl.rules.ruleservice.spring:5.27.8'\n<\/code><\/pre>\n\n\n\n<p><strong>2. OpenL Tablets Configuration<\/strong><\/p>\n\n\n\n<p>Create a configuration class to set up OpenL Tablets. This class will define a bean for <code>org.openl.rules.ruleservice.loader.RulesLoader<\/code> and configure the location of your Excel spreadsheet rules.<\/p>\n\n\n\n<p>Java<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import org.openl.rules.ruleservice.loader.JcrRulesLoader;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\npublic class OpenLTabletsConfig {\n\n    @Bean\n    public JcrRulesLoader rulesLoader() {\n        JcrRulesLoader rulesLoader = new JcrRulesLoader();\n        rulesLoader.setWorkspace(\"default\"); \/\/ Your JCR workspace\n        rulesLoader.setRulesLocation(\"\/rules\"); \/\/ Location of your rules in the workspace\n        return rulesLoader;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>This configuration:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creates a <code>JcrRulesLoader<\/code> which loads rules from a JCR repository.<\/li>\n\n\n\n<li>Sets the <code>workspace<\/code> and <code>rulesLocation<\/code> properties to specify where your rule files are located. You&#8217;ll likely need to adjust these based on your setup.<\/li>\n<\/ul>\n\n\n\n<p><strong>3. Create OpenL Tablets Rule Files<\/strong><\/p>\n\n\n\n<p>Create an Excel spreadsheet with your rules defined in OpenL Tablets format. For example, <code>discount.xlsx<\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Condition<\/th><th>Discount<\/th><\/tr><tr><td>total price &gt; 100<\/td><td>0.1<\/td><\/tr><tr><td>total price &gt; 50<\/td><td>0.05<\/td><\/tr><tr><td>otherwise<\/td><td>0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This simple table defines discount rules based on the total price of an order.<\/p>\n\n\n\n<p><strong>4. Deploying Rule Files<\/strong><\/p>\n\n\n\n<p>You need to deploy your Excel spreadsheet rule files to your JCR repository (e.g., Jackrabbit). The specific deployment process will depend on your JCR repository setup.<\/p>\n\n\n\n<p><strong>5. Using OpenL Tablets in a Service<\/strong><\/p>\n\n\n\n<p>Inject the <code>RulesLoader<\/code> bean and use <code>org.openl.rules.ruleservice.RuleService<\/code> to execute rules against your domain objects.<\/p>\n\n\n\n<p>Java<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import org.openl.rules.ruleservice.RuleService;\nimport org.openl.rules.ruleservice.loader.RulesLoader;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class OrderService {\n\n    @Autowired\n    private RuleService ruleService;\n\n    @Autowired\n    private RulesLoader rulesLoader;\n\n    public Order applyRules(Order order) throws Exception {\n        \/\/ Make sure the rules are loaded\n        rulesLoader.reload();\n\n        \/\/ Execute the rule\n        Object result = ruleService.execute(\"discount\", \"getDiscount\", new Object&#91;] { order }); \n\n        \/\/ Assuming the rule returns a double representing the discount\n        order.applyDiscount((Double) result); \n        return order;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>This service:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Injects the <code>RuleService<\/code> and <code>RulesLoader<\/code>.<\/li>\n\n\n\n<li>Calls <code>rulesLoader.reload()<\/code> to ensure the latest rules are loaded.<\/li>\n\n\n\n<li>Executes the <code>getDiscount<\/code> method from the <code>discount<\/code> rule file (your Excel spreadsheet).<\/li>\n\n\n\n<li>Applies the returned discount to the order.<\/li>\n<\/ul>\n\n\n\n<p><strong>6. YML Configuration (Optional)<\/strong><\/p>\n\n\n\n<p>You might need to configure your JCR repository connection details in your <code>application.yml<\/code> or <code>application.properties<\/code> file.<\/p>\n\n\n\n<p>This guide provides a basic framework for integrating OpenL Tablets with your Spring Boot microservice. You can expand on this by exploring more advanced OpenL Tablets features and integrating them with your business logic. Remember to adapt the rules and domain models to your specific requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post explains how to integrate OpenL Tablets with your Spring Boot microservice. We&#8217;ll cover adding the necessary dependencies, configuring OpenL Tablets, and creating a service to use it. 1. Project Setup and Dependencies Begin by creating a Spring Boot project. Then, add the following OpenL Tablets dependencies to your pom.xml (Maven) or build.gradle (Gradle) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3794,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[443],"tags":[],"series":[],"class_list":["post-3784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring_ai"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/business-1754904_1280-jpg.avif","jetpack-related-posts":[{"id":3444,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_discovery\/spring-boot-admin-server-with-spring-cloud-discovery\/","url_meta":{"origin":3784,"position":0},"title":"Spring Boot Admin Server with Spring Cloud Discovery","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"Spring Boot Admin Server is a powerful tool for monitoring and managing Spring Boot applications. It provides a centralized dashboard for viewing application health, metrics, and logs. Spring Cloud Discovery, on the other hand, enables service registration and discovery for microservices-based applications. By integrating Spring Boot Admin Server with Spring\u2026","rel":"","context":"In &quot;Spring Discovery&quot;","block_context":{"text":"Spring Discovery","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_discovery\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/11\/manhattan-3866140_640.jpg?fit=640%2C427&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/11\/manhattan-3866140_640.jpg?fit=640%2C427&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/11\/manhattan-3866140_640.jpg?fit=640%2C427&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3786,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_ai\/integrating-easy-rules-with-a-spring-boot-microservice\/","url_meta":{"origin":3784,"position":1},"title":"Integrating Easy Rules with a Spring Boot Microservice","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"This post will walk you through integrating the lightweight and straightforward Easy Rules engine with your Spring Boot microservice. We'll cover the necessary dependencies, basic setup, and an example service to demonstrate its usage. 1. Project Setup and Dependencies Start by creating a Spring Boot project. Next, add the following\u2026","rel":"","context":"In &quot;Spring AI&quot;","block_context":{"text":"Spring AI","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_ai\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/office-4249395_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/office-4249395_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/office-4249395_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/office-4249395_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/office-4249395_1280-jpg.avif 3x"},"classes":[]},{"id":3441,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_discovery\/spring-cloud-gateway-with-spring-cloud-discovery\/","url_meta":{"origin":3784,"position":2},"title":"Spring Cloud Gateway with Spring Cloud Discovery","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"Spring Cloud Gateway and Spring Cloud Discovery are powerful tools for building microservices architectures. Spring Cloud Gateway acts as an API gateway, routing requests to the appropriate microservices. Spring Cloud Discovery provides a registry for microservices, enabling dynamic service discovery and load balancing. In this comprehensive guide, we'll delve into\u2026","rel":"","context":"In &quot;Spring Discovery&quot;","block_context":{"text":"Spring Discovery","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_discovery\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/11\/trees-2900064_640.jpg?fit=640%2C427&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/11\/trees-2900064_640.jpg?fit=640%2C427&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/11\/trees-2900064_640.jpg?fit=640%2C427&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3744,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_config\/3744\/","url_meta":{"origin":3784,"position":3},"title":"Spring Cloud Config: Choosing the Right Backend Storage","author":"Jeffery Miller","date":"December 23, 2025","format":false,"excerpt":"Spring Cloud Config offers a flexible way to manage your application\u2019s configuration. A crucial step is selecting the right backend to store your configuration data. Let\u2019s explore popular options, their pros and cons, configuration details, and the necessary dependencies for Maven and Gradle. 1. Git Pros: Version Control: Leverage Git\u2019s\u2026","rel":"","context":"In &quot;Spring Config&quot;","block_context":{"text":"Spring Config","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_config\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/04\/woman-8696271_640.jpg?fit=438%2C640&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3782,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_ai\/integrating-rulebook-with-a-spring-boot-microservice\/","url_meta":{"origin":3784,"position":4},"title":"Integrating RuleBook with a Spring Boot Microservice","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"This post guides you through integrating the RuleBook rule engine with your Spring Boot microservice. We\u2019ll cover adding the dependency, configuring RuleBook, and creating a service to utilize it. 1. Project Setup and Dependency Start by creating a Spring Boot project. Next, add the RuleBook dependency to your pom.xml (Maven)\u2026","rel":"","context":"In &quot;Spring AI&quot;","block_context":{"text":"Spring AI","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_ai\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/board-3772063_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/board-3772063_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/board-3772063_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/board-3772063_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/board-3772063_1280-jpg.avif 3x"},"classes":[]},{"id":3780,"url":"https:\/\/www.mymiller.name\/wordpress\/spring_ai\/integrating-jess-with-a-spring-boot-microservice\/","url_meta":{"origin":3784,"position":5},"title":"Integrating Jess with a Spring Boot Microservice","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"This post explores how to integrate the Jess rule engine with your Spring Boot microservice. We\u2019ll cover adding the necessary dependency, configuring Jess, and creating a service to utilize it. 1. Project Setup and Dependency Begin by creating a Spring Boot project. Then, add the Jess dependency to your pom.xml\u2026","rel":"","context":"In &quot;Spring AI&quot;","block_context":{"text":"Spring AI","link":"https:\/\/www.mymiller.name\/wordpress\/category\/spring_ai\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/rule-1752536_1280-png.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/rule-1752536_1280-png.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/rule-1752536_1280-png.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/rule-1752536_1280-png.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/rule-1752536_1280-png.avif 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/comments?post=3784"}],"version-history":[{"count":1,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3784\/revisions"}],"predecessor-version":[{"id":3785,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3784\/revisions\/3785"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media\/3794"}],"wp:attachment":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media?parent=3784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/categories?post=3784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/tags?post=3784"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/series?post=3784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}