<HTML dir=ltr><HEAD></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText80716>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>Hello,</FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>I have a SKS that is persisted using JPAKnowledgeService. I am using events and have multiple rules that match on those events using the "after" and "before" temporal operators. When I have a fresh session, I can insert events and fire rules till the cows come home with no issue. However, if I load a persisted session containing event facts and try to insert a new event, when rule conditions attempt to evaluate on the *persisted* events in working memory, I get "org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle".</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>I have googled extensively on this issue and, though it seems to be relatively common, none of the resolutions I've seen apply to me. I've doublechecked that my events are declared as such. I've debugged into Drools code and verified that the FactHandle returned upon insertion is an EventFactHandle. However, it seems as if the engine "forgets" that these facts&nbsp;are events when the session is persisted or rehydrated.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>I do not currently have a simple example to share, and I can work on one if required, but I wanted to get my question out ahead of that in case anyone in the community has an answer for me off the top of their head. Any assistance is appreciated.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Mike</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV></DIV></BODY></HTML>