[rules-users] WorkingMemoryListener & Declared Types

droolster quant.coder at gmail.com
Wed Aug 7 04:58:04 EDT 2013


Hello,

Please can the community help me.

I am attaching a WorkingMemoryListener to a session. In my DRL file, I have
a number of declared types for which I want to "watch" when the process is
running. How can I implement a "toString()" method in the DRL file for a
declared type? I have detailed the structure of my code below to make it
clear what I am trying to do:

DRL FILE
--------
declare Foo
    low : double
    high : double
    score : int
end


Java Code
----------
ksession.addEventListener(new WorkingMemoryEventListener() 
    {
		
		@Override
		public void objectInserted(ObjectInsertedEvent event) {
			System.out.println(*"Inserted: " + event.toString()*);
                        /*// Here I would like to print out the data in the
type Foo in a specific format.*/
			
		}

		@Override
		public void objectUpdated(ObjectUpdatedEvent event) {
			System.out.println("Updated");
		}
		
		@Override
		public void objectRetracted(ObjectRetractedEvent event) {
			System.out.println("Retracted");
			
		}
		
	});

Thanks in advance for your help.



--
View this message in context: http://drools.46999.n3.nabble.com/WorkingMemoryListener-Declared-Types-tp4025391.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list