JBoss Community

Re: jBPM5 running via a Web Interface

created by Khaleel Shaik in jBPM - View the full discussion



I hope now I am able to find out  a way and understand the scenario,  if any body can provide more details it would be great.


1.  Build your Process in Eclipse.

2.  Register this process with Drools repository  (see how to do it in the Chapter 16 http://docs.jboss.org/jbpm/v5.3/userguide/ch.process-repository.html ).

          (Right click on   your  Evaluation.bpmn process choose  Guvnor and then add   (provide the host and port and authentication credentials.)

3. Now you can browse the to see your deployed process at  bpmn-console  http://localhost:8080/jbpm-console/

4. Also you can see the same process in the govnor  http://localhost:8080/drools-guvnor

5. Invoke the process from the Web application Copy all the process  in some folder say  html-public/jbpmflows/ <Evalution.bpmn>  (you can copy all others flows here)

6. Use the following code with the URL that you can point to the process file as a simple static file


     private static KnowledgeBase readKnowledgeBase() throws Exception {

                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                    //kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);

                    //kbuilder.add(ResourceFactory.newUrlResource("file:///D:/Evaluation.bpmn"), ResourceType.BPMN2);

                    kbuilder.add(ResourceFactory.newUrlResource(new java.net.URL("http://<yourwebhost>:8080/webcontextroot/jbpm/Evaluation.bpmn")),         ResourceType.BPMN2);

                    return kbuilder.newKnowledgeBase();


7. submit your flow request to the host system where your flows were registered


      private static StatefulKnowledgeSession createKnowledgeSession(KnowledgeBase kbase) {

                    StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

                    HornetQHTWorkItemHandler humanTaskHandler = new HornetQHTWorkItemHandler(ksession);

                    humanTaskHandler.setIpAddress("");  //govnor host

                    humanTaskHandler.setPort(5445); //govnor port

                    ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);

                    return ksession;





-- Khaleel

Reply to this message by going to Community

Start a new discussion in jBPM at Community