-
1. getActorId() in ProcessLog?
m_ok Nov 3, 2005 2:49 PM (in response to m_ok)All right, I'll change my question a bit.
What's the purpose of the getActorId method in the ProcessLog class?
Thanks! -
2. Re: null actorId in logs
tom.baeyens Nov 4, 2005 6:47 AM (in response to m_ok)the actorId is taken from Authentication.getAuthenticatedActorId();
that method delegates to a configurable Authenticator implementation.
the default implementation is the one that uses a thread local. that thread local can be manipulated with Authentication.pushAuthenticatedActorId and Authentication.popAuthenticatedActorId
regards, tom. -
3. Re: null actorId in logs
m_ok Nov 10, 2005 11:20 AM (in response to m_ok)(already on page 6! seems like it was on page one yesterady : )
Thank you for your answer, Tom.
I (think/hope I) broadly understand the different default Authenticators, that you can push and pop the authenticated user, and that we can provide customized ones (in the same way as with the AssignmentHandler or TaskControllerHandler).
What confused me is that the id of the actor that triggered the log (Who) , is not persisted even though there is a specific get for it. That's why I was asking what the purpose of the method is.
Because currently, the date (When) is saved in the JBPM_LOG table, as well as contextual info depending on the log type (What). I can use getDate() to know when the event occured, I can use the name of the log class and its specific gets to know what happened but getActorId() will not always return who is behind this. Granted it's not necessary in every log.
Case in point is the ProcessInstanceCreateLog class. The getActorId() method relies on the parent class (in a CompositeLog sense, not OO sense)to provide the info. However, since a ProcessInstanceCreateLog as no parent then the actorId is null. Now what do I do if I want to know who started the process, if the actorId is not persisted? I ended up writing a custom Log class but is there another way?
(Oh yeah, I know I should've checked the log table a long time ago to realise the actorId is not persisted ; )