|
Hi,
I am trying to develop a guide decision table so that each row will transform to the following rule rule "..." when data : RuleData( controlCode == 123, term = "<literal from cell>" ) then TermTicket t = new TimeTicket(); t.setTerm(data.getTerm()); t.setSomerValue(...) insert(t); end The condition that tests RuleData.controlCode attribute does not use any value from the table itself but just a constant "123" so I added a BRL fragment "controlCode equals to 123". This seems to work as long as this column is not hidden and the checkbox in the corresponding column is checked (by default the box is not checked therefore the condition is not added to the rule). Since the condition does not require any user provided value it is rather odd that it needs to be displayed in the table and requires user to check the box to enable it. Is there a way to get around this or this is a limitation of the guided decision table? Similarly in the same rule I want to set the value of TermTicket.term to a value taken from the RuleData, not from the table itself. Again I can get this to work by using a free form DRL. However this also requires the column itself to be shown in the table and the user needs to check the checkbox in that column to enable this action. Any suggestions? Thanks, Jason Jason |
|
You don't need an separate BRL Fragment for each line in the DRL. Why not define a BRL Fragment for this:-
data : RuleData( controlCode == 123, term = <TemplateKey> ) You'll then have a column in which to enter the value of "term". If the cell the fragment will not be included in the rule. With kind regards, Mike On 16 August 2012 03:08, jasonxzhong <[hidden email]> wrote: Hi, _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
|
Thanks. This will work if I have more than more than 1 conditions or actions.
And is there a way to reference the <TemplateKey> in free form DRL? I tried @{keyname} and it does not seem to work. - Jason Jason |
|
Hi,
If you add a BRL Fragment column and add "Free form drl" to that you can use the @{keyname} notation (I just tried and it works fine). BTW, it was a design decision to have a boolean checkbox for BRL Fragments that contain no template keys. The thought being a user might not want the fragment to apply to all rules. Having the checkbox gives this flexibility. Not having the checkbox, whilst making your use-case more simple, removes this flexibility. With kind regards, Mike On 16 August 2012 15:40, jasonxzhong <[hidden email]> wrote: Thanks. This will work if I have more than more than 1 conditions or actions. _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
|
You are right - use @{keyname} does work! Is there way to attach enumeration values to the column when it is constructed this way? It seems the guided decision table is not able to associate any defined enumerations to the @{keyname}.
Regarding boolean checkbox for BRL Fragments, I understand the flexibility it provides. I do wish that there is a place to enter a default value (similar to an simple condition where a boolean value is expected) so I can set the default to "true", hide the column and still be able to have the BRL fragment being added to each rules generated from the table. Thanks, Jason Jason |
|
Hi,
Unfortunately it is not possible to associate a data-type with a @{key} field at present. In order to do so we'd need to parse the DRL text to determine the Fact\Field to which the key relates (if indeed any). This is a significant enhancement. Being able to set a default value for BRL Fragments that contain zero keys is more achievable short-term. Could you please raise a JIRA at https://issues.jboss.org/browse/GUVNOR. With kind regards, Mike On 16 August 2012 22:27, jasonxzhong <[hidden email]> wrote: You are right - use @{keyname} does work! Is there way to attach enumeration _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
|
Can @{KeyName} be annotated with the associated enumeration type? This may be easier than trying to parse the DRL and make determination of the correct type of @{KeyName}. I found the ability to use DRL in decision table is very helpful and it is just a couple things like this that prevent this feature to be perfect :-)
I'll create a JIRA. Thanks for the help. Jason Jason |
|
Hi Jason,
That is not supported at present, but is a work-around (that is consistent with enum definitions). Please raise another JIRA and I'll look into that too. With kind regards, Mike On 17 August 2012 02:40, jasonxzhong <[hidden email]> wrote: Can @{KeyName} be annotated with the associated enumeration type? This may be _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
| Powered by Nabble | Edit this page |
