res-write-xom-file

The res-write-xom-file Ant task adds XOM, JAR, ZIP, or Java™ resources, or a library or both, to the file persistence layer of Rule Execution Server. This task does not notify any other Rule Execution Server component or execution unit (XU) instance.

When you deploy a set of JAR files with the jarMajorVersion increment policy set to true, each new JAR is deployed with an incremented major version number to the file system (that is, with the same name but a different SHA-1 checksum). If you set the jarMajorVersion increment policy to false, the minor version number is incremented.

res-write-xom-file 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-write-xom-file element attributes

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

Table 1. res-write-xom-file element attributes
Element attribute Description Mandatory/optional
dir The path to the root directory of the file persistence. Mandatory
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 number is incremented, if applicable. Otherwise, the minor version number is incremented.

Optional

The default value is false.

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

Example

The following code sample shows how to write Java XOM resources directly into a file persistence directory:
<res-write-xom-file dir="c:/res-xom-dir" 
                    jarMajorVersion="true" 
                    outputRulesetProperty="ruleset.managedxom.uris">
  <xompath>
    <fileset dir="./xoms">
      <include name="**/*.jar"/>
    </fileset>
  </xompath>
</res-write-xom-file>
<echo message="Resulting property: ${ruleset.managedxom.uris}"/>