Developer Guide > PowerCenter Mappings and Workflows > Developing PowerCenter Batch Workflows
  

Developing PowerCenter Batch Workflows

You develop PowerCenter batch workflows for Data Integration Hub custom mappings in the same way that you develop other PowerCenter workflows. Data Integration Hub transformations interact directly with Data Integration Hub.

Developing PowerCenter Batch Workflows Rules and Guidelines

When you develop PowerCenter batch workflows to use in publications and subscriptions with custom mappings and in monitoring rules, consider the following rules and guidelines:
For general rules and guidelines on developing PowerCenter workflows to use with Data Integration Hub, see .

Developing PowerCenter Batch Workflows for Publications and Subscriptions Process

To develop a batch workflow in PowerCenter that processes Data Integration Hub data, perform the following steps:
  1. 1. Create the source and target definitions.
  2. 2. Create the mapping and add transformations.
  3. 3. Create the workflow and the session.
  4. 4. Save the PowerCenter workflow to the PowerCenter repository.
Note: This process is not applicable for monitoring rule workflows. There are no limitations on how you define workflows for monitoring rules.

Step 1. Create the Source and Target Definitions

When you develop a publication workflow, you create the source based on the structure of the database or file that you want to publish and set the target to the publication repository.
If you publish from a database source, verify that you publish datatypes that the publication repository can store.
When you develop a subscription workflow, you create a source based on the topic structure from the publication repository. You can copy the source from the publication metadata folder in the PowerCenter repository.
You create the source and target definitions in the PowerCenter Designer in the same way that you create source and target definitions for other mappings. For general information about source and target definitions, see the PowerCenter Designer Guide.

Creating the Source Definition for a Subscription Workflow

In the PowerCenter Designer, create the source and define the source properties of a subscription workflow. When you develop a publication workflow, you define the source based on the application from which you want to publish data.
The source definition process includes the following steps:
  1. 1. Create the source object. Set the source connection to DIH__STAGING. You create a source based on the topic structure from the publication repository. You can copy the source from the publication metadata folder in the PowerCenter repository.
  2. 2. Add variables to filter the published data to consume. For example, you can select to consume data from a specific table in the publication repository.
  3. 3. Add the required fields that determine the data set to consume. You can define multiple data sets to consume, similar to an aggregated or a compound subscription with an automatic mapping.
The following table describes the fields to add to the source object of a subscription workflow:
Field
Description
DIH__PUBLICATION_INSTANCE_ID
Required. Identifiers of one or more published data sets in a comma-separated list. Each data set that an application publishes has a unique identifier. To filter the data to consume, use the value from the $$<topicName>__PublicationInstanceIDs workflow parameter.
The parameter datatype must be number(19) if you write to an Oracle database target or number(19,0) if you write to a Microsoft SQL Server database target.
DIH__PUBLICATION_INSTANCE_DATE
Date and time that each application started publishing the data sets, in a comma-separated list. If you use database partitions, you can filter the data to consume by using the value from the $$<topic_name>__PublicationInstanceDatesSQL workflow parameter. The value format depends on the publication repository database type.
On an Oracle database, the datatype must be date and the value must be in the following format:
YYYY-MM-DD HH24:MI:SS
On a Microsoft SQL Server database, the datatype must be datetime and the value must be in the following format:
yyyy-mm-dd hh:mi:ss (24h)
Note: If you want to filter the data to consume with a different transformation, you can use the $$<topic_name>__PublicationInstanceDates parameter instead.
You can filter data to consume in the Source Filter attribute of the Source Qualifier transformation in subscription workflow. The following example shows the field syntax to filter by ID and date range in a single line:
MY_TABLE.DIH__PUBLICATION_INSTANCE_ID in ($$myTopic__PublicationInstanceIDs)
AND MY_TABLE.DIH__PUBLICATION_INSTANCE_DATE in ($$myTopic__PublicationInstanceDatesSQL)

Creating the Target Definition

In the PowerCenter Designer, create the target and add ports to store properties for running the workflow. You can also add properties to store other Data Integration Hub values that you want to send back from PowerCenter.
The target definition process includes the following steps:
  1. 1. Create the target object. If you develop a publication workflow, use the DIH__STAGING connection in the target definition. The database target type must match the publication repository database type.
  2. 2. If you develop a publication workflow, add the required fields that determine the data set to publish.
The following table describes the required fields to add to the target object of a publication:
Parameter
Description
DIH__PUBLICATION_INSTANCE_ID
Required. Identifier of the published data set. Each data set that an application publishes has a unique identifier. The field uses the value from the $$publicationInstanceID workflow parameter.
DIH__PUBLICATION_INSTANCE_DATE
Required. Date and time that the application started publishing the data set. The field uses the value from the $$publicationInstanceDate workflow parameter. The value format depends on the publication repository database type.
On an Oracle database, the value must be in the following format:
to_date('<DATE>', 'YYYY-MM-DD HH24:MI:SS')
On a Microsoft SQL Server database, the value must be in the following format:
convert(datetime,'<DATE>',120)

Step 2. Create the Mapping

Create a mapping that contains the source definition, target definition, and transformations that you want to use to process data for Data Integration Hub.
You create a mapping for Data Integration Hub in the same way you build other PowerCenter mappings. Use Data Integration Hub transformations and Unstructured Data transformations to add product-specific functionality to the mapping. You can also add other PowerCenter transformation to the mapping.

Step 3. Create the PowerCenter Workflow and Session

Create the workflow and the session that runs the mapping. You create the workflow in the same way you create other PowerCenter workflows.
    1. In the Workflow Designer, create the workflow and the session object. For general information about creating workflows and sessions, see the PowerCenter Advanced Workflow Guide.
    2. Add the transformations that notify the Data Integration Hub server that the publication or that the subscription process ended.
    3. Save the session object.
    4. Test the workflow to ensure that it works correctly.

Step 4. Save the PowerCenter Workflow

Save the workflow to the PowerCenter repository. After you save the workflow, you can export it from PowerCenter to an XML file that will be used as the workflow definition file. You must use the Repository Manager to export the workflow.
Note: Do not save the workflow to a folder where the folder name is prefixed by DIH__pub or by DIH__sub.