Advertisement

jBPM5 in action - a quickstart for developers

jBPM Project Lead at JBoss, Red Hat
May. 6, 2011
Advertisement

More Related Content

Slideshows for you(20)

Advertisement
Advertisement

jBPM5 in action - a quickstart for developers

  1.  
  2. jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer
  3. Why BPM?
  4. Getting started with jBPM5
  5. Testing, debugging, deploying
  6. Integrating in your architecture
  7. Persistence and transactions
  8. Console
  9. What is BPM? A business process is a process that describes the order in which a series of steps need to be executed, using a flow chart. Business Process Management
  10. Monitoring
  11. Speed of development
  12. Increased agility
  13. Getting started with jBPM5 !
  14. targeting developers and business users
  15. collaboration, management and monitoring using web-based consoles
  16. powerful rules and event integration
  17. lightweight
  18. embeddable
  19. generic, extensible Core Engine
  20. Core Engine Knowledge Base Stateful Knowledge Session Process Definition Process Instance
  21. BPMN 2.0 Example < definitions ... > < process id=&quot;com.sample.bpmn.hello&quot; name=&quot;Hello World&quot; > < startEvent id=&quot;_1&quot; name=&quot;StartProcess&quot; /> < sequenceFlow sourceRef=&quot;_1&quot; targetRef=&quot;_2&quot; /> < scriptTask id=&quot;_2&quot; name=&quot;Hello&quot; > < script >System.out.println(&quot;Hello World&quot;);</ script > </ scriptTask > < sequenceFlow sourceRef=&quot;_2&quot; targetRef=&quot;_3&quot; /> < endEvent id=&quot;_3&quot; name=&quot;EndProcess&quot; /> </ process > </ definitions > < definitions ... > < process id=&quot;com.sample.bpmn.hello&quot; name=&quot;Hello World&quot; > < startEvent id=&quot;_1&quot; name=&quot;StartProcess&quot; /> < sequenceFlow sourceRef=&quot;_1&quot; targetRef=&quot;_2&quot; /> < scriptTask id=&quot;_2&quot; name=&quot;Hello&quot; > < script >System.out.println(&quot;Hello World&quot;);</ script > </ scriptTask > < sequenceFlow sourceRef=&quot;_2&quot; targetRef=&quot;_3&quot; /> < endEvent id=&quot;_3&quot; name=&quot;EndProcess&quot; /> </ process > </ definitions >
  22. startProcess(processId, parameters)
  23. signalEvent(type, event)
  24. signalEvent(type, event, instanceId)
  25. abortProcessInstance(instanceId)
  26. getProcessInstance(instanceId)
  27. Java Example // (1) Create knowledge base and add process definition KnowledgeBuilder kbuilder = ... kbuilder.add( ..., &quot;sample.bpmn&quot;, ResourceType.BPMN2); KnowledgeBase kbase = kbuilder.newKnowledgeBase(); // (2) Create new stateful knowledge session StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); // (3) Start a new process instance ksession.startProcess(“com.sample.bpmn.hello”);
  28. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  29. runtime binding
  30. Example: Notification [ [ &quot; name &quot; : &quot;Notification&quot;, &quot; parameters &quot; : [ &quot;Message&quot; : new StringDataType(), &quot;From&quot; : new StringDataType(), &quot;To&quot; : new StringDataType(), &quot;Priority&quot; : new StringDataType(), ], &quot; displayName &quot; : &quot;Notification&quot;, &quot; icon &quot; : &quot;icons/notification.gif&quot; ] ]
  31. Example: Notification class NotificationHandler implements WorkItemHandler { public void executeWorkItem(WorkItem wI, WorkItemManager manager) { String from = (String) wI. getParameter (&quot;From&quot;); String to = (String) wI. getParameter (&quot;To&quot;); String m = (String) wI. getParameter (&quot;Message&quot;); // send email EmailService service = ...; service.sendEmail(from, to, &quot;Notification&quot;, m); manager. completeWorkItem (wI.getId(), null); } }
  32. Human Task Service public void start( long taskId, String userId, .. ) public void stop( long taskId, String userId, .. ) public void release( long taskId, String userId, .. ) public void suspend( long taskId, String userId, .. ) public void resume( long taskId, String userId, .. ) public void skip( long taskId, String userId, .. ) public void delegate( long taskId, String userId,  String targetUserId, .. ) public void complete( long taskId, String userId,  ContentData outputData, .. )
  33. Testing, debugging, deploying, etc.
  34. Model Deploy Execute Monitor Analyze Life Cycle Mining Analysis Optimization Simulation Testing Design Monitoring Reporting Execution Integration Deployment Management Audit Human Interaction Collaboration
  35. JUnit Testing public class MyProcessTest extends JbpmJUnitTestCase { public void testProcess() { StatefulKnowledgeSession ksession = createKnowledgeSession (&quot;sample.bpmn&quot;); ProcessInstance pI = ksession. startProcess (&quot;com.sample.bpmn.hello&quot;); assertProcessInstanceCompleted (pI.getId(), ksession); assertNodeTriggered (pI.getId(), &quot;StartProcess&quot;, &quot;Hello&quot;, &quot;EndProcess&quot;); } }
  36. Debugging
  37. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  38. Task and process forms
  39. Build, deploy, test, manage and collaboration features
  40. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  41. Integrating in your Architecture
  42. Command-based
  43. REST service
  44. Web service
  45. REST API
  46. Integration
  47. Integration
  48. Integration
  49. Integration
  50. Persistence and Transactions
  51. History logging
  52. User-defined
  53. Persistence ProcessInstanceInfo ProcessInstanceLog NodeInstanceLog
  54. User Transactions Environment env = KnowledgeBaseFactory.newEnvironment(); env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() ); UserTransaction ut = (UserTransaction) new InitialContext().lookup(&quot;java:comp/UserTransaction&quot;); ut.begin(); // do stuff here, e.g. ksession.startProcess(..) ut.commit();
  55. Console
  56. Business user
  57. User task lists / forms
  58. Reporting
  59. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  60. Source http://github.com/droolsjbpm/jbpm
  61. Hudson http://hudson.jboss.org/hudson/job/jBPM
  62. Blog http://kverlaen.blogspot.com/
  63. #jbpm on irc.codehaus.org
  64. [email_address]
  65. jBPM user forum
  66. jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer
Advertisement