jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer
Overview <ul><li>What is (j)BPM?
Why BPM?
Getting started with jBPM5
Testing, debugging, deploying
Integrating in your architecture
Persistence and transactions
Console </li></ul>
What is BPM? A  business process  is a process that describes the order in which a series of steps need to be executed, us...
Why BPM? <ul><li>Visibility
Monitoring
Higher-level </li></ul><ul><li>Continuous improvement
Speed of development
Increased agility </li></ul>
Getting started with jBPM5 !
Key Characteristics of jBPM5 <ul><li>Open-source business process management project offering: </li></ul><ul><ul><li>gener...
targeting developers and business users
collaboration, management and monitoring using web-based consoles
powerful rules and event integration </li></ul></ul>
From Workflow to BPM <ul><li>Core engine is a workflow engine in pure Java </li></ul><ul><ul><li>state transitions
lightweight
embeddable
generic, extensible </li></ul></ul>Core Engine
Core Engine Knowledge Base Stateful Knowledge Session Process Definition Process Instance
BPMN 2.0 Example < definitions  ... > < process  id=&quot;com.sample.bpmn.hello&quot; name=&quot;Hello World&quot; > < sta...
Java Interface ProcessRuntime interface <ul><li>startProcess(processId)
startProcess(processId, parameters)
signalEvent(type, event)
signalEvent(type, event, instanceId)
abortProcessInstance(instanceId)
getProcessInstance(instanceId)
… </li></ul>
Java Example // (1) Create knowledge base and add process definition KnowledgeBuilder kbuilder = ... kbuilder.add( ..., &q...
TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date   Demo
Domain-specific Processes <ul><li>Extend palette with domain-specific, declarative service nodes </li></ul><ul><ul><li>def...
runtime binding </li></ul></ul>
Example: Notification [ [ &quot; name &quot; : &quot;Notification&quot;, &quot; parameters &quot; : [ &quot;Message&quot; ...
Example: Notification class NotificationHandler implements  WorkItemHandler  { public void executeWorkItem(WorkItem wI,  W...
Human task service <ul><li>User task
Human task service (WS-HT) </li></ul><ul><ul><li>Task lists
Task life cycle </li></ul></ul><ul><li>Task clients </li></ul><ul><ul><li>Task forms </li></ul></ul>
Upcoming SlideShare
Loading in …5
×

jBPM5 in action - a quickstart for developers

10,186
-1

Published on

jBPM5 presentation at JUDCon

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
10,186
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
402
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

jBPM5 in action - a quickstart for developers

  1. 2. jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer
  2. 3. Overview <ul><li>What is (j)BPM?
  3. 4. Why BPM?
  4. 5. Getting started with jBPM5
  5. 6. Testing, debugging, deploying
  6. 7. Integrating in your architecture
  7. 8. Persistence and transactions
  8. 9. Console </li></ul>
  9. 10. 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. 11. Why BPM? <ul><li>Visibility
  11. 12. Monitoring
  12. 13. Higher-level </li></ul><ul><li>Continuous improvement
  13. 14. Speed of development
  14. 15. Increased agility </li></ul>
  15. 16. Getting started with jBPM5 !
  16. 17. Key Characteristics of jBPM5 <ul><li>Open-source business process management project offering: </li></ul><ul><ul><li>generic process engine supporting native BPMN 2.0 execution
  17. 18. targeting developers and business users
  18. 19. collaboration, management and monitoring using web-based consoles
  19. 20. powerful rules and event integration </li></ul></ul>
  20. 21. From Workflow to BPM <ul><li>Core engine is a workflow engine in pure Java </li></ul><ul><ul><li>state transitions
  21. 22. lightweight
  22. 23. embeddable
  23. 24. generic, extensible </li></ul></ul>Core Engine
  24. 25. Core Engine Knowledge Base Stateful Knowledge Session Process Definition Process Instance
  25. 26. 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 >
  26. 27. Java Interface ProcessRuntime interface <ul><li>startProcess(processId)
  27. 28. startProcess(processId, parameters)
  28. 29. signalEvent(type, event)
  29. 30. signalEvent(type, event, instanceId)
  30. 31. abortProcessInstance(instanceId)
  31. 32. getProcessInstance(instanceId)
  32. 33. … </li></ul>
  33. 34. 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”);
  34. 35. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  35. 36. Domain-specific Processes <ul><li>Extend palette with domain-specific, declarative service nodes </li></ul><ul><ul><li>define input / output parameters
  36. 37. runtime binding </li></ul></ul>
  37. 38. 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; ] ]
  38. 39. 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); } }
  39. 40. Human task service <ul><li>User task
  40. 41. Human task service (WS-HT) </li></ul><ul><ul><li>Task lists
  41. 42. Task life cycle </li></ul></ul><ul><li>Task clients </li></ul><ul><ul><li>Task forms </li></ul></ul>
  42. 43. 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, .. )
  43. 44. Testing, debugging, deploying, etc.
  44. 45. Model Deploy Execute Monitor Analyze Life Cycle Mining Analysis Optimization Simulation Testing Design Monitoring Reporting Execution Integration Deployment Management Audit Human Interaction Collaboration
  45. 46. 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;); } }
  46. 47. Debugging
  47. 48. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  48. 49. Guvnor <ul><li>Guvnor as knowledge repository </li></ul><ul><ul><li>BPMN2 processes
  49. 50. Task and process forms
  50. 51. Model </li></ul></ul><ul><li>Web-based process editor (Oryx)
  51. 52. Build, deploy, test, manage and collaboration features </li></ul>
  52. 53. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  53. 54. Integrating in your Architecture
  54. 55. Architecture <ul><li>From “embedded” to “as a service”
  55. 56. Command-based
  56. 57. Different underlying technologies </li><ul><li>Java component (embedded, JNDI)
  57. 58. REST service
  58. 59. Web service
  59. 60. EJB </li></ul><li># of (independent) session </li></ul>
  60. 61. REST API
  61. 62. Integration
  62. 63. Integration
  63. 64. Integration
  64. 65. Integration
  65. 66. Persistence and Transactions
  66. 67. Persistence and Transactions <ul><li>Persistence (JPA, pluggable) </li><ul><li>Runtime persistence
  67. 68. History logging
  68. 69. Services </li></ul><li>Transactions (JTA, pluggable) </li><ul><li>Command-scoped
  69. 70. User-defined </li></ul></ul>
  70. 71. Persistence <ul><li>Create a persistent knowledge session </li></ul>EntityManagerFactory emf = Persistence.createEntityManagerFactory( &quot;...&quot; ); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf ); StatefulKnowledgeSession ksession = JPAKnowledgeService . newStatefulKnowledgeSession( kbase, null, env ); JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger (ksession);
  71. 72. Persistence ProcessInstanceInfo ProcessInstanceLog NodeInstanceLog
  72. 73. 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();
  73. 74. Console
  74. 75. Console <ul><li>Web-based management
  75. 76. Business user
  76. 77. Features </li></ul><ul><ul><li>Process instance management
  77. 78. User task lists / forms
  78. 79. Reporting </li></ul></ul>
  79. 80. TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  80. 81. jBPM5: What, where? <ul><li>jBPM home page
  81. 82. Source http://github.com/droolsjbpm/jbpm
  82. 83. Hudson http://hudson.jboss.org/hudson/job/jBPM
  83. 84. Blog http://kverlaen.blogspot.com/
  84. 85. #jbpm on irc.codehaus.org
  85. 86. [email_address]
  86. 87. jBPM user forum </li></ul>
  87. 88. jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×