Can be tricky ( I seem to remember you only get to see the 'entry' and 'exit' of the rule, not the gory details going on inside....*).
There might be an easier way: but this is what I have done before (it's not pretty):
Does the Function in question have any oLog.debug statements in it maybe ? If so: you can switch on the logger for it; as an alternative (or in addition) to Tracing.
I could be wrong for later versions of PRPC : but it used to be the case that you cannot Private-Checkout a Function...so....
if you know specifically *where* the RUF will be called *from* ? (That is: an Activity etc. ?).......
Create your own Function Library; and create a copy of the Function in that Library.
Add in your own 'oLog' logging statements as need be.
Then Private-Checkout the Activity that calls it; and change it to call your copy instead.
If the Function makes other Function calls; you may need to create futher copies of them and add more debug etc....
* Actually: that's not strictly true; if the RUF uses the Public API to call other rules; they *should* show up in Tracer. But if the Function is mostly generic Java Code - you don't get to see anything going on 'inside' (Analogous to a 'Java Step' in an Activity : but some Functions are much bigger than Java Steps).
In Pega 7, you can do a private checkout of the function to add log messages. After you add the logging in the function, click Generate Function. You will not be able to generate the library unless you check in the function but with the checked out version you can at least see the log messages when running under your operator.
Posted: 4 years ago
Posted: 16 Mar 2017 14:56 EDT
Susan Liu (SusanLiu_GCS)
Principal Software Solutions Engineer
I generally keep the following in mind when debugging functions (summary of what was said above) :
1) use pzPrivateCheckout if the "private checkout" button is not available.
2) If I'm going to check the results in the log file, I put "oLog.infoForced( . . .)" in the java code. If I'm going to use the pega tracer, I put things like this in: 'pega_rules_utilities.sendDebugMessageToTracer("property value is" + javaPropName, "Pega-ProCom");' and make sure that "Pega-ProCom" is included in the tracer settings ruleset list AND that event type "Debug" is added and enabled in the tracer settings.
3) Only use "build function" and not "build library"!