7 Replies Latest reply on Jan 5, 2008 9:44 AM by Ronald van Kuijk

    Log retrieval

    Vitaliy Newbie

      How can I retrieve Logs for the particular Date range. For one day or for a week.
      Now I can see only one way:
      Retrieve all logs and filter them

      List<ProcessLog> getProcessLogsByDate(ProcessInstance processInstance, Date from, Date to) {
       List<ProcessLog> filtredLogs = new ArrayList<ProcessLog>();
       List logs = processInstance.getLoggingInstance().getLogs(ProcessLog.class);
       for (Iterator i = logs.iterator(); i.hasNext();) {
       ProcessLog processLog = (ProcessLog) i.next();
       if (processLog.getDate().after(from) && processLog.getDate().before(to)) {
       filtredLogs.add(processLog);
       }
       }
       return filtredLogs;
       }
      



        • 1. Re: Log retrieval
          Ronald van Kuijk Master

          or write a custom hibernate query

          • 2. Re: Log retrieval
            Vitaliy Newbie

            And what about upward compatibility?
            Is it possible to include in jBPM API
            getLogs(Class class,Date from, Date to)
            function calling "custom hibernate query" - I'll provide such query.

            • 3. Re: Log retrieval
              Ronald van Kuijk Master

              It is possible to include everything in the jBPM API, but keep in mind that:
              - for everything we include, it shoud perform great, so probably additional indexes which in turn reduce performance (updating indexes takes time)
              - Many of these kinds of queries reduce the performance overall since the DB can get busy
              - It probably is more for BI like things so an additional DB is probably better

              So it's not that trivial and yes backwards compatibility is a factor, but beneath the api is still a 'custom query' ;-)

              You could file a Jira issue and see what the core team thinks of it.

              • 4. Re: Log retrieval
                Vitaliy Newbie

                My task is to provide the interface for ETL soft (Pentaho, Jasper or Talend) in order to retrieve information stored in jBPM logs. I don't want to use jBPM db tables directly, because, you know, when you're running out of API, you must be running in the wrong direction.
                So this log retrieval interface is planning to be used only once per day or even per week. And it should not perform greate because automated ETL process can wait.
                And yes BI - the end chain of jBPM->SomeInterface->ETL->BI - uses separate db even separate server.

                • 5. Re: Log retrieval
                  Ronald van Kuijk Master

                  So for you it does not have to perform great ok, so you do not need an index? I think you do since otherwise it will make the general DB slow. And even if you do not need an index, if this is in the API, others will start using it and complain about performance.

                  For now I'd still suggest using custom queries and if you want, create a custom extension. IMO it's not always completely wrong if you do things outside the api.
                  Besides that, I think it is still good to file a Jira issue to get this clear.

                  Oh.. btw... jBPM is also looking into BI/BAM, look in the developer forum. Maybe we can join forces?

                  • 6. Re: Log retrieval
                    Vitaliy Newbie

                    I've found that WS front end is already in work - http://jira.jboss.com/jira/browse/JBPM-718
                    so I suggesthttp://jira.jboss.com/jira/browse/JBPM-1108 just to add some functions that would make life easier for lots of developers by standardization of log data retrieval process. And besides most ETL products already have WS components.

                    • 7. Re: Log retrieval
                      Ronald van Kuijk Master

                      log retrieval will not ber supported via the ws interface, at least not initially.