- 
        1. Re: History detailsrebody Jul 20, 2010 8:43 PM (in response to swiderski.maciej)Hi Maciej, Glad to hear that you will work on this issue. This will be a big important feature in jBPM-4.5. Here is some requirements that I met. 1.need retrieve sub process instance and super process instance relationship from history 2.need know the starter of a process instance 3.retrive task name from history task. refer: https://jira.jboss.org/browse/JBPM-2896 4.need query all of history tasks of a process instance. Cheers. 
- 
        2. Re: History detailsmwohlf Jul 21, 2010 3:50 AM (in response to swiderski.maciej)I have some requirement regarding the HistoryTaskImpl, basically this is what https://jira.jboss.org/browse/JBPM-2896 is all about, just want to sum it up here: - the duedate property in HistoryTaskImpl is handled in the constructor and copied over from TaskImpl, just having this mapped to a database field would be nice. Something along the line of adding <property name="duedate" column="DUEDATE_" type="timestamp" /> in jbm.history.hbm.xml (and a setter and getter for this)
- I would like to have the name of the task stored in the HistoryTaskImpl tabel too, it seems easy to implement, copy over in the contructor from TaskImpl and map to a database field.
- I would like to be able to query all HistoryTasks for a certain ProcessInstance, I am not sure how this can be implemented in a smart way. There is a property "executionId" which might be helpfull for this but it seems this is not fully implemented yet, so I am open for any good ideas here
 thanks for looking into this 
- 
        3. Re: History detailsmwohlf Jul 21, 2010 5:13 AM (in response to swiderski.maciej)in HistoryProcessInstanceImpl i would like to have a setter for the key: public void setKey(String key) { 
 this.key = key;
 }i am assigning a business key after the process already started and is stored in the history table so having this method would simplify things for me. Since there is a setter for the state property too I don't think this is a big deal... cheers Michael 
- 
        4. Re: History detailsswiderski.maciej Aug 16, 2010 9:50 AM (in response to mwohlf)Michael Wohlfart wrote: - I would like to be able to query all HistoryTasks for a certain ProcessInstance, I am not sure how this can be implemented in a smart way. There is a property "executionId" which might be helpfull for this but it seems this is not fully implemented yet, so I am open for any good ideas here
 I implemented that by joining HistoryTask with HistoryActivityInstance to narrow down for a particular process instance id. Since entire history is not yet finished I don't have complete solution, but if someone is interested I could extract this as a patch for a review. 
- 
        5. Re: History detailsrebody Aug 16, 2010 8:20 PM (in response to swiderski.maciej)Hi Maciej, Many of our customers want to know how to get the previous/next activity of a process. Part of this feature should be done by history service. Could we support this feature in the next version? Regards. 
- 
        6. Re: History detailsswiderski.maciej Aug 18, 2010 3:29 AM (in response to rebody)Hi HuiSheng, if it comes to previous activity you can find them using already available HistoryActivityInstanceQuery. The only disadvantage is that you will get both already finished and active activities. What we could do here is to introduce new parameter to narrow down the search to finished activities only, so result will have all activities that the process has already completed. What do you think about it? 
- 
        7. Re: History detailsrebody Aug 18, 2010 10:07 AM (in response to swiderski.maciej)Hi Maciej, I think it is enough for now. And it would be better to provide related documents. 
- 
        8. Re: History detailsswiderski.maciej Aug 26, 2010 7:02 AM (in response to rebody)Hi guys, please take a look at follwoing jira issue and last comment JBPM-2398 and let me know what do you think Cheers Maciej 
- 
        9. Re: History detailsmwohlf Aug 26, 2010 8:30 AM (in response to swiderski.maciej)looks good to me, do you need all those lazy="false" in jbpm.history.hbm.xml? My tests run fine without them but I am using a different hibernate version :-/ 
- 
        10. Re: History detailsswiderski.maciej Aug 26, 2010 9:04 AM (in response to mwohlf)In fact I set it to be able to get access to some information that are related to the detail, for example variable name when getting all variable updates. When I removed them and rerun the tests, following failed: Test set: org.jbpm.test.query.HistoryDetailQueryTest ------------------------------------------------------------------------------- Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.328 sec <<< FAILURE! testHistoryVariable(org.jbpm.test.query.HistoryDetailQueryTest) Time elapsed: 0.047 sec <<< ERROR! org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:86) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) at org.jbpm.pvm.internal.history.model.HistoryVariableImpl_$$_javassist_39.getVariableName(HistoryVariableImpl_$$_javassist_39.java) at org.jbpm.pvm.internal.history.model.HistoryVariableUpdateImpl.toString(HistoryVariableUpdateImpl.java:49) at org.jbpm.test.query.HistoryDetailQueryTest.testHistoryVariable(HistoryDetailQueryTest.java:186) After additional review it seems like it is required mainly for variable stuff since it uses persistent fields (to get variable name). Most likely is not required for others, the API is not too verbose in that matter. 
- 
        11. Re: History detailsmwohlf Aug 26, 2010 10:05 AM (in response to swiderski.maciej)I don't have line 186 in my HistoryDetailQueryTest :-/ 
- 
        12. Re: History detailsswiderski.maciej Aug 27, 2010 2:32 AM (in response to mwohlf)Yeap. my mistake forgot to include these tests in the patch. Here comes the link to updated patch: https://jira.jboss.org/secure/attachment/12336598/history-detail-20100827.patch I modified it a bit to leave only lazy='false' for variables. Huge thanks for reviewing. 
- 
        13. Re: History detailsmwohlf Aug 27, 2010 4:17 AM (in response to swiderski.maciej)great work, thanks a lot, can't wait to use the history stuff just to summarize the schema changes somewhere, we now have the following new fields in the database: JBPM4_EXECUTION.INITIATOR_ JBPM4_HIST_PROCINST.INITIATOR_ JBPM4_HIST_PROCINST.SUPERPROCID_ JBPM4_HIST_TASK.NAME_ JBPM4_HIST_TASK.DUEDATE_ 
- 
        14. Re: History detailsswiderski.maciej Aug 27, 2010 4:27 AM (in response to mwohlf)Thanks, similar summary is in jira as well. If no one will have objections I will commit it beginning of next week. 
 
     
    