B. Teoría de los grupos de interés
V. DISCUSIÓN
Guidelines Scenario:
Your Tech Lead has noticed that you are becoming proficient in creating mappings and workflows using homogeneous joins. He knows of a workflow, currently in a development state, that has some type of join problem. He has asked you to copy it from the shared area and correct the issue.
Objectives:
Study the Source Qualifier Transformation and correct the join problem.
Duration:
15 minutes
Subject Review
Wf_m_Error2_xx exists in the Dev_Shared folder and contains two relational sources with a homogeneous join in the Source Qualifier. This workflow needs to be copied to your folder and renamed. The workflow is failing to load records to the Personnel table. Analysis of the join will be necessary to correct the problem.
Walkthrough:
Start the PowerCenter Repository Manager
1. From within the PowerCenter Designer, please click the PowerCenter Repository Manager icon the toolbar to start it.
a. PowerCenter will log you into the Repository Manager with the Devxx login used to log into the Designer.
b. PowerCenter will automatically open your folder.
Walkthrough:
Copy the Workflow
1. Select the workflow to copy
a. Double-Click the Dev_Shared folder to open it.
b. Expand the Workflows subfolder of the Dev_Shared folder.
c. Select the wf_m_Error2_xx workflow as shown below:
d. Copy the Workflow
i. Select menu option Edit Copy.
ii. Select your Devxx Folder.
iii. Select the menu option Edit Paste.
e. You will see the following confirmation message:
f. Click Yes.
i. If you receive a conflict message, select Reuse.
ii. Note the Copy Messages in the Output Window of the Repository Manager.
2. Expand the Sources, Targets, Mappings and Workflows subfolders of your Devxx folder.
a. DEALERSHIP and MRKT_EMPLOYEES should have been added as Sources.
b. PERSONNEL should have been added as a Target.
c. m_Error2_xx mapping should have been added.
d. wf_m_Error2_xx workflow should have been added.
3. Close the Repository Manager
Walkthrough:
Rename the Mapping
1. Refresh your folder
a. Navigate to the PowerCenter Designer
i. Right-Click on your folder and select Disconnect.
ii. Right-Click on your folder and select Open.
iii. Note that the Error Mapping, Source and Target now exist in your folder.
b. Open the m_Errors2_xx mapping in the Mapping Designer workspace.
2. Select the menu option Mappings Edit.
a. Rename the mapping so that the xx is your Student id.
b. Click OK.
3. Click Ctrl-S to save your work to the repository.
a. Use the Output window to verify the mapping saved successfully to the repository.
Walkthrough:
Refresh the Workflow folder
1. If you are not already logged into the Workflow Manager, launch the application by clicking on the respective icon in the toolbar.
a. Log into the Repository with your Devxx login.
b. Open your folder.
c. Navigate to the Workflow Designer using the Workflow Tools Toolbar.
d. If a workflow exists on the workspace, use menu option Workflows Close to clear the workspace.
2. Refresh your folder
a. Right-Click on your folder and select Disconnect.
b. Right-Click on your folder and select Open.
c. Note that the wf_Error2_xx are now listed in your folder
Walkthrough:
Rename the Workflow
1. Drag the workflow wf_m_Error2_xx onto the Workflow Manager Workflow Designer workspace.
a. Select the menu option Workflow Edit.
i. Rename the Workflow so that the xx is your Student id.
ii. Rename the Workflow log to reflect the workflow name.
b. Right-click on the session and select Edit.
i. Rename the session so that the xx reflects your student id.
ii. Rename the session log to reflect the session name.
c. Click OK.
2. Click Ctrl-S to save your work to the repository.
a. Use the Output window to verify the mapping saved successfully to the repository.
a. Right-click on the session and select Get Run Properties.
b. The workflow will fail with this error: ‘zero iteration count’ as illustrated in the figure from the session log below:
Note: It’s possible to look at the First Error Attribute Value and get some direction on where to look for the problem.
DEALERSHIP. DEALERSHIP _ID = MRKT_EMPLOYEES.DEALERSHIP_ID seems to be causing the issue.
Let’s open the mapping and take a look at the SQL relationship.
2. Maximize the PowerCenter Designer.
a. If it is not already open, open the m_Errors2_xx mapping.
b. Double-click the source qualifier SQ_EMPLOYEE_DEALERSHIP.
i. Click on the Properties tab.
Note that only the relationship has been entered into the SQL Query value. That is incorrect. As we’ve seen in our previous lab, you can use the SQL Query value to override the entire SQL statement. However, you cannot use only the join condition in that value.
If you would like to override only the join condition, but allow PowerCenter to dynamically build the ‘Select’ clause, then the relationship declaration should be entered into the User Defined Join value
c. Correct the mapping as shown below:
d. Click OK.
e. Save your work to the repository.
Walkthrough:
Refresh the Mapping
1. Maximize the Workflow Manager.
a. The session may require that the mapping be refreshed.
b. Right-Click on the session as shown below and select Refresh Mapping.
c. You should now see a small yellow triangle located on the session object.
This small triangle indicates that the session has been ‘impacted’ by a change at the mapping level.
Note: If you do not see an impacted symbol after refreshing the mapping, the repository automatically refreshed the session for you.
2. Save the Repository
a. Note that the Impacted Symbol disappears.
i. To be sure the mapping changes were refreshed into the session;
b. Edit the session
ii. Select the Sources subfolder in the navigator on the left.
iii. Review the Properties on the bottom right.
The join condition should now exist within the User Defined Join value.
Alternatively, instead of updating the mapping, you could have overridden the join value here on the session as seen below:
Walkthrough:
Start the Workflow
1. Start the wf_m_Errors2_xx workflow.
a. A successful execution will result in Task Details and Source/Target Statistics like the figure below: