As said before, logs cannot be retrieved from the database by navigating
the LoggingInstance to its logs. Instead, logs of a process instance should always
be queried from the database. The LoggingSession
has 2 methods
that serve this purpose.
The first method retrieves all the logs for a process instance. These logs will be grouped by token in a Map. The map will associate a List of ProcessLogs with every Token in the process instance. The list will contain the ProcessLogs in the same ordered as they were created.
public class LoggingSession { ... public Map findLogsByProcessInstance(long processInstanceId) {...} ... }
The second method retrieves the logs for a specific Token. The returned list will contain the ProcessLogs in the same ordered as they were created.
public class LoggingSession { public List findLogsByToken(long tokenId) {...} ... }