[rules-users] Modifying in built rule in new formatt

wasim.khan318 khanwasim07 at yahoo.co.in
Mon Dec 27 07:27:41 EST 2010


It is  a Test Code , and  i  am very new to java and drools 
 i have a inbuilt  
rule "bundle A - included units"
	dialect "mvel"
	when
		$order : OrderDTO( )
		$line : OrderLineDTO( itemId == 16, $quantity : quantity ) from
$order.lines
		SubscriptionResult( userId == $order.userId, itemId == 12, subscribed ==
true )
		$pricing : PricingResult(userId == $order.userId, itemId == 13)
	then
		$order.getLines().remove($line);
		OrderLineBL.addItem($order, 13, new Integer($quantity.intValue()),
$pricing.getPrice());update($order);
end

i want  to modify this rule like 

rule "bundle A - included units"
	dialect "mvel"
	when
		$order : OrderDTO( )
		$line : OrderLineDTO( itemId == param1, $quantity : quantity ) from
$order.lines
		SubscriptionResult( userId == $order.userId, itemId == param2, subscribed
== true )
		$pricing : PricingResult(userId == $order.userId, itemId == param3)
	then
		$order.getLines().remove($line);
		OrderLineBL.addItem($order, param3, new Integer($quantity.intValue()),
$pricing.getPrice());update($order);
end
1.i want to replace hardcoded value to params as ItemId16 to param1
,Itemid12 to param2 so when any one see my rule can not guess about
hardcoded value. and i want that the values of param1,param2 some how come
from database
2.Till now what i did from my reading and exploring is 
i have created java functions in jboss which returns value like
GetParam1(some var),GetParam2(some var),GetParam3()
i tested them in jboss drools application they are working fine
3. then i build package and  upload in guvnor 
4.while writing technical ander Fact field i am getting only GetParam3() not
GetParam1(some var) and 
GetParam2(some var)
5. I dont know why . when i remove parameter value say make GetParam1() ,
without parameter it comes under class field.
6. please tell me is it right approach and if right then how i handle
GetParam1(some var) ,because they return param1 value which passed in
modified rule

-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Modifying-in-built-rule-in-new-formatt-tp2151450p2151450.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list