res-write-db
The res-write-db Ant task adds a RuleApp archive to the database 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 the 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-db element attributes
The following table describes the res-write-db element attributes and specifies whether they are mandatory or optional.
| Element attribute | Description | Mandatory/optional |
|---|---|---|
| credentialsfile | A file that contains the A credentials file is a text file that sets two properties: username and password. |
Optional |
| driver | The JDBC driver class name for the database. | 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:
|
Optional. The default value is ADD_AT_END_RULESET_MERGING_POLICY. |
| password | The user password for the database. If you set this attribute, do not use the credentialsfile attribute. | Mandatory |
| url | The JDBC URL for the database. | Mandatory |
| userid | The user ID for the database. If you set this attribute, do not use the credentialsfile attribute. | Mandatory |
| versioningpolicy | The server uses the version policy to process the RuleApp archive. This attribute can take the following values:
|
Optional. The default value is MINOR_VERSION_POLICY. |
| resourceVersioningPolicy |
The server uses the version policy to process the resource in the RuleApp archive. This attribute can take the following values:
|
Optional. The default value is MAJOR_VERSION_POLICY. |
| libraryVersioningPolicy |
The server uses the version policy to process the library in the RuleApp archive. This attribute can take the following values:
|
Optional. The default value is MINOR_VERSION_POLICY. |
classpath subelement
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/"/>
</classpath>Example: RuleApp creation with no encryption
<target name="write-archive-to-db">
<res-write-db driver="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://localhost:50000/DB2_8RES"
userid="res"
password="mypassword"
mergingpolicy="ADD_AT_END_MERGING_POLICY"
versioningpolicy="MAJOR_VERSION_POLICY"
resourceVersioningPolicy="MAJOR_VERSION_POLICY"
libraryVersioningPolicy="MINOR_VERSION_POLICY">
<classpath>
<pathelement location="db2jcc.jar"/>
<pathelement location="db2jcc_license_cu.jar"/>
</classpath>
</res-write-db>
</target>Example: Encrypted RuleApp creation
userid="res" password="mypassword"credentialsfile="mypasswordfile"username=res
password=mypassword
username={AES}6ee3l4NrmD3p8QTViSszow\=\=
password={AES}6ee3l4NrmD3p8QTViSszow\=\=
With encryption, the userid and password values
are never displayed in plain text in traces during RuleApp deployment.