API mappings for Ant tasks

Ant is a build tool that is based on Java™. To use the Ant tasks in an Ant project file, you must declare the class path and the mapping between Java classes and task keywords. To do so, you use the taskdef Ant task.

You can find the res-tasks.properties file in the <InstallDir>/executionserver/lib/jrules-res-tools.jar. The following table shows how the res-tasks.properties file maps task keywords to Java classes.

Rule Execution Server has its own lib directory. You must define the following paths:
  • executionserver.home before classpath-executionserver.xml is imported. The executionserver.home value is InstallDir/executionserver.
  • engine.lib.dir for classpath-engine.xml. The engine.lib.dir value is InstallDir>/executionserver/lib.
The following code sample shows how to define Rule Execution Server Ant tasks, including the taskdef task.
<?xml version="1.0"?>
<project name="res-test">
   <property name="executionserver.home" value="<InstallDir>/executionserver"/>
   <import file="${executionserver.home}/lib/classpath-executionserver.xml"/>

   <!-- Defining Ant tasks -->
   <taskdef resource="res-tasks.properties">
     <classpath refid="executionserver.tools.classpath"/>
   </taskdef>

   <target name="all">
      <res-jar ... />
      <res-migrate-file ... />
      <res-deploy ... />
      <res-undeploy ... />
      <res-fetch ... />
      <res-fetch-all ... />
      <res-write-file ... />
      <res-write-db ... />
      <res-delete-file ... />
      <res-delete-db ... />
   </target>
</project>

Communication between Ant tasks and Rule Execution Server supports the HTTP and HTTPS communication protocols. You can customize the communication to support nontrusted certificates in secure mode or to support custom protocols.

The following table shows with what Java class each Ant task keyword is associated.

Table 1. Mappings between Java classes and Ant task keywords
Ant task Description Java class
res-delete-db Removes a RuleApp archive from the database persistence layer of Rule Execution Server. ilog.rules.res.tools.persistence.IlrDeleteDbTask
res-delete-file Removes a RuleApp archive from the file persistence layer of Rule Execution Server ilog.rules.res.tools.persistence.IlrDeleteFileTask
res-delete-xom-db Removes XOM, JAR, ZIP, or Java resources, and/or a library, from the database persistence of Rule Execution Server. com.ibm.rules.res.tools.ant.xom.DeleteXOMDbTask
res-delete-xom-file Removes XOM, JAR, ZIP, or Java resources, and/or a library, from the file persistence of Rule Execution Server. com.ibm.rules.res.tools.ant.xom.DeleteXOMFileTask
res-deploy Deploys a RuleApp archive to a running Rule Execution Server instance. ilog.rules.res.tools.remote.http.IlrDeployRuleAppTask
res-deploy-xom Deploys a set of XOM, JAR, ZIP, or Java resources to a running Rule Execution Server instance. com.ibm.rules.res.tools.ant.xom.DeployXOMTask
res-diagnose-xom-uri Returns diagnostics results of the passed URI, read from the Rule Execution Server instance. com.ibm.rules.res.tools.ant.xom.GetXOMResourcesTask
res-fetch Downloads a specified RuleApp archive from Rule Execution Server ilog.rules.res.tools.remote.http.IlrDownloadRuleAppTask
res-fetch-all
Downloads the following files from Rule Execution Server:
  • Either all the RuleApp archives,
  • Or all the XOM, JAR, ZIP, or Java resources, or a library, or both libraries and resources
ilog.rules.res.tools.remote.http.IlrDownloadAllRuleAppsTask
res-get-xom-libraries Returns the list of libraries from the database persistence system. com.ibm.rules.res.tools.ant.xom.GetXOMLibrariesTask
res-get-xom-resources Returns the list of XOM, JAR, ZIP, or Java resources from the database persistence. com.ibm.rules.res.tools.ant.xom.GetXOMResourcesTask
res-jar Creates a well-formed RuleApp archive with all its mandatory execution resources. ilog.rules.res.tools.archive.IlrRuleAppArchiveTask
res-undeploy Removes a RuleApp archive from a running Rule Execution Server instance. ilog.rules.res.tools.remote.http.IlrUndeployRuleAppTask
res-undeploy-xom Removes XOM, JAR, ZIP, or Java resources from a running Rule Execution Server instance. com.ibm.rules.res.tools.ant.xom.UndeployXOMTask
res-write-db Adds a RuleApp archive to the database persistence layer. ilog.rules.res.tools.persistence.IlrWriteDbTask
res-write-file Adds a RuleApp archive to the file persistence layer. ilog.rules.res.tools.persistence.IlrWriteFileTask
res-write-xom-db Adds XOM, JAR, ZIP, or Java resources, and/or a library, to the database persistence layer. com.ibm.rules.res.tools.ant.xom.WriteXOMDbTask
res-write-xom-file Adds XOM, JAR, ZIP, or Java resources, and/or a library, to the file persistence layers. com.ibm.rules.res.tools.ant.xom.WriteXOMFileTask