-
1. Re: JBPM_LOG: who performed the transition?
m_ok Jul 6, 2006 11:35 AM (in response to wrschneider99)That makes two of us. I hope you get an answer as my questions where barely answered a year ago.
The need for actor ids in logging is fundamental to answering the three basic questions: Who did What and When.
There's currently What happpened and When but finding Who did What requires so much juggling and gymnastics it's an olympic feat in itself! -
2. Re: JBPM_LOG: who performed the transition?
kukeltje Jul 8, 2006 7:25 AM (in response to wrschneider99)I'm not realy good at juggling and gymnastics, so I keep faar from that . That is why I use tasks if I need to know who did what and when. So the answer is largly already in the initial question. If it is relevant, use a task (you do not need the jBPM ui for this if you do not want to) if you want to have logged who did what when no task is used, file a Jira issue (as a feature request, not a bug)
-
3. Re: JBPM_LOG: who performed the transition?
m_ok Jul 10, 2006 9:55 AM (in response to wrschneider99)Thanks for replying. I'm not good at gymnastics and juggling either (but it's always good for a laugh ; ).
Could you elaborate on your view of what JBPM_LOG is for?
I don't see a point in reanalyzing every task of a process every time I want to provide a log to my users. I know I could store that info somewhere but then again isn't that what the JBPM_LOG table is for?
From my perspective, in a system, users do things and that is logged for reference/proof/audit, etc.
Another word for this is audit trail. I think of logging (as in the case of JBPM_LOG and not log4j) as a synonym of audit trail and so I thought of logging in jbpm in that sense.
Am I wrong in my assumption of what JBPM_LOG is for?
(Sorry to the OP for thread-jacking a bit.) -
4. Re: JBPM_LOG: who performed the transition?
koen.aers Jul 11, 2006 6:03 AM (in response to wrschneider99)JBPM_LOG is indeed the way to construct the audit trail.
Regards,
Koen -
5. Re: JBPM_LOG: who performed the transition?
bdruth Jul 11, 2006 12:44 PM (in response to wrschneider99)I've looked through the documentation & googled around a bit and I haven't found what "the" way is to enable logging to JBPM_LOG. I have
<service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
in my jbpm.cfg.xml, but that itself doesn't seem to do the trick. What I currently have is thisprocessInstance.getInstance(LoggingInstance.class);
after I create a new ProcessInstance, and that seems to work. Is there a global way of enabling logging, though?
Cheers,
Brice
p.s. The JBPM docs reference a LoggingDefinition, which no longer exists. You also can't addInstance(new LoggingInstance()) on a ProcessInstance, JBPM throws an exception. So, may I suggest cleaning up the docs on chapter 12. Logging? :) -
6. Re: JBPM_LOG: who performed the transition?
hannes Jul 12, 2006 4:11 AM (in response to wrschneider99)I have changed the 'ProcessLog.java' and 'ProcessLog.hbm.xml' by adding a property named 'actorId' which is set in the constructor: 'actorId = Authentication.getAuthenticatedActorId();'
hbm:<property name="actorId" column="ACTOR_" />
This was made with 3.0, but maybe it works for 3.1 too. -
7. Re: JBPM_LOG: who performed the transition?
m_ok Jul 13, 2006 9:26 AM (in response to wrschneider99)"Hannes" wrote:
I have changed the 'ProcessLog.java' and 'ProcessLog.hbm.xml' by adding a property named 'actorId' which is set in the constructor: 'actorId = Authentication.getAuthenticatedActorId();'
hbm:<property name="actorId" column="ACTOR_" />
This was made with 3.0, but maybe it works for 3.1 too.
Thank you very much for posting that.
I know I added a sort of ProcessInstanceCreateLog.hbm.xml to log when a process was created. And it worked well also.
At the time, I didn't want to modify the JBPM source code because we would then have to do it every time we update. You're giving me motivation to go ahead and do it though. -
8. Re: JBPM_LOG: who performed the transition?
michaelholtzman Jul 13, 2006 11:36 AM (in response to wrschneider99)I solved this by adding my own ProcessLog subclass:
package com.olf.bpm.identity; import org.jbpm.logging.log.*; public class IdentityLog extends CompositeLog { private static final long serialVersionUID = 1L; protected String actorId = null; public IdentityLog() { } public IdentityLog(String invoker) { this.actorId = invoker; } public String getActorId() { return actorId; } public String toString() { return "invoker["+ actorId +"]"; } }
And the corresponding hibernate config file:<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping default-access="field"> <subclass name="com.olf.bpm.identity.IdentityLog" extends="org.jbpm.logging.log.ProcessLog" discriminator-value="9"> <property name="actorId" column="TASKACTORID_"/> </subclass> </hibernate-mapping>
Then, before initiating any BPM action, I call:idLog = new IdentityLog(invoker); token.startCompositeLog(idLog);