Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

jBPM6 Updates


Published on

Overview of some jBPM6 updates

Published in: Technology
  • Dating direct: ❶❶❶ ❶❶❶
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❤❤❤ ❤❤❤
    Are you sure you want to  Yes  No
    Your message goes here
  • How do we integrate a jsf web application with jbpm 6?
    Any help would be thankful
    Are you sure you want to  Yes  No
    Your message goes here
  • is there a REST client example similar to what is on page 21 for sending the complex data note don page 19?
    Are you sure you want to  Yes  No
    Your message goes here

jBPM6 Updates

  1. 1. jBPM5: Bringing more Power jBPM6 (API): to your Business Updates Processes Kris Verlaenen jBPM Project Lead September, 2013 1
  2. 2. vs jBPM5 API? • 2 important interfaces – KieSession (ProcessRuntime) – TaskService • kjars, mavenized – Now also contains forms, data model, etc. • RuntimeManager • jBPM Services (CDI) • Remote (REST / JMS) API
  3. 3. Session Management • Runtime Manager – Local KieSession, local TaskService • Hides setup complexity – Manages sessions • Singleton session • Session per request • Session per process instance – Disposal
  4. 4. Session Management Example RuntimeManager manager = RuntimeManagerFactory.Factory.get() .newPerProcessInstanceRuntimeManager(environment); RuntimeEngine runtime = manager.getRuntimeEngine( ProcessInstanceIdContext.get(id)); KieSession ksession = runtime.getKieSession(); // do something here, e.g. ksession.startProcess(“org.jbpm.hello”); manager.disposeRuntimeEngine(engine); manager.close();
  5. 5. Example1: Singleton session on multiple nodes Node1 Runtime Manager Kie Session Task Service Request1 Request2 PrInst1 PrInst2 Request3 Node2 Runtime Manager Kie Session Task Service
  6. 6. Example2: Session per process instance on multiple nodes Kie Session Runtime Manager Task Service Node1 Kie Session Task Service Request1 Request2 PrInst1 PrInst2 Request3 Node2 Runtime Manager Kie Session Task Service
  7. 7. jBPM Services (CDI) • Inject services into your CDI environment @Inject @Singleton RuntimeManager singletonManager; @Inject TaskService taskService; • Need to configure (@Produces) EMF, environment, usergroupcallback
  8. 8. Timer Management • Shared Timer Service – One timer service per RuntimeManager, manages timers of all sessions – Restores sessions if timer fires • No need anymore to keep sessions alive • Using Quartz – Timers persisted in database – Clustering • Timer will only fire on one and exactly one node
  9. 9. Clustering • Clustering for – High availability – Load balancing • Because – All data always persisted in database – Any node in the cluster can execute any request – Distributed timers
  10. 10. Clustering
  11. 11. Clustering • UberFire provides VFS clustering, using – Apache Zookeeper (distributed management) – Apache Helix (cluster management)
  12. 12. Clustering • jBPM Execution Server manages runtime data (RuntimeManager) – Database for synchronization • Session mgmt • Process instance mgmt • Task mgmt – Quartz for distributed timers
  13. 13. Execution Server • RuntimeManager, TaskService (and much more) • Exposed through CDI • Remoting – REST, JMS • Clustered deployment • Part of kie-wb
  14. 14. kjar Approach • Execution server can load different kbases – One runtime manager per deployment – Configure deployments
  15. 15. Remoting • KieSession and TaskService – Possibly more later – Uses RuntimeManager • Using REST or JMS • Remote client using existing interfaces
  16. 16. KieSession + TaskService API RemoteRuntime Manager Other REST Client RuntimeManager Command Kie Session Task Service R E S T J M S Task Service
  17. 17. REST API http://server.address:port/{application-id}/rest/ runtime {id: [a-zA-Z0-9-]+} // deploymentId process {id: [a-zA-Z0-9-]+} start * start process [POST] instance {id: d} * process instance details [GET] signal * signal event [POST] abort * abort process instance [POST] signal {id: [a-zA-Z0-9-]+} * signal event [POST] workitem {id: d} complete * complete work item [POST] abort * abort work item [POST] execute * execute the given command [POST] task {id: d+} * task details [GET] activate * activate task claim * claim task [POST] // etc.. execute * execute the given command [POST] query * task query
  18. 18. Command Serialization • JAXB serialization of commands – e.g. Start task <command­message>   <deploymentId>test</deploymentId>   <ver>1</ver>   <start­task>     <taskId>1</taskId>     <userId>krisv</userId>   </start­task> </command­message>
  19. 19. Result Serialization • Primitives • Simple data (JAXB) • Remote wrappers for complex data – Process Instance – Task
  20. 20. REST Client • Reuse existing interfaces – KieSession, TaskService, RuntimeManager • Factory for creating client • Uses REST execute(Command) operation – Serialized command messages
  21. 21. REST Client Example RuntimeEngine runtimeEngine = new RemoteRestSessionFactory( "org.jbpm:HR:1.0” http://localhost:8080/jbpm-console", AuthenticationType.BASIC, "krisv", "krisv") .newRuntimeEngine(); engine.getKieSession().startProcess("org.jbpm.humantask"); engine.getTaskService().start(1, "salaboy");
  22. 22. Service Task Handlers • New out-of-the-box handlers for – WS – REST • Asynchronous handler using jobs – AsyncWorkItemHandler • Reusable • Fail-safe • Retries