res-write-file

The res-write-file Ant task adds a RuleApp archive to the file persistence layer of Rule Execution Server. This task does not notify any other Rule Execution Server component.

When you deploy a RuleApp with a merging policy at the ruleset level, the RuleApp that already exists in Rule Execution Server is updated with the deployed RuleApp (description, display name, properties). If you update this RuleApp by using the Rule Execution Server console, all modifications are lost at the next deployment that applies a merging policy at the ruleset level.

res-write-file element attributes

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

Table 1. res-write-file element attributes 
Element attribute Description Mandatory/optional
dir The path of 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.

file The path of the RuleApp archive to write. Mandatory
mergingpolicy

The server uses the merge policy to process the RuleApp archive.

This attribute can take the following values:
  • ADD_AT_END_MERGING_POLICY: The existing RuleApp is not modified and the version number of the new RuleApp is incremented to avoid a conflict. For example, if the RuleApp /MyRuleApp/1.0 already exists and you try to import a RuleApp archive that contains a RuleApp/MyRuleApp/1.0, the existing RuleApp is not modified and the new RuleApp is added with the version 2.0.
  • REPLACE_MERGING_POLICY: The existing RuleApp is replaced by the new RuleApp. With this policy, the versioningPolicy attribute is not used.
  • ADD_AT_END_RULESET_MERGING_POLICY: The existing ruleset is not modified. The version number of the new ruleset is incremented to avoid a conflict.
  • REPLACE_RULESET_MERGING_POLICY: The existing ruleset is replaced by the new ruleset. With this policy, the versioningPolicy attribute is not used.

Optional.

The default value is ADD_AT_END_RULESET_MERGING_POLICY.

versioningpolicy

The server uses the versioning policy to process the RuleApp archive.

This attribute can take the following values:
  • MAJOR_VERSION_POLICY
  • MINOR_VERSION_POLICY

Optional.

The default value is MINOR_VERSION_POLICY.

resourceVersioningPolicy

The server uses the versioning policy to process the resource in the RuleApp archive.

This attribute can take the following values:
  • MAJOR_VERSION_POLICY
  • MINOR_VERSION_POLICY

Optional.

The default value is MAJOR_VERSION_POLICY.

libraryVersioningPolicy

The server uses the versioning policy to process the library in the RuleApp archive.

This attribute can take the following values:
  • MAJOR_VERSION_POLICY
  • MINOR_VERSION_POLICY

Optional.

The default value is MINOR_VERSION_POLICY.

xomRepository

(Description)

The XOM repository path = dir + xomRepository

Example:

The value of the xomRepository attribute cannot be the same as the name of the RuleApp archive.

Optional.

The default value is res_xom.

Example

The following code sample shows how to run the res-write-file task:
<target name="write-archive-to-file">
    <res-write-file dir="res.data"
        file="myruleapp.jar"
        mergingpolicy="ADD_AT_END_MERGING_POLICY"
        versioningpolicy="MAJOR_VERSION_POLICY"
        resourceVersioningPolicy="MAJOR_VERSION_POLICY"
        libraryVersioningPolicy="MINOR_VERSION_POLICY" />
</target>