11 Replies Latest reply on Feb 25, 2010 3:57 PM by kukeltje

    jBPM4 History/Log implementation.

    shekharv

      yet another post related to jbpm4 history. :P

      This one is related to the overall roadmap/approach towards logging historical information.

      Auditing and History information is one of the more critical pieces of data that needs to be persisted as part of the workflow processes.

      So I was wondering what the plan was towards supporting some of that stuff,

      eg:
      1.) A task is re-assigned from 'PersonA' to 'PersonB' by 'PersonC' on 'Date1'.
      2.) The DueDate of a Task is changed from 'date1' to 'date2'.
      3.) Priority of a Task is changed from 'NORMAL' to HIGH.

      Now in v3, some of these could be tracked using things like the TaskAssignLog.

      There is no way to do that in jbpm4, as yet. The current approach tracks and store historical activities/tasks, but does not store any changes that might have been made to the actual task/activity except for the fact that it is completed. Changes to the activities themselves are not recorded.

      IS there any plan/thought as to how that will be done?

        • 1. Re: jBPM4 History/Log implementation.
          tom.baeyens

          certainly it is our ambition to realize these capabilities in 4.1 or 4.2.

          the most difficult part will be to manage DB schema and data migration as we build out those features.

          How we'll tacke that will still have to be figured out in the next 2 months.

          • 2. Re: jBPM4 History/Log implementation.
            tom.baeyens

            i've created https://jira.jboss.org/jira/browse/JBPM-2393

            you can keep track of progress there

            • 3. Re: jBPM4 History/Log implementation.
              shekharv

              Tom,
              I've had only a few minutes of looking at the recent changes, and they look great!

              Just wanted to drop in the line to appreciate the quick response,

              • 4. Re: jBPM4 History/Log implementation.
                tom.baeyens

                shekharv, a big thanks for bringing that up. now, with these last additions, i feel that jbpm 4 is ready to stand up and be a respected replacement for jbpm 3.

                keep pushing us! you're contribution of signalling this vital hole was really great.

                • 5. Re: jBPM4 History/Log implementation.
                  kukeltje

                  Shekharv,

                  Not only this contribution is appreciated, but also the contribution on helping out in the user forum. Oh and the 'thank you' above also helps :-)

                  Ronald

                  • 6. Re: jBPM4 History/Log implementation.
                    shekharv

                    Thanks Guys,

                    Ronald, kudos to your great work manning the forums single handedly for what seems to be a long time!

                    • 7. Re: jBPM4 History/Log implementation.
                      kukeltje

                      You are welcome. I just hope someone can give me my total number of posts some day. Should be around 10.000 I think

                      • 8. Re: jBPM4 History/Log implementation.

                        Hi,

                        I noticed that whenever fields like duedate on a task are changed, the dbversion column gets incremented. However there's no entry in history detail table to see old and new values.


                        Also in history task impl class we may be losing reference to detail before persisting it.

                        
                         public void updated(TaskImpl task) {
                         if ( (assignee==null && task.getAssignee()!=null)
                         || (assignee!=null) && (!assignee.equals(task.getAssignee()))
                         ) {
                         addDetail(new HistoryTaskAssignmentImpl(assignee, task.getAssignee()));
                         this.assignee = task.getAssignee();
                         }
                         if (priority!=task.getPriority()) {
                         addDetail(new HistoryPriorityUpdateImpl(priority, task.getPriority()));
                         this.priority = task.getPriority();
                         }
                         if ( (duedate==null && task.getDuedate()!=null)
                         || (duedate!=null) && (!duedate.equals(task.getDuedate()))
                         ) {
                         addDetail(new HistoryTaskDuedateUpdateImpl(duedate, task.getDuedate()));
                         this.duedate = task.getDuedate();
                         }
                         }
                        
                         // details //////////////////////////////////////////////////////////////////
                        
                        
                        public void addDetail(HistoryDetailImpl detail) {
                         detail.setHistoryTask(this, nextDetailIndex);
                         nextDetailIndex++;
                         }
                        
                        


                        Env:
                        jbpm 4.0
                        jboss 5.1.0
                        Oracle 10g
                        


                        • 9. Re: jBPM4 History/Log implementation.
                          kukeltje

                          please add this kind of info in the jira issue corresponding history updates

                          • 10. Re: jBPM4 History/Log implementation.

                            Bug !!!

                            JBPM version : 4.4-SNAPSHOT

                            org.jbpm.pvm.internal.history.model.HistoryTaskImpl

                             

                            Newly created HistoryDetail  is not added to the collection of the HistoryTaskImpl(Highlighted).

                             

                            public void updated(TaskImpl task) {
                                if ( (assignee==null && task.getAssignee()!=null)
                                     || (assignee!=null) && (!assignee.equals(task.getAssignee()))
                                   ) {
                                  addDetail(new HistoryTaskAssignmentImpl(assignee, task.getAssignee()));
                                  this.assignee = task.getAssignee();
                                }
                                if (priority!=task.getPriority()) {
                                  addDetail(new HistoryPriorityUpdateImpl(priority, task.getPriority()));
                                  this.priority = task.getPriority();
                                }
                                if ( (duedate==null && task.getDuedate()!=null)
                                     || (duedate!=null) && (!duedate.equals(task.getDuedate()))
                                   ) {
                                  addDetail(new HistoryTaskDuedateUpdateImpl(duedate, task.getDuedate()));
                                  this.duedate = task.getDuedate();
                                }
                              }

                             

                              // details //////////////////////////////////////////////////////////////////
                             
                              public void addDetail(HistoryDetailImpl detail) {
                                detail.setHistoryTask(this, nextDetailIndex);
                               details.add(detail);
                                nextDetailIndex++;
                              }

                            • 11. Re: jBPM4 History/Log implementation.
                              kukeltje
                              See my previous answer... add this kind of info to the issue in jira...