Here is an example that shows the required steps to create a HelloWorld example with jBPM5 plug-in in Eclipse.

First install jBPM5 plugin using the steps (http://community.jboss.org/people/bpmn2user/blog/2011/02/27/eclipse-plug-in-installation-for-jbpm5) or using the install script  (http://kverlaen.blogspot.com/2011/01/jbpm-50-released.html).

 

 

A simple example (http://people.redhat.com/kverlaen/jBPM5-guvnor-integration.swf) is considered here to show the features of jBPM5 eclipse plug-in.

'Hello Task' is created as follows. Attached files (HelloProcess.bpmn, HelloTask.ftl and Hello.ftl) can be imported into the HelloProcess project created in http://community.jboss.org/people/bpmn2user/blog/2011/02/27/eclipse-plug-in-installation-for-jbpm5.

 

 

 

ScreenHunter_06 Feb. 27 13.24.gif

 

The user form for the task 'HelloTask' is created using the pattern {TaskName}.ftl as shown below.

ScreenHunter_07 Feb. 27 13.24.gif

 

The 'HelloProcessTest.java' is created to read the 'HelloProcess.bpmn' file as shown below (also find the complete file as an attachement below):

 

 

 

public class HelloProcessTest {

 

 

 

public static final void main(String[] args) {
  try {

 

 

EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
         TaskService taskService  = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
        
         /*
          * Add the required users
          */
         TaskServiceSession taskSession = taskService.createSession();  
         taskSession.addUser(new User("Administrator"));
         taskSession.addUser(new User("krisv"));
        
         /* Start Mina server for HT*/
         MinaTaskServer server = new MinaTaskServer(taskService);
         Thread thread = new Thread(server);
         thread.start();
         System.out.println("Server started ...");
       
         /*Create the knowledge base for HelloProcss.bpmn */
         KnowledgeBase kbase = readKnowledgeBase();
   StatefulKnowledgeSession ksession = createSession(kbase);
   KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
  
   ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());

 

  
   System.out.println(" started the humantask");
   ksession.startProcess("Hello");

logger.close();

 

}

 

 

Select the 'Human Task View' using Window->ShowView->Drools Task->Human Task View. Start the program 'HelloProcessTest.java' and look for  the tasks using the userID 'krisv'. 'Hello Task' can then be selected to perform tasks such as 'Start', 'Complete' etc.

ScreenHunter_08 Feb. 27 14.50.gif