Вы находитесь на странице: 1из 4

Using the Mapping SDK to Create

Sessions and Workflows for Mapping


Architect for Visio Mappings

© Copyright Informatica LLC 2013, 2017. Informatica Corporation. No part of this document may be reproduced or
transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of
Informatica Corporation.
Abstract
The session object defines the run-time attributes of PowerCenter mappings. The workflow object defines the
orchestration of one or more PowerCenter sessions and other workflow tasks. This article explains how to build
PowerCenter session and workflow objects using the Mapping SDK for mappings generated by Mapping Architect for
Visio.

Supported Versions
• Informatica PowerCenter 8.6.1, 9.0.1, 9.1.0, 9.5.0, 9.5.1

Table of Contents
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Configuration Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Step 1. Download the Mapping SDK Sample .Zip File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Step 2. Edit and Run the Setup.bat File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Step 3. Run the Mapping SDK Sample Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Overview
You can use the Mapping SDK to programmatically create sessions and workflows for the multiple mappings that the
Mapping Architect for Visio generates.

You can use Mapping Architect for Visio to generate multiple mappings at one time to improve productivity and provide
consistency. After you generate mappings using Mapping Architect for Visio, you can use the Mapping SDK to create
sessions and workflows.

Scenario
You use the Mapping Architect for Visio to generate multiple mappings that have similar structure. You need to create
sessions and workflows for the generated mappings.

Use the Mapping SDK sample program to create workflows and sessions for the mappings that the Mapping Architect
for Visio generates. You can use the Mapping SDK sample program to generate an XML file of the workflows and
sessions or to import the generated XML file into the PowerCenter repository.

Configuration Tasks
Create workflow objects and session objects for the mappings using the Mapping SDK and import the session and
workflow objects into the Workflow Manager.

To implement this scenario, you must export the Mapping Architect for Visio mappings from the PowerCenter
repository. The Mapping SDK sample program uses the XML file that contains the mappings to create the
corresponding workflows and sessions.

1. Download the Mapping SDK sample .zip file.


2. Edit the environment variables in the setup.bat file and run the setup.bat file.
3. Run the Mapping SDK sample program and specify the run-time arguments.

2
Step 1. Download the Mapping SDK Sample .Zip File
The Mapping SDK sample .zip file consists of the setup.bat file, GenSession.jar file, and powrmart.dtd file.

The setup.bat file sets the environment variables that the Mapping SDK sample program requires to run. The
GenSession.jar file contains the Mapping SDK sample program to create workflow objects and session objects. When
you import repository objects, the PowerCenter Client validates the XML file against powrmart.dtd.

1. Create a folder to save the setup.bat, GenSession.jar, and the powrmart.dtd files. For example, create the
folder GenerateSession in the C drive.
2. Download the 0484-MappingSDKGenSessionSample.zip file from the following location:
https://kb.informatica.com/proddocs/Product%20Documentation/6/0484-
MappingSDKGenSessionSample.zip.
The zip file contains the setup.bat, GenSession.jar, and powrmart.dtd files.
3. Extract the contents on the zip file to the directory that you created to store the sample files.

Step 2. Edit and Run the Setup.bat File


Edit the JAVA_HOME and JAVASDK_HOME variables in the setup.bat file. Run the setup.bat file to set the environment
variables required to run the Mapping SDK sample code.

1. Go to the directory where you extracted the sample files.


2. Open the setup.bat file with a text editor.
3. Set the JAVA_HOME environment variable to the location of the folder that contains the supported Java
Development Kit (JDK). For example:
set JAVA_HOME= C:\Program Files\Java\jdk1.7.0_02
4. Set the JAVASDK_HOME environment variable to the location of the PowerCenter Mapping SDK installation
directory. For example:
SET JAVASDK_HOME=C:\Informatica\9.1.0\clients\PowerCenterClient\MappingSDK
5. Save the setup.bat file.
6. From the command prompt, run the setup.bat file to set the environment variables. For example:
C:\>GenerateSession\setup

Step 3. Run the Mapping SDK Sample Program


Run the Mapping SDK sample program and specify the run-time arguments to create sessions and workflows for the
mappings that Mapping Architect for Visio generates.

From the command prompt, run the following command to create sessions and workflows:
C:\GenerateSession>"%JAVA_HOME%\bin\"java -classpath %CLASSPATH% GenSession.jar GenSession

3
The following table describes the Mapping SDK sample program arguments:

Argument Description

0 or 1 Required. Specify the argument 0 to generate an XML file that


contains the sessions and workflows. If you specify the argument
as 0, you must import the XML file into the PowerCenter
repository.
Specify the argument 1 to generate the an XML file that contains
sessions and workflows and to import the XML file into the
PowerCenter repository. If you specify the argument as 1, the
sample program imports the XML file into the PowerCenter
repository based on the repository information that you provide in
the pcconfig.properties file.

file_name Required. Specify the name of the XML file that contains the
mappings imported from the PowerCenter repository.

For example, run the following command from the command prompt to generate workflows and import the workflows
into the PowerCenter repository.
C:\GenerateSession>"%JAVA_HOME%\bin\"java -classpath %CLASSPATH% GenSession.jar GenSession 1
Staging_Pattern_Mappings.XML

Author
Muthuramalingam S
Technical Writer

Acknowledgements
The author would like to acknowledge Tarik Zaakour for his contributions to this article.

Вам также может понравиться