[rules-users] drl for Selection and Decreasing

Al Ferguson alfernie at hotmail.com
Fri Mar 22 12:17:52 EDT 2013


Hi,

I'd like to use the Planner to determine the location of items to be shipped
(aka Order Sourcing).

The Planning Entity is:

.---------------------.
|     OrderLine       |
| ------------------- |
| String productCode  |
| int orderedQuantity |
| StockItem stockItem |
'---------------------'

The resource (Planning Variable) is:

.-----------------------.
|     StockItem         |
| --------------------- |
| String productCode    |
| String warehouseId    |
| int availableQuantity |
'-----------------------'

Solution Implementation is:

.-----------------.
| OrderPlanning   |
| --------------- |
| score           |
| orderLineList   |
| stockItemList   |
'-----------------'


Here's an example to be solved:

OrderLine [id=1, productCode=A, orderedQuantity=1]
OrderLine [id=2, productCode=B, orderedQuantity=2]
OrderLine [id=3, productCode=B, orderedQuantity=2]

StockItem [id=1, productCode=A, warehouseId=NYC, availableQuantity=1000]
StockItem [id=1, productCode=B, warehouseId=NYC, availableQuantity=1000]
StockItem [id=1, productCode=B, warehouseId=CHI, availableQuantity=1000]

Can you help me writing the required 'drl'?

 - StockItem.productCode must be the OrderLine.productCode
 - StockItem.availableQuantity must be decreased when an OrderLine is
allocated

Obviously the allocation rules are much more complex. But I'm starting with
the Planner and I need help to start.

Thanks,
Al



--
View this message in context: http://drools.46999.n3.nabble.com/drl-for-Selection-and-Decreasing-tp4022999.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list