Build Files for Governance Controls
The build file for governance controls supports a set of targets to create and manage governance controls. The default location of the build files is <TIBCO_HOME>/pd/1.2/samples/common.
project Element
The project element declares the default build target for the build.xml file. taskdef and target are subelements of the project. The optional default attribute is used to specify a default target. You can select any target from the build file to be the default target.
<project default="target">
<taskdef ... />
<target name="target" ... />
</project>
import Element
The import element identifies the task definition file, which defines the path to the libraries required by ActiveMatrix Policy Director Governance.
<import file="${basic.cli.file}"/> <import file="${gov.admin.cli.file}"/>
target Element
The target element specifies the actions performed for an execution of the command-line interface. In a target you can provide a depends attribute containing a list of targets. Each target will be run in order until one fails or the list completes.
<target name="target">
<AMXAdminTask ... />
</target>
Add Target
<target name="add"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="add" propsFile="${props.file}" remote="true"/> </target>
Edit Target
<target name="edit"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="edit" propsFile="${props.file}" remote="true"/> </target>
Delete Target
<target name="delete"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="delete" propsFile="${props.file}" remote="true"/> </target>
Deploy Target
<target name="deploy"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="deploy" propsFile="${props.file}" remote="true"/> </target>
Undeploy Target
<target name="undeploy"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="undeploy" propsFile="${props.file}" remote="true"/> </target>
synch-rule-obj-groups Target
<target name="sync-rule-obj-groups"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:SyncRuleObjGroupRefs" dataFile="basicAuthentication_GCRule_data.xml" action="syncObjectGroupRefs" propsFile="${props.file}" remote="true"/> </target>
Sample Build File
<?xml version="1.0"?> <project default="add"> <property file="ogp-cli.properties"/> <property value="rule_export_data.xml" name="exported.data.file"/> <import file="${basic.cli.file}"/> <import file="${gov.admin.cli.file}"/> <target name="add_and_deploy_basicAuth_rule" depends="add, deploy"/> <target name="undeploy_and_delete_basicAuth_rule" depends="undeploy, delete"/> <target name="add"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="add" propsFile="${props.file}" remote="true"/> </target> <target name="edit"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="edit" propsFile="${props.file}" remote="true"/> </target> <target name="deploy"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="deploy" propsFile="${props.file}" remote="true"/> </target> <target name="undeploy"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="undeploy" propsFile="${props.file}" remote="true"/> </target> <target name="delete"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:StandaloneRule" dataFile="basicAuthentication_GCRule_data.xml" action="delete" propsFile="${props.file}" remote="true"/> </target> <target name="sync-rule-obj-groups"> <GovernanceAdminTask failOnError="false" force="true" createIfNotExists="true" merge="true" overwrite="true" objectSelector="declare namespace rule='http://tibco.com/governance/pd/cli/types_rule'; rule:SyncRuleObjGroupRefs" dataFile="basicAuthentication_GCRule_data.xml" action="syncObjectGroupRefs" propsFile="${props.file}" remote="true"/> </target> </project>