Creating Data Binding Using an Ant Script

You can use the CICS/IMS Data binding wizard to create an Ant script simply by selecting "Save session as Ant script."
Data Discovery Task

During the import and generation steps, the Discovery Agent and the Resource Writer require a set of user input to be provided. The Discovery Agent and the Resource Writer can be paired a various ways to import and generate the desired artifact. They are identified by their name (QName). For example, the Cobol Discovery Agent can by identified by the following name: {com/ibm/adapter}CobolDiscoveryAgent.

The following example describes the data discovery section of the Ant script used for J2C Data Binding generation:
<adapter:discover>
	<adapter:performImport agent="{com/ibm/adapter}CobolDiscoveryAgent">
		<adapter:importResource>
			<adapter:propertyGroup name="CobolFileGroup">
				<adapter:propertyElement name="CobolFile" value="/${project}/taderc99.ccp"/>
			</adapter:propertyGroup>
		</adapter:importResource>
		<adapter:queryProperties>
			<adapter:propertyGroup name="ImportProperties">
				<adapter:propertyElement name="Platform" value="Win32"/>
			</adapter:propertyGroup>
		</adapter:queryProperties>
		<adapter:queryResult>
			<adapter:selectElement name="DFHCOMMAREA"/>
		</adapter:queryResult>
	</adapter:performImport>
	<adapter:writeToWorkspace writer="{com/ibm/adapter/cobol/writer}JAVA_WRITER">
		<adapter:propertyGroup name="COBOLToJavaResourceWriter">
			<adapter:propertyElement name="GenerationStyle" value="0"/>
			<adapter:propertyGroup name="Java Type Name">
				<adapter:propertyElement name="Overwrite existing class" value="true"/>
				<adapter:propertyElement name="Project Name" value="${project}"/>
				<adapter:propertyElement name="Package Name" value="com.ibm.test"/>
				<adapter:propertyElement name="Class Name" value="Taderc99"/>
			</adapter:propertyGroup>
		</adapter:propertyGroup>
	</adapter:writeToWorkspace>
</adapter:discover>

Where:

  1. performImport
    • importResource is the resource to be imported. e.g. a cobol source.
    • queryProperties is a list of parameters that represent the information required to form a query.
    • importResource is the resource to be imported. e.g. a cobol source.
    • queryResult is the selected nodes on the result tree that are desired for import as application artifacts.
    • propertyGroup is the structure containing the properties and their values.
  2. writeToWorkspace
    • workspaceResourceWriter is the name of the writer used to generated the application artifacts.
    • propertyElement is a list (pairs of property name and property value) that the writer uses for generation.

Feedback