Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Address Validator Transformation
  4. Aggregator Transformation
  5. Association Transformation
  6. Bad Record Exception Transformation
  7. Case Converter Transformation
  8. Classifier Transformation
  9. Cleanse transformation
  10. Comparison Transformation
  11. Custom Transformation
  12. Custom Transformation Functions
  13. Consolidation Transformation
  14. Data Masking Transformation
  15. Data Masking Examples
  16. Decision Transformation
  17. Duplicate Record Exception Transformation
  18. Dynamic Lookup Cache
  19. Expression Transformation
  20. External Procedure Transformation
  21. Filter Transformation
  22. HTTP Transformation
  23. Identity Resolution Transformation
  24. Java Transformation
  25. Java Transformation API Reference
  26. Java Expressions
  27. Java Transformation Example
  28. Joiner Transformation
  29. Key Generator Transformation
  30. Labeler Transformation
  31. Lookup Transformation
  32. Lookup Caches
  33. Match Transformation
  34. Match Transformations in Field Analysis
  35. Match Transformations in Identity Analysis
  36. Merge Transformation
  37. Normalizer Transformation
  38. Parser Transformation
  39. Rank Transformation
  40. Router Transformation
  41. Sequence Generator Transformation
  42. Sorter Transformation
  43. Source Qualifier Transformation
  44. SQL Transformation
  45. Using the SQL Transformation in a Mapping
  46. Stored Procedure Transformation
  47. Standardizer Transformation
  48. Transaction Control Transformation
  49. Union Transformation
  50. Unstructured Data Transformation
  51. Update Strategy Transformation
  52. Weighted Average Transformation
  53. 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
CDI-PC
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!