ILOG JRules User Guide > Deploying Rules > Reference > RuleApp Management Using Ant > res-write-file Task

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

The following Ant task code provides an example of how to run the res-write-file task using the element attributes:

<res-write-file dir="res_data" file="myruleapp.jar" />

The following table describes the res-write-file element attributes and specifies whether or not they are required elements.

Table 11 res-write-file Element Attributes 
Element Attribute 
Description 
Required 
file 
The path of the RuleApp archive to write. 
Yes 
dir 
The path of the root directory of the file persistence. 
Yes 
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 argument versioningPolicy 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 argument versioningPolicy is not used. 
No, default value is ADD_AT_END_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 
No, default value is MAJOR_VERSION_POLICY 
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.  
No 

Related Concepts

RuleApps and RuleApp Projects

Related Topics

Task Mappings
Rule Execution Server Tasks
res-jar Task
res-fetch Task
res-fetch-all Task
res-deploy
res-undeploy Task
res-write-db Task
res-delete-file Task
res-delete-db Task

Related Tasks

Deploying and Exporting RuleApps

Related Samples and Tutorials

Tutorial: RuleApp Management
How to Automate Ruleset Management
How to Migrate RuleApps

Related Reference

RuleApp Management Using MBeans Accessor API
http://ant.apache.org/