res-get-xom-libraries

The res-get-xom-libraries Ant task returns the list of libraries from the database persistence layer of Rule Execution Server.

The result is a comma-separated list of reslib identifiers. The default result is displayed through the System.out command but you can assign it a new value for batch processing (for example, if you schedule a nightly clean-up of the repository).

res-get-xom-libraries element attributes

The following table describes the res-get-xom-libraries element attributes and specifies whether they are mandatory or optional.

Table 1. res-get-xom-libraries element attributes
Element attribute Description Mandatory/optional
credentialsfile

A file that contains the userid and password, encrypted the first time the attribute is used. If this attribute is present, do not use the userid and password attributes.

A credentials file is a text file that sets two properties: username and password.

Optional
failonerror The default is set to true. If it is set to false, a warning message is logged when an error occurs, but the build is not stopped. Optional
hostname The host name of the server where the Rule Execution Server console is installed. Mandatory
outputRulesetProperty If you set this attribute, the result is a comma-separated list of reslib identifiers. You can assign this list as a new ruleset property, which is created with the given name. To rename a resource inside the internal persistence layer, the best way is to rename the JAR file before the deployment process. Optional
password The password of the user who is allowed to log in to the Rule Execution Server console. If you set this attribute, do not use the credentialsfile attribute. Optional
portnumber The port number of the Rule Execution Server console. Mandatory
secured If you set this attribute to true, the task works through an HTTPS connection.

Optional

The default value is false.

userid The user name to log in the Rule Execution Server console. If you set this attribute, do not use the credentialsfile attribute. Optional
webapp The context root of the Rule Execution Server console

Optional.

The default value is res.

Example: Using foreach on retrieved libraries

You can then use the foreach task of the Ant-Contrib to use the returned list, as follows:
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
      <classpath>
         <pathelement location="lib/ant-contrib-1.0b3.jar"/>
      </classpath>
   </taskdef>
   
   <target name="run">
      <res-get-xom-libraries
         hostname="localhost"
         portnumber="9080"
         webapp="res"
         userid="resAdmin"
         password="resAdmin"
         outputRulesetProperty="managedxom.resources">
      </res-get-xom-libraries>
      <foreach list="${managedxom.resources}" param="url" target="diagnoseURL"/>
   </target>
   
   <target name="diagnoseURL">
      <echo message="Diagnose: ${url}"/>
      <res-diagnose-xom-uri
         hostname="localhost"
         portnumber="9080"
         webapp="res"
         userid="resAdmin"
         password="resAdmin"
         uri="${url}"
         outputRulesetProperty="managedxom.diag">
      </res-diagnose-xom-uri>
      <echo message="Resulting property: ${managedxom.diag}"/>
   </target>