jBPM5 in action - a quickstart for developers
Upcoming SlideShare
Loading in...5
×
 

jBPM5 in action - a quickstart for developers

on

  • 10,190 views

jBPM5 presentation at JUDCon

jBPM5 presentation at JUDCon

Statistics

Views

Total Views
10,190
Views on SlideShare
10,190
Embed Views
0

Actions

Likes
6
Downloads
360
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

jBPM5 in action - a quickstart for developers jBPM5 in action - a quickstart for developers Presentation Transcript

  •  
  • jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer
  • Overview
    • What is (j)BPM?
    • Why BPM?
    • Getting started with jBPM5
    • Testing, debugging, deploying
    • Integrating in your architecture
    • Persistence and transactions
    • Console
  • 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
  • Why BPM?
    • Visibility
    • Monitoring
    • Higher-level
    • Continuous improvement
    • Speed of development
    • Increased agility
  • Getting started with jBPM5 !
  • Key Characteristics of jBPM5
    • Open-source business process management project offering:
      • generic process engine supporting native BPMN 2.0 execution
      • targeting developers and business users
      • collaboration, management and monitoring using web-based consoles
      • powerful rules and event integration
  • From Workflow to BPM
    • Core engine is a workflow engine in pure Java
      • state transitions
      • lightweight
      • embeddable
      • generic, extensible
    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; > < 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 >
  • Java Interface ProcessRuntime interface
    • startProcess(processId)
    • startProcess(processId, parameters)
    • signalEvent(type, event)
    • signalEvent(type, event, instanceId)
    • abortProcessInstance(instanceId)
    • getProcessInstance(instanceId)
  • 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”);
  • TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  • Domain-specific Processes
    • Extend palette with domain-specific, declarative service nodes
      • define input / output parameters
      • runtime binding
  • 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; ] ]
  • 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); } }
  • Human task service
    • User task
    • Human task service (WS-HT)
      • Task lists
      • Task life cycle
    • Task clients
      • Task forms
  • 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, .. )
  • Testing, debugging, deploying, etc.
  • Model Deploy Execute Monitor Analyze Life Cycle Mining Analysis Optimization Simulation Testing Design Monitoring Reporting Execution Integration Deployment Management Audit Human Interaction Collaboration
  • 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;); } }
  • Debugging
  • TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  • Guvnor
    • Guvnor as knowledge repository
      • BPMN2 processes
      • Task and process forms
      • Model
    • Web-based process editor (Oryx)
    • Build, deploy, test, manage and collaboration features
  • TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  • Integrating in your Architecture
  • Architecture
    • From “embedded” to “as a service”
    • Command-based
    • Different underlying technologies
      • Java component (embedded, JNDI)
      • REST service
      • Web service
      • EJB
    • # of (independent) session
  • REST API
  • Integration
  • Integration
  • Integration
  • Integration
  • Persistence and Transactions
  • Persistence and Transactions
    • Persistence (JPA, pluggable)
      • Runtime persistence
      • History logging
      • Services
    • Transactions (JTA, pluggable)
      • Command-scoped
      • User-defined
  • Persistence
    • Create a persistent knowledge session
    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);
  • Persistence ProcessInstanceInfo ProcessInstanceLog NodeInstanceLog
  • 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();
  • Console
  • Console
    • Web-based management
    • Business user
    • Features
      • Process instance management
      • User task lists / forms
      • Reporting
  • TITLE SLIDE: HEADLINE Presenter name Title, Red Hat Date Demo
  • jBPM5: What, where?
    • jBPM home page
    • Source http://github.com/droolsjbpm/jbpm
    • Hudson http://hudson.jboss.org/hudson/job/jBPM
    • Blog http://kverlaen.blogspot.com/
    • #jbpm on irc.codehaus.org
    • [email_address]
    • jBPM user forum
  • jBPM5 in Action: A Quickstart for Developers Kris Verlaenen jBPM5 Lead Engineer