Build Files for Object Groups

The build file for object groups supports the following targets: adding, importing, editing, deleting, publishing, exporting, and synchronizing member of an object group. The default location of the build file 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 allows you 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.

Set the file attribute to ${basic.cli.file} and ${gov.admin.cli.file} . For example:
<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 via the GovernanceAdminTask subelement. 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

The add target creates new object groups. The object group created is fixed or dynamic based on the parameters provided in the data file. The following is a sample code snippet of the add target:
<target name="add">
		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="add"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
</target>

Edit Target

The edit target modifies one or more existing object groups. While editing an object group, the Object Group ID or name must be specified.
<target name="edit">
		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="edit"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
 </target>

Delete Target

The delete target deletes one or more existing object groups. While deleting an object group, the Object Group ID or name must be specified.
<target name="delete">
		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="delete"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
</target>

Publish Target

The publish target publishes one or more existing object groups. When publishing an object group, the Object Group ID or name must be specified.
<target name="publish">
		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="publish"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
</target>

synchMembers Target

The syncMembers target is a utility to synchronize the membership of objects in an object group. This utility is used only when the Object Group membership is not accurate. When synchronizing members of specific object groups, the Object Group ID or name must be specified.
<target name="sync-members">
		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="syncMembers"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:SyncObjectGroupMembers"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
 </target>

Sample Build File

The following is a sample build file that contains the targets required for managing an object group:
<project default="add">

        <property file="ogp-cli.properties" />
        <property name="exported.data.file" value="tog_export_data.xml"/>

	<import file="${basic.cli.file}"/>
        <import file="${gov.admin.cli.file}"/>

	<target name="add">

		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="add"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
  
 </target>

		<target name="edit">

		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="edit"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
   
  </target>

	<target name="delete">

		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="delete"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
   
  </target>

	<target name="publish">

		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="publish"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:FixedObjectGroup | tog:DynamicObjectGroup"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
        
  </target>

	<target name="sync-members">

		<GovernanceAdminTask
			remote="true"
			propsFile="${props.file}"
			action="syncMembers"
			dataFile="DAA-1-tog_data.xml"
			objectSelector="declare namespace 
   tog='http://tibco.com/governance/ogp/cli/types_tog'; tog:SyncObjectGroupMembers"
			overwrite="true"
			merge="true"
			createIfNotExists="true"
			force="true"
			failOnError="false"/>
       
   </target>

</project>