Hi,
I am not sure if you are using Excel to write up the decision tables.. But I found that
the Spreadsheet Compiler honours the values that the XLS formulas calculate.
For example:
If I have a table where the "Row values" start at A20. I can put into A20 ..
=$X$1 & "some value" & $Y$2
or
in A21 .. =A20
Another example, use I made of this was to "=sumif(…)" in one cell (for example
B30) , and use the "value" of that in an ACTION call ..
ACTION
$myobject.setTotal($param)
=B30
Of course the SpreadSheet Compiler is not reading the VBA formulas (Excel formulas), but
rather just reading the cached calculated values when the XLS is saved.
Another example of how I used this was; the rules were executed in Stateless fashion,
behind a JSON API. The version of the rules (i.e. the spreadsheet) were critical for our
API.
So as part of the rule "initialisation" phase, I set the version of the rules
(derived from a number on a "non" rules Worksheet in the same XLS) onto an
Object.
(an aside : the version looked like:
400-1371570.025
The "400" is the number of times it has been saved. The other numbers are just
UNIX timestamp with a fictional decimal point :-)
(this number is rewritten via a Macro every time the XLS is "saved") This value,
sits in a sheet called "Introduction" at Cell C4. (see below)
AGENDA-GROUP CONDITION ACTION
$obj : MyVersionObject( ) $obj
$1 setRulesVersion("$1")
Setting the Version Set The version
Init /* yes */ =Introduction!C4
Probably far more info than you needed .. but there you go.
Ramon Buckland
ramon(a)thebuckland.com
On 26 Jul 2013, at 11:35, nkhogen <nkhogen(a)gmail.com> wrote:
Is there a way to access values in other cells from a different cell
of the
same row in Decision Table? Rewriting of the constants in CONDITION can be
avoided in the ACTION especially in OR scenario where the facts in the
activated rules do not have all the constants which are used in comparison.
--
View this message in context:
http://drools.46999.n3.nabble.com/Decision-Table-Access-values-in-other-c...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users