Read the documencation for the jbpm5 there are explenation on how it works and how to use it. Also fer topics before your post there was:
http://community.jboss.org/thread/166922?tstart=0
The jbpm-console is a good example of application that uses JBPM5