[rules-users] Function and return value

snehils snehils at gmail.com
Wed Sep 7 11:53:33 EDT 2011


I have made a function in drl file. This function is calling another function
from java file. This java file function returns an object, that I am not
able to get.

function SomeObject testFinction(SomeObject obj1) {
	String str;

	// Some calculations
	// ...
	str = "something after calculation";
	
	// this function will return SomeObject based on str value
	SomeObject obj2 = Util.getSomeObject(str); // problem is here. obj2 is
updated with same value of obj1. Expected value is diffrent from obj1.
Checked getSomeObject(). It is working fine.

	// Some other calculations...
	// ...
	
	return anotherSomeObject;
}

rule "Check SomeObject"
	when
		//eval(tlvID == "57")
		someObj:SomeObject(id == "123")
	then
		testFinction(someObj);
end

I am using drool version 5.1.0.

--
View this message in context: http://drools.46999.n3.nabble.com/Function-and-return-value-tp3317132p3317132.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list