How KIE WB show existing rules in Editor

271 views
Skip to first unread message

Hemang Gandhi

unread,
Jan 4, 2018, 4:51:48 AM1/4/18
to Drools Usage
Hello,

I am trying to understand how KIE WB creates/edits rules using Guided rule editor. I am trying to create custom UI rule editor and I was exploring ways to generate a DRL (text form) rules with inputs from UI. I can get my head around creating the rules where I can get inputs from UI elements and form a string, although I would like to know if there is a better way. I was more confused about how the same rule is shown again when I open the rule in the same way and with the same UI elements/positions? Is it maintained anywhere that a value/field was selected from a dropdown or a value/field is a literal in a text box. I am trying to figure out if I have created a rule using UI elements and created a drl file, how can I use the same drl file to show the rule back to the user? With different versions, etc. And if I want to edit the rule I can.

Thanks,
Hemang

Michael Anstis

unread,
Jan 4, 2018, 5:06:40 AM1/4/18
to Drools Usage
The workbench stores guided rules witht he RDRL file extension (although the content is plain DRL).

When the User loads a RDRL file we parse the DRL to generate the object model used by the UI.


This extracts Type and Field information when constructing the UI object model.

The  PackageDataModelOracle (passed to the unmarshal method) contains meta-data about Types and Fields from which the unmarshalling determines the data-type added to the UI object model.

The UI object model (and PackageDataModelOracle) are used at runtime to assist with determining the type of Widget shown in the UI.

The same class is responsible for converting the UI object model to DRL when the User saves a Guided Rule.

This is the top-level description of what happens.. it is a rabbit hole that you are free to fall into :-)

With kind regards,

Mike

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/1ef5f7e6-dbd0-460c-813e-b07ec67bc5a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages