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 <michael.anstis@gmail.com> wrote:
Not sure I still understand ;)
Do you mean to use the *field name* (not it's value) in the RHS; e.g.
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@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.CheersOn Fri, Nov 30, 2012 at 2:10 PM, Stephen Masters <stephen.masters@me.com> wrote:
Stephen Masters <stephen.masters@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@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users