jBPM & Drools go Enterprise     Maciej Swiderski
Build comprehensive BPMplatform on top of jBPM and     Drools that will truly  accelerate your business
Sounds nice but whats that?How easy is to:•  Introduce new (version of) process?•  Change logic of a process?•  Upgrade yo...
... the goal is to be able...• Add new (version) processes without  affecting already running instances• Alter business lo...
... the developer goal is to be              able...• Do not maintain knowledge sessions on  application/client side• Do n...
JBoss AS7 to the rescue• JBoss Modules  – jBPM and Drools configured as JBoss    Module with all their dependencies• OSGi ...
Platform overview                                       JBoss AS7            OSGi Service Registry    Process bundle      ...
Platform components• BPM module   – Registers resolver manager• JBPM & Drools module   – Registers ExecutionEngineFactory ...
BPM module• Simple abstraction layer on top of jBPM  and Drools APIs to make clients  independent of the version• Register...
ResolverManagerpublic interface ExecutionEngineResolverManager {    void register(String owner, ExecutionEngineResolver re...
jBPM & Drools module• jBPM and Drools components bundled in a  single JBoss Module together with all  dependencies• OSGi e...
ExecutionEngineFactorypublic interface ExecutionEngineFactory {    public ExecutionEngine newExecutionEngine(             ...
Process bundle• Main component that makes use of the  platform and delivers functionality• Produces ExecutionEngine which ...
ExecutionEnginepublic interface ExecutionEngine {    public Object getKnowledgeBase();    public SessionDelegate getStatel...
Platform interactions                                   4. Register Exec EngineProcess Bundle                             ...
Client application• Ultimate client of the platform• Makes use of ExecutionEngine and  ResolverManager to perform work• In...
Platform interactionsClient app                        1. Look up                     OSGi                        Resolver...
Client application code// get reference to Resolver managerServiceReference srf = this.context.getServiceReference(       ...
Resolvers• Resolver is responsible for finding the  right ExecutionEngine based on given  context• Default policy - first ...
Available default resolvers• UUID based resolver that accepts context if:   – Explicitly contains UUID property of the eng...
Session management• In case where more than one session is in  use there is a need to keep track of the  identifiers and i...
SessionMappingStrategies• Platform is equipped with strategies that are  capable of maintaining sessions identifiers  base...
Available session mapping           strategies• SerializableMap strategy – dedicated  strategy for standalone installation...
Make your engine configurable• ExecutionEngine will emit notification on  number of events so the process  bundle can reac...
ExecutionEngineCallbackpublic interface ExecutionEngineCallback {    public void preKnowledgeBaseCreate(KnowledgeBuilder b...
Multi tenancy• Multi tenancy is achieved by:  – Separate process bundles registered with    dedicated properties  – Additi...
Still in evaluation phase...• The work is still in evaluation stage so  everything can change and hopefully if  it does it...
Still in evaluation phase...• The work is still in evaluation stage so  everything can change and hopefully if  it does it...
Thanks for your attention         Questions? Comments?     Email: mswiders@redhat.com     IRC: chat.freenode.net#jbpm     ...
Drools&jBPM       Drools&jBPM"All Day Drop in Centre"     room 105, Hynes
Upcoming SlideShare
Loading in …5
×

jBPM&Drools go Enterprise - JUDCon2012

1,954 views

Published on

Presentation given on JUDCon 2012 by Maciej Swiderski (jbpm core developer) about building BPM platform on top of jBPM5 and Drools.

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

  • Be the first to like this

No Downloads
Views
Total views
1,954
On SlideShare
0
From Embeds
0
Number of Embeds
1,368
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

jBPM&Drools go Enterprise - JUDCon2012

  1. 1. jBPM & Drools go Enterprise Maciej Swiderski
  2. 2. Build comprehensive BPMplatform on top of jBPM and Drools that will truly accelerate your business
  3. 3. Sounds nice but whats that?How easy is to:• Introduce new (version of) process?• Change logic of a process?• Upgrade your environment?• Migrate your active processes?
  4. 4. ... the goal is to be able...• Add new (version) processes without affecting already running instances• Alter business logic invoked by the processes independently• Run different versions of the engine at the same time
  5. 5. ... the developer goal is to be able...• Do not maintain knowledge sessions on application/client side• Do not worry about version if not needed – Process version – Engine version• Simplify usability of the engine from application/client perspective
  6. 6. JBoss AS7 to the rescue• JBoss Modules – jBPM and Drools configured as JBoss Module with all their dependencies• OSGi – Engine factories registered in OSGi service registry with version properties – Engines registered in OSGi service registry with custom properties – Client code packaged as OSGi bundles
  7. 7. Platform overview JBoss AS7 OSGi Service Registry Process bundle Process bundle BPM module v 1.0jBPM & Drools Module jBPM & Drools Module V 5.2 V 5.3
  8. 8. Platform components• BPM module – Registers resolver manager• JBPM & Drools module – Registers ExecutionEngineFactory – Registers resolvers• Platform bundle – Bootstraps and registers ExecutionEngine• Client application – Uses ExecutionEngine via resolvers
  9. 9. BPM module• Simple abstraction layer on top of jBPM and Drools APIs to make clients independent of the version• Registers ResolverManager in OSGi service registry as single point of interaction for ExecutionEngine look ups
  10. 10. ResolverManagerpublic interface ExecutionEngineResolverManager {    void register(String owner, ExecutionEngineResolver resolver);    void unregister(String owner, UUID resolverUniqueId);    ExecutionEngineResolver find(RequestContext context);    ExecutionEngine findAndLookUp(RequestContext context);    Collection<ExecutionEngineResolver> getResolvers();}
  11. 11. jBPM & Drools module• jBPM and Drools components bundled in a single JBoss Module together with all dependencies• OSGi enabled• Registers ExecutionEngineFactory that is exposed to process bundles to construct ExecutionEngines for given version of jBPM and Drools• Registers resolvers supported by given version
  12. 12. ExecutionEngineFactorypublic interface ExecutionEngineFactory {    public ExecutionEngine newExecutionEngine(                                   ClassLoader bundleClassLoader);    public ExecutionEngine newExecutionEngine(                             ClassLoader bundleClassLoader,                              ExecutionEngineConfiguration config);    public ExecutionEngine newExecutionEngine(                                    ClassLoader bundleClassLoader,                               ExecutionEngineConfiguration config,                                                  Object callback);    public ExecutionEngine newExecutionEngine(                                    ClassLoader bundleClassLoader,                               ExecutionEngineConfiguration config,                            ExecutionEngineMapperStrategy strategy,                                                 Object callback);}
  13. 13. Process bundle• Main component that makes use of the platform and delivers functionality• Produces ExecutionEngine which is: – Wrapper around KnowledgeBase – Provides session management based on business keys using configurable strategies• Registers ExecutionEngine under various properties making it discoverable by resolvers
  14. 14. ExecutionEnginepublic interface ExecutionEngine {    public Object getKnowledgeBase();    public SessionDelegate getStatelessSession();    public SessionDelegate getSession(String businessKey);    public SessionDelegate getSessionById(int id);    public Object getHumanTaskConnector();    public UUID getUUID();    public String buildCompositeId(String id);    public void disposeSession(SessionDelegate session);}
  15. 15. Platform interactions 4. Register Exec EngineProcess Bundle 1. look up OSGi EE Factory Service 2. Build EE Registry ExecEngineFactory 3. Build EE Resolver ManagerExecutionEngine5. Optional – register custom resolvers
  16. 16. Client application• Ultimate client of the platform• Makes use of ExecutionEngine and ResolverManager to perform work• Independent of the platform and process version• Communicates only through OSGi service registry
  17. 17. Platform interactionsClient app 1. Look up OSGi Resolver Manager Service Registry 2. find Resolver find ExecEngine Resolver 3. Look up 4. perform operation on the engine Manager exec engine ExecutionEngine
  18. 18. Client application code// get reference to Resolver managerServiceReference srf = this.context.getServiceReference(                  ExecutionEngineResolverManager.class.getName());ExecutionEngineResolverManager resolverManager =     (ExecutionEngineResolverManager)this.context.getService(srf);//find right resolver and directly look up the engineRequestContext reqContext = new HttpRequestContext(request);ExecutionEngine engine = resolverManager.findAndLookUp(reqContext);// get session by business key and start process on it    String compositeProcessInstanceId = engine.getSession("business­key").startProcess(”process­id”);
  19. 19. Resolvers• Resolver is responsible for finding the right ExecutionEngine based on given context• Default policy - first resolver that accepts the context will do the look up in OSGi service registry• Platform delivers some resolvers out of the box but process bundles can introduce custom resolvers as well
  20. 20. Available default resolvers• UUID based resolver that accepts context if: – Explicitly contains UUID property of the engine – Contains composite id property (for instance processInstanceId)• Version based resolver that accepts context if: – Explicitly contains version property• Valid time resolver that will accepts the context if: – No version parameter is given
  21. 21. Session management• In case where more than one session is in use there is a need to keep track of the identifiers and in some cases even relationship between process instance and session instance• By default this need must be secured on application side• On clustered environment things get more complicated (avoid concurrent usage of the same session)
  22. 22. SessionMappingStrategies• Platform is equipped with strategies that are capable of maintaining sessions identifiers based on some business key• Application refers to the session with custom business key like for instance user id or department instead of the internal session id• Strategies are pluggable and every ExecutionEngine instance can utilize different implementation
  23. 23. Available session mapping strategies• SerializableMap strategy – dedicated strategy for standalone installation that will simply persist the map of known values to the disc• Clustered strategy – dedicated strategy that will employ Inifinispan as distributed cache with configured data store
  24. 24. Make your engine configurable• ExecutionEngine will emit notification on number of events so the process bundle can react on them: – Knowledge base creation – Knowledge session creation – Work item registration – Dispose of the session – etc
  25. 25. ExecutionEngineCallbackpublic interface ExecutionEngineCallback {    public void preKnowledgeBaseCreate(KnowledgeBuilder builder);    public void postKnowledgeBaseCreate(KnowledgeBase kBase);    public void preKnowledgeSessionCreate(Environment environment,                                         KnowledgeSessionConfiguration config, KnowledgeBase kBase);    public void postKnowledgeSessionCreate(StatefulKnowledgeSession session, String businessKey);    public void postKnowledgeSessionCreate(StatelessKnowledgeSession session, String businessKey);    public void preKnowledgeSessionRestore(Environment environment,                                        KnowledgeSessionConfiguration config, KnowledgeBase kBase);    public void postKnowledgeSessionRestore(StatefulKnowledgeSession session, String businessKey);    public void preSessionDispose(StatefulKnowledgeSession session, String businessKey);    public void postSessionDispose(StatefulKnowledgeSession session, String businessKey);    public void preWorkItemRegister(StatefulKnowledgeSession session, String businessKey,                                                     KnowledgeBase kBase, WorkItemHandler handler);    public void postWorkItemRegister(StatefulKnowledgeSession session, String businessKey,                                                     KnowledgeBase kBase, WorkItemHandler handler);}
  26. 26. Multi tenancy• Multi tenancy is achieved by: – Separate process bundles registered with dedicated properties – Additional resolver that will understand tenant configuration –• It could be as simple as using tenant id property to redirect to the right execution engine...
  27. 27. Still in evaluation phase...• The work is still in evaluation stage so everything can change and hopefully if it does its for the good• Please submit your input, requirements, ideas• There are some limitation currently that are being investigated and most of them have workarounds :)
  28. 28. Still in evaluation phase...• The work is still in evaluation stage so everything can change and hopefully if it does its for the good• Please submit your input, requirements, ideas• There are some limitation currently that are being investigated and most of them have workarounds :)
  29. 29. Thanks for your attention Questions? Comments? Email: mswiders@redhat.com IRC: chat.freenode.net#jbpm Test drive:http://people.redhat.com/mswiders/jbpm-enterprise/
  30. 30. Drools&jBPM Drools&jBPM"All Day Drop in Centre" room 105, Hynes

×