I am trying to pass an object say Order where it checks against its previous value and updates a field.
Order(orderId, item_id, quantity, price, discount_type, discount_amount)
So the first time I get Order Data with a value Order("o1", "i1", 1, 100, null, null).
Second record I would be getting for the same order with details Order("o1", "i1", 2, 200, null, null).
When I process the 2nd order, I want to update the Order object with values Order("o1", "i1", 2, 150, "discountType1", 50(calculate the value prev_price - curr_price)).
I am trying to create a drools application, where I want to send a single Order object with both, current and previous, values and apply rules in drools xsl file using java.
Can someone help me how do I set the current and previous instance values of order in one object.