Everything looks ok except when CTRL backspace for content assistance is used it throws this exception. Any one has any clue?
java.lang.ClassCastException: org.eclipse.ui.internal.editors.text.JavaFileEditorInput at org.drools.ide.editors.completion.RuleCompletionProcessor.getDSLAdapter( RuleCompletionProcessor.java:549) at org.drools.ide.editors.completion.RuleCompletionProcessor.getCompletionP roposals(RuleCompletionProcessor.java:63) at org.drools.ide.editors.completion.AbstractCompletionProcessor.computeCom pletionProposals(AbstractCompletionProcessor.java:33) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionP roposals(ContentAssistant.java:1612) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProp osals(CompletionProposalPopup.java:473) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$17(C ompletionProposalPopup.java:470) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(Compl etionProposalPopup.java:405) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposa ls(CompletionProposalPopup.java:399) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleComple tions(ContentAssistant.java:1441) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java :777) at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(Pr ojectionViewer.java:1519) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction. java:131) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.ja va:129) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHand lerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(Paramet erizedCommand.java:424) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerSe rvice.java:160) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchK eyboard.java:466) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.j ava:799) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(Workbench Keyboard.java:846) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings (WorkbenchKeyboard.java:564) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboar d.java:506) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent (WorkbenchKeyboard.java:122) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:927) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:4 19) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActiva tor.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplicat ion(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Eclip seAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ho, Alan Sent: Thursday, February 15, 2007 12:07 PM To: Rules Users List Subject: RE: [rules-users] Short-circuit rules by group?! Sorry, I take back what I said about the previous email - when I was refering to agenda groups, I actually ment activation groups. But thinking about it more, I think activation groups might be a ok. Just makes sure that all rules in the activation group have the same consequence. Regards, Alan Ho -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ho, Alan Sent: Wednesday, February 14, 2007 4:04 PM To: Rules Users List Subject: RE: [rules-users] Short-circuit rules by group?! I won't recommend using agenda groups in this case. If you want to make sure that a message is sent once and only once per customer, the predicate for each rule should look like : When customer : Customer() "Your custom business logic" && !customer.sentAEvent Then sendEventToCustomer customer.sentAEvent = true drools.assert(customer.sentAEvent) End This will ensure that only one event would get sent. Even if you use Agenda Groups, you can't prevent the LHS (condition statement) to be evaluated for every single rule. In the case where you have multiple rule's LHS are evaluted to be true, the "drools.assert" executed during the first valid rule would cause a revaluation of all rules that has "!customer.sentEvent" in its condition. When the re-evaluations reoccur, the !customer.sendAEvent is evaluated to false, hence a event is never sent twice to the customer. Agenda groups isn't a good idea because then your agenda groups is tightly tied to the data. You might end up creating more and more agenda groups for each customer. Does that make sense :P Regards, Alan Ho -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jdepaul Sent: Tuesday, February 13, 2007 9:43 AM To: rules-users@lists.jboss.org Subject: [rules-users] Short-circuit rules by group?! I have several rules defined in groups by Customer, so I have number of rules for Walmart, some rules for NIKE, more rules for SomeCustomer... When one of the rules matches for a given customer I need to send an event notification. I need to make sure that I send only ONE event notification per Customer (regardless of how many rules were matched), thus after finding the very first match in the Walmart group, I'd like to activate a rule, and then short-circuit and "Skip" to the next group of rules for NIKE - to see if any of the matches are found in the next group. I've implemented this functionality using a Match object, which I assert into WorkingMemory whenever I find a match for customer, then all my rules check for absence of Match for given customer... This works, but I wonder if there is a better way to do it - using Agenda Groups, maybe - once I find ONE match for Walmart, skip to the next Agenda Group?! Could someone comment on this? THanks, James -- View this message in context: http://www.nabble.com/Short-circuit-rules-by-group-%21-tf3222142.html#a8 949165 Sent from the drools - user mailing list archive at Nabble.com. _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users