combining fact model and processes
by Jordi Alvarez
Hello, we are starting a project using Drools and we are interested in the
conbination of fact models defined in drl files and processes.
We have been looking for documentation regarding this issue, but we have
seen only examples of combining drl-defined types from within rules.
We are interested in using types defined in drl files (as explained in
section 4.7.2 of the drools engine reference) inside process constraints.
Is this possible?
many thanks in advance,
Jordi
14 years, 12 months
Merge repository in Guvnor and editing brl with eclipse plugin
by ioda100
Hi,
I try to figure out how to import a package from an instance of guvnor to
another instance of guvnor without destroying all the existing repository.
There is an import/export function in the administration part of guvnor but
it export all the repository and when import a repository, it's erasing all
before importing.
What i would like to be able to do is : i have a package with rules,
functions, enum, dsl, test scenarios... under an instance of guvnor and i
have another package under another instance and i would like to import the
second package to the other instance of guvnor without erasing the existing
repository. Is it a way to do this? i can't find it. maybe with the eclipse
plugin? I don't want to import from a drl file because i would loose the
graphical part (use of dsl, enum...).
My second question is that i try to use the guvnor plugin for eclipse to
manage rules in the guvnor repository. I can access to it and read/modify
all but i can't modify the ".brl" files, i get for all the files this
message : "Could not open the editor: An unexpected exception was thrown.
java.lang.NullPointerException
at org.drools.eclipse.rulebuilder.ui.ActionSetFieldWidget.(Unknown Source)
at
org.drools.eclipse.rulebuilder.ui.RuleModeller.addActionSetFieldWidget(Unknown
Source)
at org.drools.eclipse.rulebuilder.ui.RuleModeller.redrawRhs(Unknown Source)
at org.drools.eclipse.rulebuilder.ui.RuleModeller.reloadRhs(Unknown Source)
at org.drools.eclipse.rulebuilder.ui.RuleModeller.reloadWidgets(Unknown
Source)
at org.drools.eclipse.rulebuilder.editors.BrlPage.setModelXML(Unknown
Source)
at org.drools.eclipse.rulebuilder.editors.RuleEditor.pageChange(Unknown
Source)
at
org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1076)
at
org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:597)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:361)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:286)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2857)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2668)
at org.guvnor.tools.utils.PlatformUtils.openEditor(Unknown Source)
at org.guvnor.tools.views.RepositoryView.doubleClick(Unknown Source)
at org.guvnor.tools.views.RepositoryView.access$4(Unknown Source)
at org.guvnor.tools.views.RepositoryView$7.run(Unknown Source)
at org.guvnor.tools.views.RepositoryView$9.doubleClick(Unknown Source)
at
org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:821)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at
org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:819)
at
org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1419)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1195)
at
org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:238)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:235)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:296)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
"
Thanks in advance for your help.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Merge-repository-in-G...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 12 months
Drools 5.2.0-SNAPSHOT: NullPointerException in PatternBuilder#build
by ljnelson
See https://issues.jboss.org/browse/JBRULES-2932.
Stack:
Caused by: java.lang.NullPointerException
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:323)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:268)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:107)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:39)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:39)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1313)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:664)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:310)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:483)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
This is on a (monstrous) rules file that has compiled fine for months under
5.1.1 and under earlier 5.2.0-SNAPSHOT versions.
Best,
Laird
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-2-0-SNAPSHOT...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 12 months
Drools 5.2.0-SNAPSHOT: .drl broken?
by ljnelson
My rule that I'm using in unit testing only looks like this:
rule "Testing contains"
dialect "mvel"
when
Response( $answerSelections : answerSelections )
AnswerSelection( answer.ID in (2, 3) )
then
System.out.println("Testing contains activated")
end
Response has a getAnswerSelections() method. AnswerSelection has a
getAnswer() method. Answer has a getID() method.
During rule compilation, I get the following error:
Unable to Analyse Expression answer.ID == 2 || answer.ID == 3:
[Error: Failed to compile: 1 compilation error(s):
- (1,9) unqualified type in strict mode for: ID]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0] : [Rule name='Testing contains']
If I rewrite the rule using "||" explicitly I get the same error.
This didn't happen under 5.1.1.
I'm aware that 5.2.0-SNAPSHOT is a...um...work in progress. :-) But the
DRL compilation has worked up till now. Is my rule syntax OK? Do I just
need to wait?
Best,
Laird
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-2-0-SNAPSHOT...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 12 months
Drool Tutorial
by Heng hh
Hi all
I m new comer in drools. Can some one help me on this?
thanks and best regards
Heng
14 years, 12 months
Sliding windows and event retraction
by jwillans2
Hello,
I am using sliding windows in the form:
Obj(..) over window:length(1) from entry-point EP1
Where many events are being inserted into EP1. Reading the documentation I
expected Drools to infer from the window length that all events on EP1 apart
from the latest one can be retracted, is this correct? The reason I ask is
that I am not seeing retraction of events from EP1 when I debug the session,
and I am see behaviour which suggests the rule is firing against old events
on the entry point.
Basically I want to get to simulate that an entry point can only contain one
event at any point in time and that this event is the latest one to arrive.
Thanks,
James
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Sliding-windows-and-e...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 12 months
Configure custom SystemEventListener via Drools Spring
by Steven Williams
Hi,
I have just started using the drools-spring integration (5.1.1) and I would
to use my own SystemEventListener instead of the default
PrintStreamSystemEventListener however I am not sure if it is possible or
how to configure it.
thanks
Steve
14 years, 12 months
WorkflowProcessInstance in DRL
by Gareth Evans
Hello,
I am having some problems using WorkflowProcessInstance in rules. I
have searched and not been able to find an answer to my question.
I am attempting to use rule flows to define business processes and
rules both in ruleflow groups to be executed on demand of the process
and outside of a ruleflow group for "global" rules and to potentially
direct the ruleflow(/process) is to run. Many of these processes are
comprised of subprocesses which I have been using sub flows to model.
I have used flow variables to store some minimal information about the
process such as what the process ID corresponds to in the existing
data model I am working with. My intent was so that I could use a
single rule flow group in many rule flows to extract information from
the database for the corresponding process ID in the working memory
(this extraction would also depend on other facts in the working
memory).
I've inserted the WorkflowProcessInstance by using an action node in
the "parent" process and it seems to work fine. My problem arises when
I am then in a "child" process/subflow and try to invoke this single
rule flow group with a different process ID in the flow variable,
there are no activations. I think this happens because the
WorkflowProcessInstance has not been updated in working memory so it
will not know that there might be a new process ID stored in the flow
variable (it has the same name in both flows as it is meant to
represent the same thing).
If I insert the WorkflowProcessInstance again in the sub flow I get
activations in the rule flow group for facts in the working memory
associated with both the parent and child sub flow which almost makes
sense except for this:
"We have added special logic to make sure that a variable
processInstance of type WorkflowProcessInstance will only match to the
current process instance and not to other process instances in the
Working Memory."
It seems that it is matching both instances of
WorkflowProcessInstance. I use the convention of starting variable
names from the LHS of a rule with a $ but I have tested it without and
I get the same result. Is this expected behaviour?
An alternative I've been trying to figure out is how to update the
WorkflowProcessInstance in working memory in the child process. Since
it is actually a different object I'm unsure how to do this. Should I
retract all instances and then insert the current? Is there a way to
do this more cleanly than looking through all working memory objects
and checking their type in an action node?
Finally (or perhaps firstly...), am I going about this correctly?
Cheers,
Gareth
14 years, 12 months