res-deploy-xom

The res-deploy-xom task deploys a set of XOM, JAR, ZIP, or Java™ resources to a running Rule Execution Server instance. The task uploads the archive through Hypertext Transfer Protocol (HTTP) or an HTTP Over SSL (HTTPS).

When you deploy a set of XOM, JAR, ZIP, or Java resources with the jarMajorVersion increment policy set to true, each new JAR file that is deployed to Rule Execution Server (that is, with the same name but a different SHA-1 checksum) is deployed with an incremented major version. If you set the jarMajorVersion increment policy to false, the minor version of the new JAR file is incremented. In contrast, the existing resources (that is, with the same name and same SHA-1 checksum) are not deployed again.

If you use the libName attribute to specify a library name, the res-deploy-xom task creates a library name to contain the set of XOM, JAR, ZIP, or Java resources that you pass. When you create the library with the libMajorVersion increment policy set to true, the existing library is redeployed to Rule Execution Server with an incremented major version. If you set the libMajorVersion increment policy to false, the minor version of the new library is incremented.

res-deploy-xom nested element

The xompath nested element specifies a Path-like structure External link opens a new window or tab. All the files included in this path are placed in the internal layer of the Rule Execution Server console as a JAR resource, in the same order as listed in the path. The xompath element supports the nested fileset element. See FileSet External link opens a new window or tab.

res-deploy-xom element attributes

The following table describes the element attributes of the res-deploy-xom Ant task and specifies whether they are mandatory or optional.

Table 1. res-deploy-xom element attributes
Element attribute Description Mandatory/optional
authorizationToken

Supports token authentication by using OpenID Connect.

If you set this attribute, it takes precedence over the credentialsfile, userid, and password attributes.

Optional
credentialsfile A file that contains the userid and password values, encrypted the first time the attribute is used. If you set this attribute, do not use the userid and password attributes.

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

Optional
failonerror If you set this attribute to false, a warning message is logged when an error occurs, but the build process is not stopped.

Optional

The default value is true.

jarMajorVersion The server uses the version policy to process the XOM, JAR, ZIP, or Java resources. If you set this attribute to true, the major version is incremented, if applicable. Otherwise, the minor version is incremented.

Optional

The default value is false.

hostname The host name of the server where the Rule Execution Server console is installed. Mandatory
libMajorVersion The server uses the version policy to process the library. If you set this attribute to true, the major version is incremented, if applicable. Otherwise, the minor version is incremented.

Optional

The default value is false.

libMergingPolicy

The server uses the merging policy to process the library.

This attribute can take the following values:
  • INCREMENT_MERGING_POLICY to increment the version during the deployment process
  • REPLACE_LATEST_MERGING_POLICY to replace the last version during the deployment process
Optional
libName The server uses this name to create a library. If you do not set this attribute, no library is created and the other library attributes, libMajorVersion and libMergingPolicy, are ignored. Optional
outputRulesetProperty If you set this attribute, the result of the computed property ruleset.managedxom.uris is assigned to a new property that is created with the given name. To rename a resource inside the internal persistence, 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 to Rule Execution Server console. If you set this attribute, do not use the credentialsfile attribute. The user must be assigned the resDeployer role or above. Optional
webapp The context root of the Rule Execution Server console

Optional

The default value is res.

Example: Deploying resources to a file

The following code sample shows how to deploy XOM, JAR, ZIP, or Java resources to Rule Execution Server:
<target name="runloanvalidation">
		<res-deploy-xom
			hostname="localhost"
			portnumber="9080"
			webapp="res"
			userid="resAdmin"
			password="resAdmin"
			jarMajorVersion="false"
			libName="person"
			outputRulesetProperty="ruleset.managedxom.uris">
			<xompath>
			<fileset dir="hello">
				<include name="*.jar"/>
			</fileset>
			</xompath>
		</res-deploy-xom>
		<echo message="Resulting property: ${ruleset.managedxom.uris}"/>
	</target>

Example: Encrypted credentials for JAR resources deployment

The following code sample shows how to run an encrypted res-deploy-xom task that uses the credentialsfile attribute:
<res-deploy-xom hostname="localhost" 
                portnumber="9080" 
                credentialsfile="credentials.properties" 
                jarMajorVersion="true">
      <xompath>
         <fileset dir="./javaxoms">
            <include name="**/*.jar"/>
         </fileset>
      </xompath>
</res-deploy-xom>
The credentials file is a text file that contains the following parameters:
username=resAdmin
password=resAdmin

Credentials file must comply with the Java format for property files. For more information, see the Java documentation External link opens a new window or tab).

After the first execution of the res-deploy-xom Ant task, the file contents are encrypted. For example:
username={AES}6ee3l4NrmD3p8QTViSszow\=\=
password={AES}6ee3l4NrmD3p8QTViSszow\=\=

By using encryption, you ensure that the user name and password are never displayed in plain text in traces while JAR files are deployed.

Example: Passing a trusted key for SSL authentication

The following code sample shows how to pass a trusted key to the Ant task so that it authenticates with SSL on the application server:
set ANT_OPTS=-Djavax.net.ssl.trustStore=cacerts.jks
ant my-https-deploy-xom-task