Question
BlueRose Technologies
IN
Last activity: 21 Mar 2017 12:05 EDT
how to trace an RUF ?
how to trace an RUF ?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Hi,
Can you try using oLog.error() statements in the function?
And also don't forget to click "Generate Function".
Thanks,
Susan
Pegasystems Inc.
GB
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).
BlueRose Technologies
IN
Hi
Thanks for your answer.I tried using oLog.debug statements in the function(RUF).
But after executing the function from an activity, i checked pega logs file for the logs. But the logs are not generated.Can anyone please help me on this?
Pegasystems Inc.
US
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.
Pegasystems Inc.
US
HI,
We can do debugging on the function java code by using the following method:
"Private Checkout RUF using pzPrivateCheckOut activity Add oLog.error(); statements as required Click “Generate Function” only."
Steps:
- Run pzPrivateCheckOut activity and pass the RUF handle (pzinskey). The private version will be saved into your own ruleset.
- Once you can modify RUF java code, you can add oLog.error(); statements in the places you want to check values.
- Save and click “Generate Function”.
- You can run use case and then check the prpc log file to see the oLog.error() outputs.
Thanks,
Susan
BlueRose Technologies
IN
Hi All,
Thanks for your answers.I tried using oLog.debug statements in the function(RUF).
But after executing the function from an activity, i checked pega logs file for the logs. But the logs are not generated.Can anyone please help me on this?
Accepted Solution
Pegasystems Inc.
US
Hi,
Can you try using oLog.error() statements in the function?
And also don't forget to click "Generate Function".
Thanks,
Susan
BlueRose Technologies
IN
Thanks Susan !
Finally it works. I forgot to click Generate Function. Logging is done.
Pegasystems
US
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"!
/Eric