Your SlideShare is downloading. ×
Guvnor presentation jervis liu
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Guvnor presentation jervis liu

1,528
views

Published on

Published in: Education, Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,528
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
54
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. GuvnorJervis Liu
  • 2. What is Guvnor?● Business Knowledge Management System● Application to manage business knowledge ○ Business Rules (BRMS) ○ Business Workflows (BWMS)● Accessible through ○ Browser ○ REST webservice
  • 3. Why would I need a BRMS like Guvnor?
  • 4. Use case: mortgage● Mortgage approval● Mortgage rate calculation
  • 5. Diploma Computer science + Economics + Medicine John Unfindable SmithProgrammers are not domain experts
  • 6. Domain experts define rules● Mortgage manager == domain expert ○ defines rules ○ wants to edit rules Invalid: must be a number
  • 7. Too complexNot flexible enough
  • 8. when house near Fukushima then ... when guarantor invested in Lehman Brothers stock then ...Business rules change often
  • 9. Only works for data changes
  • 10. Too slow for business rules changes
  • 11. Possible through Guvnor
  • 12. How do I define my data model?
  • 13. Business Model● POJO modelUpload a Java JAR file into Guvnor● Declarative modelDeclare a model within Guvnor● Enumerations
  • 14. Business Model POJO ModelUploading a POJO model
  • 15. Business Model Declarative modelDeclarative model editor ● Add CEP support to your classes 1. @role(event) annotation 2. Add to POJOs or declared types ● Example types: 1. Loan Application 2. Applicant 3. ... ● Example fields: 1. LoanApplication.amount 2. LoanApplication.approved
  • 16. Business Model Declarative modelDeclarative model editor
  • 17. Business Model Declarative modelAdding a new Type ● Types can extend Java classes ● Types can extend other declared typesAdding a field to a Fact
  • 18. Business Model Enumerations● Java enumerationsDefined in POJO model● Guvnor enumerationsDefined declaratively in Guvnor
  • 19. Business Model EnumerationsGuvnor enumeration editor:
  • 20. Business Model EnumerationsGuvnor enumerations: ● Restrict any domain field ● Dependent enumerations ● Pull content from external source
  • 21. Authoring rulesHow do I define my business rules?
  • 22. Authoring rules● Web-based editor● Web-based templates● Web-based decision tables● Domain Specific Language● Free-form DRL
  • 23. Authoring rules Web-based editorWeb-based editor: ● Visually define individual rules quickly and easily ● Supports a wide sub-set of Drools Expert DRL features 1. all of the following are true 2. any of the following are true 3. nested model accessors 4. from 5. accumulate 6. collect 7. CEP 8. etc
  • 24. Authoring rules Web-based editorWeb-based editor
  • 25. Authoring rules Web-based templatesWeb-based templates: ● Visually define multiple rules quickly and easily ● Extension of Web-based editor ● Define parameters in rules ● Backed by a table of data to build individual rules
  • 26. Authoring rules Web-based templatesWeb-based templates (editor)
  • 27. Authoring rules Web-based templatesWeb-based templates (data)
  • 28. Authoring rules Web-based templatesResultant rules
  • 29. Authoring rules Web-based decision tablesWeb-based decision tables: ● Visually define multiple rules quickly and easily ● Rapid construction using Wizard ● Extended entryValues are held in the decision table ● Limited entryValues are held in the column definition ● Expanded form ● Mergable cells ● Grouping of rows
  • 30. Authoring rules Web-based decision tablesUsing a Wizard
  • 31. Authoring rules Web-based decision tablesExtended Entry
  • 32. Authoring rules Web-based decision tablesLimited Entry
  • 33. Authoring rules Web-based decision tablesExpanded form ● One row for each combination of conditions ● Condition 1 with 3 values (25, 30, 35) ● Condition 2 with 3 values ("AA", "OK", "Sub prime") ● 3 x 3 = 9 rules
  • 34. Authoring rules Web-based decision tablesMerging cellsGrouping cells
  • 35. Decision table analysis● Impossible matches ○ 1 row can never match● Conflict detection ○ 2 rows match at same time for certain ranges ○ and contradict each other
  • 36. Authoring rules Web-based decision tablesResultant rules
  • 37. Authoring rules Domain Specific LanguageDomain Specific Language: ● Define domain specific sentences for use in rules ● Include DSL sentences in rules
  • 38. Authoring rules Free-form DRLFree-form DRL: ● Cutting edge Drools Expert syntax 1. Backwards chaining 2. Declarative agenda 3. Traits ● Some people (developers) just prefer it
  • 39. How do I check the quality of my rules?
  • 40. Test Scenarios● Validates your decisions● Guards your knowledge● Rules specify what decisions to make with the given data ○ When the data exists. Then do the following● Test scenarios validate that the knowledge base does what is expected ○ Given we have this data. Expect the following to be true
  • 41. Overall report of test statuses andcoverage
  • 42. Single ScenarioA 17-year-oldshould never geta loan, even ifhe has anincome source.
  • 43. Failing ScenarioIf a change inthe future willbreak theknowledgebase. Allowingloans forunderages. Thistest scenario willpick it up.
  • 44. Rule Analysis● Looks for errors in the rule logic and mistakes made by the rule authors ○ Redundant and subsumptant rules ○ Missing ranges ○ Rules that can never fire ○ Rules that always fire ○ Rule optimization
  • 45. Rule AnalysisReportExample report warningabout missing rangesand missing ruleconditions.
  • 46. How do I define workflows?
  • 47. Web-based BPMN2 authoring● Guvnor integration with jBPM5 Web Designer allows: ○ editing/creation of fully-executable jBPM5 processes ○ viewing the source of the process in different formats (png, pdf, json, bpmn2, svg) ○ automatic creation of human-task forms (fully executable in jBPM console) ○ creation of jBPM workitem definition configurations (via custom editor, similar to sprint context editor) ○ visual process validation ○ automatic installation of assets from the jBPM Service Repository ○ ability to convert jBPM3.2-based process definitions to BPMN2
  • 48. Where does Guvnor fit into my infrastructure?
  • 49. Jackrabbit Repository Configuration● All assets are stored in a content repository (JCR 2.0 compliant)● Configuring different repositories is possible● Default repository implementation is Apache Jackrabbit● Jackrabbit allows repository to be stored ○ File System (default) ○ External Database (Oracle, MySQL, etc)● Configuring Jackrabbit is often tedious mainly because of limited or not-existing documentation● Guvnor Admin section includes a repository configuration widget that helps with configuration creation.
  • 50. Jackrabbit Repo. Configuration (2)● BRMS 5.2 repository configuration widget:
  • 51. Jackrabbit Repo. Configuration (3)● Guvnor repository configuration widget:
  • 52. Jackrabbit Repo. Configuration (4)● Guvnor repository configuration widget:
  • 53. How do I release the knowledge?
  • 54. Releasing the knowledge PackagingAssemble required assets into a single deployable unit
  • 55. Releasing the knowledge VersioningBoth assets and packages are "versioned" in the Guvnor
  • 56. Releasing the knowledge Lifecycle managementCreate status (life cycles):Change the status:
  • 57. How do I use the knowledge?
  • 58. Using the knowledgeThe Knowledge Agent
  • 59. Using the knowledge The REST InterfaceThe Guvnor repository back end can be accessed via Restand WebDav. REST Examples:URL Mode Produces Mime- Consumes MIME- Description Type Type/packages/ GET application/atom+xml none Returns the metadata of the{packageName} package {packageName} as an Atom Entry./packages/ GET application/json none Returns the metadata of the{packageName} application/xml package {packageName} as Json or XML/packages/ GET application/octet- none Returns the compiled binary{packageName} stream of the package/binary {packageName} as a binary stream/packages/ PUT application/atom+xml none Updates the metadata of{packageName} package {packageName} with a given Atom Entry./packages POST application/atom+xml application/atom+xml Creates a package from an Atom Entry. Returns the newly created package in Atom Entry format
  • 60. Spring Context Editor● Allows to create and manage Spring Context files:● Spring contexts have own asset type:● Retrievable via REST API by clients.● Easy to create custom editors for integration with other technologies.
  • 61. Embeddable Asset Editors● Guvnor provides a set of Editors to author assets● Asset format determines the Editor used● Some existing editors: ○ Guided Rule Editor ○ DRL Editor ○ DSL Editor ○ Decision Table Editor ○ Spring Context Editor ○ jBPM5 Workitem Definition Editor ○ ...● Guvnor also has the ability to embed asset editors in client applications
  • 62. Embeddable Asset Editors (2)● Embedding enabled via StandaloneEditorServlet● Client applications must perform request to /standaloneEditorServlet and can interact with the embedded editor(s) via JavaScript. ○ Restriction – since JavaScript is used, client application must run on the same server as Guvnor (cross-domain interaction only)● 100% community contribution● Three interaction modes available: ○ Guided Rule editing mode (new or existing assets) ○ Asset Editor (existing assets only) ○ New asset mode
  • 63. Questionshttp://www.jboss.org/drools