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.
Steps:
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:
Results:
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!
Hi Angello,
First of all thank you so much for sharing your knowledge.And,I did the same process as you but when i try to run the build.xml file through ant then i got the following error.
Buildfile: C:\Program Files\IBM\ODM88\studio\tutorials\decisionservice\answer\Loan Validation Service\resources\ant\build.xml
BUILD FAILED
C:\Program Files\IBM\ODM88\studio\tutorials\decisionservice\answer\Loan Validation Service\resources\ant\build.xml:3: Cannot find C:\Program Files\IBM\ODM88\studio\tutorials\decisionservice\answer\Loan Validation Service\resources\ant\${executionserver.home}\lib\classpath-executionserver.xml imported from C:\Program Files\IBM\ODM88\studio\tutorials\decisionservice\answer\Loan Validation Service\resources\ant\build.xml
Total time: 480 milliseconds
Can you please dig in to that and let me know if you get any root-cause.
Thank You,
Mastan
Hi Mastan, looks like there is a problem with your IBM ODM installation. Did you have any errors after starting the sample server?