Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Aggregator Transformation
  4. Custom Transformation
  5. Custom Transformation Functions
  6. Data Masking Transformation
  7. Data Masking Examples
  8. Expression Transformation
  9. External Procedure Transformation
  10. Filter Transformation
  11. HTTP Transformation
  12. Identity Resolution Transformation
  13. Java Transformation
  14. Java Transformation API Reference
  15. Java Expressions
  16. Java Transformation Example
  17. Joiner Transformation
  18. Lookup Transformation
  19. Lookup Caches
  20. Dynamic Lookup Cache
  21. Normalizer Transformation
  22. Rank Transformation
  23. Router Transformation
  24. Sequence Generator Transformation
  25. Sorter Transformation
  26. Source Qualifier Transformation
  27. SQL Transformation
  28. Using the SQL Transformation in a Mapping
  29. Stored Procedure Transformation
  30. Transaction Control Transformation
  31. Union Transformation
  32. Unstructured Data Transformation
  33. Update Strategy Transformation
  34. XML Transformations

Transformation Guide

Transformation Guide

Generating Error and Tracing Messages

Generating Error and Tracing Messages

The implementation of the Informatica external procedure TxINF_BankSoft::FV in Step 4. Building the Module contains the following lines of code:
ostrstream ss; char* s; ... ss << "The calculated future value is: " << FV->GetDouble() << ends; s = ss.str(); (*m_pfnMessageCallback)(E_MSG_TYPE_LOG, 0, s); (*m_pfnMessageCallback)(E_MSG_TYPE_ERR, 0, s); delete [] s;
When the Integration Service creates an object of type Tx<MODNAME>, it passes to its constructor a pointer to a callback function that can be used to write error or debugging messages to the session log. (The code for the Tx<MODNAME> constructor is in the file Tx<MODNAME>.cpp.) This pointer is stored in the Tx<MODNAME> member variable m_pfnMessageCallback. The type of this pointer is defined in a typedef in the file $PMExtProcDir/include/infemmsg.h:
typedef void (*PFN_MESSAGE_CALLBACK)(   enum E_MSG_TYPE eMsgType,   unsigned long Code,   char* Message );
Also defined in that file is the enumeration E_MSG_TYPE:
enum E_MSG_TYPE {   E_MSG_TYPE_LOG = 0,   E_MSG_TYPE_WARNING,   E_MSG_TYPE_ERR };
If you specify the eMsgType of the callback function as E_MSG_TYPE_LOG, the callback function will write a
log
message to the session log. If you specify E_MSG_TYPE_ERR, the callback function writes an
error
message to the session log. If you specify E_MSG_TYPE_WARNING, the callback function writes an
warning
message to the session log. Use these messages to provide a simple debugging capability in Informatica external procedures.
To debug COM external procedures, you may use the output facilities available from inside a Visual Basic or C++ class. For example, in Visual Basic use a MsgBox to print out the result of a calculation for each row. Of course, you want to do this only on small samples of data while debugging and make sure to remove the MsgBox before making a production run.
Before attempting to use any output facilities from inside a Visual Basic or C++ class, you must add the following value to the registry:
  1. Add the following entry to the Windows registry:
    \HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PowerMart\Parameters\MiscInfo\RunInDebugMode=Yes
    This option starts the Integration Service as a regular application, not a service. You can debug the Integration Service without changing the debug privileges for the Integration Service service while it is running.
  2. Start the Integration Service from the command line, using the command PMSERVER.EXE.
    The Integration Service is now running in debug mode.
When you are finished debugging, make sure you remove this entry from the registry or set RunInDebugMode to No. Otherwise, when you attempt to start PowerCenter as a service, it will not start.
  1. Stop the Integration Service and change the registry entry you added earlier to the following setting:
    \HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PowerMart\Parameters\MiscInfo\RunInDebugMode=No
  2. Restart the Integration Service as a Windows service.

0 COMMENTS

We’d like to hear from you!