2. What is Guvnor?
● Business Knowledge Management System
● Application to manage business knowledge
○ Business Rules (BRMS)
○ Business Workflows (BWMS)
● Accessible through
○ Browser
○ REST webservice
16. Business Model
Declarative model
Declarative 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
17. Business Model
Declarative model
Declarative model editor
18. Business Model
Declarative model
Adding a new Type
● Types can extend Java classes
● Types can extend other declared types
Adding a field to a Fact
19. Business Model
Enumerations
● Java enumerations
Defined in POJO model
● Guvnor enumerations
Defined declaratively in Guvnor
23. Authoring rules
● Web-based editor
● Web-based templates
● Web-based decision tables
● Domain Specific Language
● Free-form DRL
24. Authoring rules
Web-based editor
Web-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
26. Authoring rules
Web-based templates
Web-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
30. Authoring rules
Web-based decision tables
Web-based decision tables:
● Visually define multiple rules quickly and easily
● Rapid construction using Wizard
● Extended entry
Values are held in the decision table
● Limited entry
Values are held in the column definition
● Expanded form
● Mergable cells
● Grouping of rows
36. 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
38. Authoring rules
Domain Specific Language
Domain Specific Language:
● Define domain specific sentences for use in rules
● Include DSL sentences in rules
39. Authoring rules
Free-form DRL
Free-form DRL:
● Cutting edge Drools Expert syntax
1. Backwards chaining
2. Declarative agenda
3. Traits
● Some people (developers) just prefer it
41. 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
44. Failing Scenario
If a change in
the future will
break the
knowledge
base. Allowing
loans for
underages. This
test scenario will
pick it up.
45. 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
48. 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
51. 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.
61. Using the knowledge
The REST Interface
The Guvnor repository back end can be accessed via Rest
and 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
62. 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.
63. 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
64. 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