4 Replies Latest reply on Sep 10, 2008 1:53 PM by Ronald van Kuijk

    Process Logging Not Happening Correctly

    Chris Baxter Newbie

      I have a small issue that I was wondering if anyone could help with. I find that when I use the RemoteCommandService to interact with JBPM, not much (if anything at all) gets logged to the JBPM_LOG table. Here's the basic sequence that I'm doing. I start of with a StartProcessInstanceCommand to kick off my new process. The new process gets saved and a single line gets committed to the log table for the start of the process. Because I use the StartProcessInstanceCommand, the process gets moved off the start node and onto the first actual task node. Because of this, I was expecting more in the log table. If I start the process via the web console and signal the start token, I get much more in the log table. So next I use a TaskInstanceEndCommand to complete the active task. Again, the task gets completed and the DB is updated properly except that nothing gets logged to the log table again. Now, if I use the web console to perform the same action, everything gets logged to the log table as expected.

      So my question is this. Why does the logging not work correctly when I go in via the RemoteCommandService but does work correclty when I use the web console?

        • 1. Re: Process Logging Not Happening Correctly
          Marcus Schulte Newbie

          I've got a similar problem with jbpm-jpdl 3.2.1. Funnily, only variable instance changes are logged, nothing else. Maybe, there's some logging-configuration necessary which is not obvious from the docs?

          • 2. Re: Process Logging Not Happening Correctly
            Marcus Schulte Newbie

            For me, the solution was to explicitly call ProcessContext.save(ProcessInstance) before the end of each transactions. Obviously, some kinds of log-entries are not saved automatically via some cascading collection, but require explicit saving.

            • 3. Re: Process Logging Not Happening Correctly
              Petr Nejedly Newbie

              I have the same problem. When I create process via Seam annotation @CreateProcess, it creates the logs properly, when the process starts using LocalCommandService, it only logs the creation of the process and not the subsequent transitions and automated nodes.

              My jbpm.cfg.xml:

              
               <jbpm-context>
              
               <service name="persistence">
               <factory>
               <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
               <field name="isTransactionEnabled"><false/></field>
               </bean>
               </factory>
               </service>
              
               <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
               <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
               <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
               <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
               <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
               </jbpm-context>
              


              Hibernate cfg:

              <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
              
               <property name="show_sql">false</property>
               <property name="connection.datasource">java:/JbpmDS</property>
               <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
               <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
               <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
               <!-- <property name="hbm2ddl.auto">create-drop</property> -->
              
               <!--property name="transaction.flush_before_completion">true</property-->


              My process definition:

              
               <start-state name="start-state1">
               <transition to="automated node"></transition>
               </start-state>
              
              
               <node name="automated node">
               <action name="write to db 1" class="test.MyActionHandler"></action>
               <transition to="fork1"></transition>
               </node>
              


              My client code (in a Seam component):

               @Transactional
               public String startBusinessProcess() {
              
               try {
               InitialContext ic = new InitialContext();
               LocalCommandServiceHome serviceHome = (LocalCommandServiceHome)ic.lookup("java:ejb/CommandServiceBean");
               LocalCommandService service = serviceHome.create();
               StartProcessInstanceCommand command = new StartProcessInstanceCommand();
               command.setActorId(actor.getId());
               command.setKey("key");
               command.setProcessName("testProcess");
               service.execute( command );
               } catch (NamingException e) {
               e.printStackTrace();
               } catch (CreateException e) {
               e.printStackTrace();
               }
              
               return null;
               }
              


              Is it a configuration error (transaction setup?) or bug in the enterprise package? Anyone can help?

              Thanks,

              Petr

              • 4. Re: Process Logging Not Happening Correctly
                Ronald van Kuijk Master

                 

                Is it a configuration error (transaction setup?) or bug in the enterprise package?


                Might be either... Not sure how the transaction of the CommandServiceBean is configured in jBPM.