Populating Decision Tables with external data sources
One of the most used artifacts in IBM ODM is the decision table. In this post I will show how to populate your Decision Table in the Rule Designer with external data sources like a .txt file or an excel spreadsheet. Business users can have their logic in multiple sources (mostly in Excel files), that they need to dump in a decision table to create rules and business logic behavior in IBM ODM. We are going to achieve this by using a combination of Java, Ant builds and ilog rule designer-plug ins embedded in our suite. This is a very technical tutorial and it might be a little difficult to get it done quickly but feel free to contact me with any problems or if you get stuck at some point.
- Setting up environment
- Create a new folder (in my case “dt-populate”) in your Rule project with a “data” subfolder and with an Ant Build file.
- Tip: You can also create and manage the ant and data configuration in a new external Java project.
- Create an environment variable ECLIPSE_HOME with the location of your IBM ODM installation.
- Insert the txt or the excel file with the data you want to import in the data folder. In my example I am using both, please have this considerations:
- Creating the Ant Build file
- Add the project tag with a name, basedir and a default target attributes.
- Tip: For more about Ant Tasks review my previous post here.
- Inside the project tag we are going to add the properties, conditions, echo messages, definitions and our targets. For each of you will be different depending in your environment and ODM installation.
- Tip: Remember to change the values according to your workspace and installation folders.
- Now let’s add the definitions the includes the properties and connection parameters.
- Finally, we add the targets.
- Remember to change the values according to your environment and also review the excel file extension.
- Running the Ant build file targets
Now you can refresh and open your Decision Table and visualize all the values!
I hope you enjoy this tutorial, there are many more automation and integration to be done with Ant Tasks, please let me know what you wish to see next, and as always feel free to comment or contact me with any feedback or support! Thank you!
- Published in Ant Tasks, Decision Table, Java, Rule Authoring, Rule Designer
Automating deployments with Ant tasks
To deploy RuleApps to Rule Execution Server, automate managerial tasks within Decision Center, and run many of the samples, you must have Ant installed on your computer. IBM ODM comes with Ant in the <InstallDir>/shared/tools/ant path. In this tutorial I will show how to use Ant tasks to automate RuleApp management tasks, including reading a specified RuleApp archive from the RES console, create a well-formed RuleApp archive with all its mandatory execution resources and deploy a RuleApp archive to a running Rule Execution Server instance.
First of all we need to set up our environment to automate processes, please follow the steps in this link.
- Downloading RuleApp instances from RES
- Create an Ant Build file, you can this directly in your Rule project in Eclipse:
- Define your project and property variables values.
- Tip: You can define properties for your common values like hostname, destfile, userid and password.
- Please find the next sample as a demonstration of a working Ant build file:
- The target res-fetch command extracts a specific Ruleapp value, the res-fetch-all will generate a .war file with all the Ruleapps present in the RES
- Deploying into RES with Ant Tasks
- Now that we have our jar file ready, we can automate the deployments with Ant Tasks by using the res-deploy command.
- You will need to add a new target to your build ant file or create a new one, this command requires the login credentials, jar path and hostname.
- Please refer to the following example:
After running our deploy command we see our Ruleapp deployed in the RES:
There are many more automation and integration to be done with Ant Tasks, please let me know what you wish to see next, and as always feel free to comment or contact me with any feedback or support! Thank you!
- Published in Ant Tasks, Rule Authoring, Rule Designer, Rule Execution Server (RES)