[rules-users] Setting value in LHS for access in RHS

Michael Anstis michael.anstis at gmail.com
Fri Nov 30 10:23:58 EST 2012


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 )
then
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 )
then
insert( new CheeseCheck( $exp ) );

???

On 30 November 2012 15:08, Stephen Masters <stephen.masters at me.com> 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!
>
> Steve
>
>
>
> Mauricio Salatino <salaboy at gmail.com> 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.
>
> Cheers
>
>
> On Fri, Nov 30, 2012 at 2:10 PM, Stephen Masters <stephen.masters at me.com>wrote:
>
>>
>>
>> Stephen Masters <stephen.masters at me.com> 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.
>> >
>> >Cheers
>> >
>> >Steve
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  - MyJourney @ http://salaboy.wordpress.com
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121130/ce44e969/attachment.html 


More information about the rules-users mailing list