You got it this time ... I'm trying to inspect the field name. As you mention there's a risk that a user could pick a mismatched RHS consequence, so I was hoping to work some DRL magic to avoid that.

So I think I'll get around it by extending my facts and populating them each with the value they should use. It means a lot more up-front calculations, but its probably the safest way.

Michael Anstis <> wrote:

Not sure I still understand ;)

Do you mean to use the *field name* (not it's value) in the RHS; e.g.

AccountExposure( $exp : cheese )
insert( new LimitCheck( "cheese" ) );

If so this is not possible without repeating the enum in the [then] DSL sentence but obviously users could easily select different values for each.

At the moment I would have to suggest different DSL sentences is probably your only option.

Or, a different check type dependent on the exposure type?

AccountExposure( $exp : cheese )
insert( new CheeseCheck( $exp ) );


On 30 November 2012 15:08, Stephen Masters <> wrote:
Apologies for the overly brief explanation ... am at a bank where only internet access is on my phone. Additional apologies if I suffer from auto-correct errors. :)

[condition][] validate "{exposureType:ENUM:exposure types}" = AccountExposure($exp : {exposure type});

[consequence][] Create limit check = insert(new LimitCheck($exp);

Now, dependent on what exposure type I select, I need to use a different value to perform conversions between amounts and percentages. So it would keep things clean if I could pass the property name selected in the LHS to the object inserted on the RHS.

I could do it by having different DSL phrases for consequences, but my audience is very non technical so I'm trying to keep the language as minimal as possible.

Hope that explains it!


Mauricio Salatino <> wrote:

Hi Steve,
Can you please gives us an example about what are you trying to achieve? 
Setting a variable in the LHS doesn't make sense for the common use cases. What we usually do is to bind a variable to a field from our facts, but that's it.


On Fri, Nov 30, 2012 at 2:10 PM, Stephen Masters <> wrote:

Stephen Masters <> wrote:

>Hi folks,
>I'm trying to set up rules where the RHS is able to refer to a value set in the LHS so that it can perform its logics slightly differently.
>I'm able to use $var to pick out fields from facts in working memory. However as far as I can tell I'm not able to set a new value.
>I'm setting up a DSL to drive guided rules in guvnor and in the RHS I need to know which value was picked from a drop down list in the LHS.
rules-users mailing list

 - MyJourney @
 - Co-Founder @
 - Co-Founder @
 - Salatino "Salaboy" Mauricio -

rules-users mailing list