Discussion

Setting ruleset in pega.logTraceEvent()

To write to the tracer from Java/JSP, we can use the call pega.logTraceEvent().

Grant that this is in the PegaAPI class, it is officially unsupported. But this risk is mitigated by a couple of factors:

1. This API is unchanged in v6 from v5. My gut sense is that this won't radically change in the future.
2. We have written a wrapper Rule-Utility-Function around this. If the PegaAPI changes, we simply change our one function.

There's just one catch: the 4th parameter to logTraceEvent() is the ruleset-- this allows the filter the Tracer results for specific rulesets (which nonetheless has some known issues.)

But the ruleset is not static: it can be the actual ruleset, or the temporary checked out one (username@). Morever this would not get updated by a SaveAs.

How to ultimately solve this?
The activity java generation writes out the key in pz_CurrentRuleKey.
It would be handy for Pega's java generator to write out a String property for the ruleset as well, which could be used by our call to Trace().

Thoughts?

Jon

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

September 20, 2011 - 11:39am

any thoughts? Posted 14 months ago... has this been addressed in v6.2?

quote:


Originally posted by JonGarfunkel

To write to the tracer from Java/JSP, we can use the call pega.logTraceEvent().

Grant that this is in the PegaAPI class, it is officially unsupported. But this risk is mitigated by a couple of factors:

1. This API is unchanged in v6 from v5. My gut sense is that this won't radically change in the future.
2. We have written a wrapper Rule-Utility-Function around this. If the PegaAPI changes, we simply change our one function.

There's just one catch: the 4th parameter to logTraceEvent() is the ruleset-- this allows the filter the Tracer results for specific rulesets (which nonetheless has some known issues.)

But the ruleset is not static: it can be the actual ruleset, or the temporary checked out one (username@). Morever this would not get updated by a SaveAs.

How to ultimately solve this?
The activity java generation writes out the key in pz_CurrentRuleKey.
It would be handy for Pega's java generator to write out a String property for the ruleset as well, which could be used by our call to Trace().

Thoughts?

Jon


[/quote]

May 30, 2012 - 6:24pm

Narayana wrote, last month: "Can you please point me to this pega.logTraceEvent()'s definition or where can I read about it?"

Lookup the API for PegaAPI (prprivate.jar)

July 13, 2010 - 2:28pm

any thoughts?

quote:


Originally posted by JonGarfunkel

To write to the tracer from Java/JSP, we can use the call pega.logTraceEvent().

Grant that this is in the PegaAPI class, it is officially unsupported. But this risk is mitigated by a couple of factors:

1. This API is unchanged in v6 from v5. My gut sense is that this won't radically change in the future.
2. We have written a wrapper Rule-Utility-Function around this. If the PegaAPI changes, we simply change our one function.

There's just one catch: the 4th parameter to logTraceEvent() is the ruleset-- this allows the filter the Tracer results for specific rulesets (which nonetheless has some known issues.)

But the ruleset is not static: it can be the actual ruleset, or the temporary checked out one (username@). Morever this would not get updated by a SaveAs.

How to ultimately solve this?
The activity java generation writes out the key in pz_CurrentRuleKey.
It would be handy for Pega's java generator to write out a String property for the ruleset as well, which could be used by our call to Trace().

Thoughts?

Jon


April 20, 2012 - 7:49am

Jon, I saw this pega.logTraceEvent(...) being used. 10 parameters were passed to this function where I saw it used. I dont think this is a R-U-F. I dont even see it in PubliAPI. Can you please point me to this pega.logTraceEvent()'s definition or where can I read about it?

--Narayana.

July 21, 2014 - 4:59pm

Two years later... no reply... is there *any way* that the current ruleset (whether the actual one or the user's checked out virtual ruleset, e.g., GARFJ@) can be written into the generated Java so that pega.logTraceEvent()  can access it, where we need to write logs to Tracer from Java?

September 2, 2014 - 9:07am

Not sure that is exactly what you want to do but maybe that can help you.

You can use from a java function this function : pega_rules_utilities.sendDebugMessageToTracer("mess", "ruleset");

This function will call the logTraceEvent() function with the Debug event Type. So after you just need  to add the "Debug" event on your tracer.

I hope that help you.

Cheers,

Alex
 
 

September 2, 2014 - 9:30am

I know the function. That's not the question.

The question is how to pass the "ruleset" parameter automatically, since it is variable.