2 Replies Latest reply on Oct 3, 2011 3:54 AM by heathcliff

    How to add Listory logger

    heathcliff

      As many ppl see that jbpm-console have problems with JBPM history logger I would like to ask You all to tell how to add such logger to the application. You have probably used it with your projects.

       

      I'm gonna add it than to my jbpm console and compile. I need it very much and its urgent issue for me so I will be gratefull for help.

        • 1. Re: How to add Listory logger
          swiderski.maciej

          One fundamental question - are you referring to the problem of viewing history or storing history log?

          • 2. Re: How to add Listory logger
            heathcliff

            Ok So here is what I found. History service doesnt work since few versions so forget aboute it.

             

            BUT if you wont history to be stored when you use jbpm-console then modify CommandDelegate.java :

             

            private StatefulKnowledgeSession getSession() {

                    if (ksession == null) {

                        ksession = newStatefulKnowledgeSession();

                        new JPAWorkingMemoryDbLogger(ksession);//this is new line!!!

                    }

                    return ksession;

                }

             

            modify persistence.xml in gwt server:

            <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

            <class>org.drools.persistence.info.SessionInfo</class>

            <class>org.drools.persistence.info.WorkItemInfo</class>

            <class>org.jbpm.process.audit.ProcessInstanceLog</class>

            <class>org.jbpm.process.audit.NodeInstanceLog</class>

            <class>org.jbpm.process.audit.VariableInstanceLog</class>

             

            persistence.xml from sources is wrong, this is fixed by installation with copying psersistence.xml from installations /db/ folder. If you apply my fix you will have both history and working source code.

             

            To make it work:

            Download sources. extract somewhere.

            Download demo.

            modify build.properties and set birt to true

            ant install.demo

            open eclipse. install macen plugin.

            create new java project with name "jbpm".

            Copy jbpm sources to eclipses jbpm project, refresh project.

            Set source folders in project props to every folder in the whole folder tree that has name sth like /src/main/java.

            Right click on project, configure and make this project maven project.

            Run as maven build ... . goal "clean install" check skipTests.

            Apply but dont run.

            Modify persistence.xml

            modify CommandDelegate.java

            modify all persistence.xml files and set it to some other db like mysql.

            modify ./jboss GA/servers/default/deploy/testDS1-ds.xml to other db.

            modify hibernate.cfg.xml to use other db.

            run as... button arrow and check your maven configuration you made before. this should finish with all success.

            from console server directory somewhere under target dirrectory there is new and ready war file.

            copy server war file to ./jboss GA/servers/default/deploy/ and replace old one. remember to delete old one and than remove version name from the file name.

            modify build.xml and remove start.eclipse from start.demo

            ant start.demo

            open browser and run once evaluation process from console.

            connect to db you setup the connection in project.

            check tables and rows. history should be there.

             

            REMEMBER TO NOT RUN JBOSS BEFORE YOU DO ALL ABOVE STEPPS. idk why but onec I run jboss he doesnt see any modifications i make... im not good in server administration.

             

            In case of any problems send me private message.

             

            I will try to fix jbpm_history_logger but no promises... this is broken since jbpm4.