Tuesday, October 11, 2011

Debug trace messages for PI Mappings

In a previous post I demonstrated how to develop and test a PI function library in NWDS. Even though the testing of functions in NWDS is very useful for quick elementary tests before deploying to the ESR, often it is almost impossible to test the true scenario before run time. This might be due to the dependence on dynamic config, container values, property file values etc. 

In complex mappings we often want to know what values certain nodes in our mapping have during run time. The solution is to create a function and inserting it at certain parts of the mapping to add custom trace messages to the SOAP header in SXMB_MONI.


Click to enlarge
AbstractTrace importanttrace;
importanttrace = container.getTrace();  
importanttrace.addDebugMessage(traceMessage + " " + traceContext + inputValue + " ");
  
return inputValue;


Insert this function into your mapping at the point where you want to check a certain node value. Double click the node to populate the trace message and the trace context. The value received will be written to the trace, but it will also pass through the node unmodified therefore leaving the output of the mapping "untouched".


Click to enlarge


Open up SXMB_MONI - Request Message Mapping - SOAP Header - Trace.


Click to enlarge

2 comments: