2 Replies Latest reply on Jun 20, 2012 7:46 AM by Ashish Kumar

    Regarding Log file

    Ashish Kumar Newbie

      Hello,

       

        I am using JBPM 5.2 version.I am unable to find the log file for the process that I execute.I can create a log file in the process itself but I want to find out if any log file is produced by the tool itself for monitoring the processes as in case of other tools so that we can monitor the errors that arises during the execution.

       

      thanks and Regards

        • 1. Re: Regarding Log file
          Zenoviy Veres Newbie

          How are you executing the process?

          • 2. Re: Regarding Log file
            Ashish Kumar Newbie

            I dont know the exact way to execute it but I was following the steps given in towards the end of chapter 7 of jBPM docs given in the jboss site.

            For your reference I am giving the code below.Kindly look into it and give some suggestions.

             

            Also tell me wheather I can find any autogenerated log file as we find in other tools like savvion to monitor the process.


            package sample;
            import org.drools.KnowledgeBase;
            import org.drools.KnowledgeBaseFactory;
            import org.drools.builder.KnowledgeBuilder;
            import org.drools.builder.KnowledgeBuilderFactory;
            import org.drools.builder.ResourceType;
            import org.drools.io.ResourceFactory;
            import org.drools.persistence.jpa.JPAKnowledgeService;
            import org.drools.runtime.StatefulKnowledgeSession;
            import org.jbpm.process.audit.JPAWorkingMemoryDbLogger;
            //import org.jbpm.test.JBPMHelper;


            public class historyLog  {

            /**
              * @param args
              */
            public static void main(String[] args)  throws Exception {
              // TODO Auto-generated method stub
              //JBPMHelper.startH2Server();
              //JBPMHelper.setupDataSource();
             
              //EntityManagerFactory emf =
              //    Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );


              org.drools.runtime.Environment env = KnowledgeBaseFactory.newEnvironment();
              KnowledgeBase kbase = readKnowledgeBase();
             
              //StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
              //JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);


              StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
              JPAWorkingMemoryDbLogger jbpmLogger = new JPAWorkingMemoryDbLogger(ksession);
              ksession.startProcess("sample.bpmn.hh");
             
             
              
             
              
              // do stuff (start processes, etc...)
              
              jbpmLogger.dispose();


              //logger.dispose();
            }

             

            private static KnowledgeBase readKnowledgeBase() throws Exception {
              KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
              kbuilder.add(ResourceFactory.newClassPathResource("demo2.bpmn"), ResourceType.BPMN2);
              return kbuilder.newKnowledgeBase();
            }

            }