[rules-users] decision table, business problem

Frank Langelage frank at lafr.de
Tue Mar 27 16:28:11 EDT 2007


We use JBoss Rules Version 3.0.5 for data mapping tasks with success.
We tried to solve the following business case but did not find a nice 
solution.

We have an object of type Item (Order line main pos.) which gets 
Features assigned. The source to derive the Features from are also Item 
objects (Order lines sub pos.).
We asserted the sub pos Items to the working memory and use them in the 
condition column:

RuleTable AddOns
CONDITION

item:Item(manufCode=="$1")
Sub position of Design
TOST
TOBB30
TOMB30
CI
TD
PUMS
CSR
WTD-OVEN
SDI
TOBB12
TO42

We want to fill up a list of predefined features, starting with id 1100 
e.g., with the item codes existing in the order they appear in this list.
So we have to create an Object of type Feature with id *1100* and 
value=TOST if an Item with code TOST exists.
If this was done and an Item with code TOBB30 also exists, we want to 
create a Feature with code *1101* and value TOBB30.
If an item with code TOST does not exist, but an item with code TOBB30 
exists, we want to create a Feature object with id *1100* and value TOBB30.

So the Action is: assert ( new Feature( ?, item.getManufCode() );
But how to get an value starting at 1100 and increasing for each assert?

We thought about using a global for this Feature id, but how to assign a 
starting value to it and increasing it for each successful rule line?

Any ideas?


Regards,
	Frank




More information about the rules-users mailing list