How do you allow your users to create decision tables on the web? In couple of earlier posts, we talked about a FlexRule Server that allows you to manage and execute your business rules (e.g., Decision Table) with a REST API. And as part of that we introduced a visual Decision Table editor. Here is more good news – you can use this free Decision Table web component in your web application directly and enable business rules entry in both freestyle and guided mode.

JavaScript Web Component for Decision Table

In the HTML page header, register the Decision Table Web Component script and CSS:
HTML-HEADER-DT

Simply add the following element to your HTML:
HTML-DOM-DT

And at the end of your page use jQuery:
JS-DT-Load

And that's it! you have an interactive Decision Table on your webpage.
DT-WEB-JQUERY

Interactive

Well we said interactive, but what does that mean?
You can re-arrange the order of conditions and actions in your decision table (columns)
DT-WEB-COL-Move

You can also re-order the rules (the rows in decision table):
DT-WEB-ROW-Move

Also, it loads a Business Glossary so it can give you options to select for your business rules:
DT-WEB-Options

And of course you can have freestyle business rule entry as well:
DT-WEB-free-style

API

  1. Load a Decision Table for business rule entry
  2. Allows you to:
    • Add new row
    • delete a row
    • delete a column
  3. Generates the Decision Table model from users’ interactions
  4. Loads the Business Glossary and allows the user to select options from that glossary
  5. Allows you to change order of:
    • conditions and actions (columns)
    • rules (rows)
  6. Queries the Decision Table to list all the referenced Glossaries
  7. Queries the Decision Table to retrieve settings: columns, decision name, etc.

More Web Components

This is just one of the few web components we provide. To find out more about the others, please visit https://www.flexrule.com/javascript

Free Download

Please feel free to download FlexRule Designer Installer. Once you have installed it in the Samples folder there is a project called “WebEditors\WebSample.sln” which has a sample Website using pure HTML and JavaScript. Open it to find a sample HTML file (index.html). Have a look at that and you will know what to do next!

To learn more details about the API visit https://resource.flexrule.com/knowledge-base/decision-table-editor/

Last updated April 3rd, 2023 at 11:51 am, Published December 7th, 2015 at 11:51 am