2 Replies Latest reply on Apr 11, 2014 1:56 AM by Rahul Magdum

    How to disable audit logging in jBPM 6?

    Rahul Magdum Novice

      Hi,
      While using jBPM 6 with MySQL ( with persistence enabled ), jBPM 6 logs are logged to processinstancelog, variableinstancelog and nodeinstancelog tables.
      Is there any way to disable this history logging?

      or with persistence enabled it can not be disabled?

       

      Thanks,
      Rahul

        • 1. Re: How to disable audit logging in jBPM 6?
          Rahul Magdum Novice

          Hi,
          salaboy21 swiderski.maciej

          is this possible to disable this when persistence enabled?

           

          Thanks,
          Rahul

          • 2. Re: How to disable audit logging in jBPM 6?
            Rahul Magdum Novice

            Disabled logging by extending SimpleRegisterableItemsFactory class.

            historyEnabled = false;

            public class CustomLogFactory extends SimpleRegisterableItemsFactory {

            .

            .

            @Override

                public List<ProcessEventListener> getProcessEventListeners(RuntimeEngine runtime) {

                    List<ProcessEventListener> defaultListeners = new ArrayList<ProcessEventListener>();

                    // register JPAWorkingMemoryDBLogger

                   if(historyEnabled){

                        AbstractAuditLogger logger = AuditLoggerFactory.newJPAInstance(runtime.getKieSession().getEnvironment());

                        logger.setBuilder(getAuditBuilder(runtime));

                        defaultListeners.add(logger);

                    }

                    // add any custom listeners

                    defaultListeners.addAll(super.getProcessEventListeners(runtime));

                    return defaultListeners;

                }

            .

            .

            }

            and registered this class object to environment.

            CustomLogFactory logFactory = new CustomLogFactory();

            environment = RuntimeEnvironmentBuilder.Factory.get()

                                .newDefaultBuilder()

                                .entityManagerFactory(Persistence.createEntityManagerFactory(Benchmark.persistenceUnit))

                                .userGroupCallback(new JBossUserGroupCallbackImpl("classpath:/usergroup.properties"))

                                .registerableItemsFactory(logFactory)

                                .addAsset(ResourceFactory.newClassPathResource("process01.bpmn20.xml"), ResourceType.BPMN2)

                                .get();


            Thanks,
            Rahul