[Urgent] Error in ontext assist in DSLR Editor
by hamza bakkali
Hi All,
I have been using drools 4 for couple of months now and I am starting to get
the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2
(Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor:
Context Assist + space + enter removes/replaces the whole line, not only the
place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context
menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit
ctrl space, id1 shows in the list. I hit enter the whole line disappear, and
I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
15 years
Re: [rules-users] Problems with Guided Rule Editor in Eclipse
by John Peterson
I'm working in Eclipse only right now, but not using DSL for this particular situation (yet). I've manage to make the error go away by removing the package name from drools.package, however, when I attempt to run the code that builds the application to run the rule, it fails to resolve the Object (Fact) used in the rule.
Copying the generated DRL to a .drl file works fine.
>Date: Wed, 16 Mar 2011 18:20:33 +0100
>From: Vincent Legendre <vincent.legendre(a)eurodecision.com>
>Subject: Re: [rules-users] Problems with Guided Rule Editor in Eclipse
>To: Rules Users List <rules-users(a)lists.jboss.org>
>Message-ID: <4D80F161.3080403(a)eurodecision.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>I was pretty sure to have seen something about sample BRL from Guvnor appears in error in eclipse.
>I can find some on JIRA, but never the same problem I have ... May be on another forum, but not JIRA ...
>
>Anyway, my problem is using DSL in BRL opened with eclipse plugin Guided Editor. Seems that the transformation to DRL is incomplete for DSL
>sentences, and action part cannot add DSL sentences. I will try with the last version and see if it is still there, and then post a clear new JIRA...
>
>But, re-reading your post, may be your problem is different ... As far I can remember, BRL with no DSL in it works ok ... try to copy your generated DRL >in a new DRL file to see what happens
15 years
drools design question
by marunam
Hi,
We are developing an insurance application and we have decided to use drool
rules for our business rules
Now, we could have global business rules(applies to all states), specific to
state, specific to factor X, specific to factor Y etc. This way we are
expecting many drl files.
Now, when the application runs, we would know the values for state, factor
X, factor Y etc. and using these values we would determine(using database)
which drl files to load dynamically and just run the rules in those drls.
Is this approach recommended? Do you have any suggestions?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-questio...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years
Re: [rules-users] Problems with Guided Rule Editor in Eclipse
by John Peterson
Thanks for the response, Vincent. Do you happen to have a link to the URL for the JIRA? I was looking for it, but haven't found it yet.
It would seem to me that this is basic functionality. It sounds, from your response, that BRL is just not the focus.
jp
> Date: Wed, 16 Mar 2011 12:17:02 +0100
> From: Vincent Legendre <vincent.legendre(a)eurodecision.com>
> Subject: Re: [rules-users] Problems with Guided Rule Editor in Eclipse
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID: <4D809C2E.4070009(a)eurodecision.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I have the same problem with BRL editor under eclipse. Also the action part dialog box does not show DSL phrases ...
> The plugin is incomplete/buggy and shows errors but rules are correct (you can compile and run them).
> This problem is the same since version 5.0. There is a JIRA for that since then ...
> I don't know when a fix is planned, but my feeling is that nobody uses the guided editor under eclipse (dsrl editor works well and provide completions
> on facts and DSL sentences). But it is not easy when you have rules that comes from Guvnor ...
>
> Le 15/03/2011 20:47, John Peterson a ?crit :
> > I am experimenting with the Guided Rule Editor in Eclipse, but I am
> > unable to get a Guided Rule to parse.
> > I have created a Drools Project using the basic "Hello World" example
> > for starters. I've created a class called "Item" with 3 attributes --
> > itemPrice (float), ItemNumber (int), and itemDescription (String) with
> > getters/setters. I do a "New-Drools-Guided Rule" to create a .brl
> > file called "GuidedRule.brl" and get the "drools.package" created
> > automatically. In drools.package, I add "package com.sample;" and
> > "import com.sample.Item;" and save it.
> > Then I go over to GuidedRule.brl and create a simple rule in the
> > guided editor (this is the DRL view of it):
> > rule "GuidedRule"
> > dialect "mvel"
> > when
> > item : Item()
> > then
> > item.setItemDescription("New Description"); end When I click "save"
> > I get errors.
> > On the Generated drl (read only), I get two problems ->
> > BuildError: Unable to build expression for 'consequence': Failed to
> > compile: 2 compilation error(s):
> > - (1,4) unqualified type in strict mode for: item
> > - (1,44) unable to resolve method using strict-mode:
> > java.lang.Object.setItemDescription(java.lang.String) '
> > item.setItemDescription( "New Description" );'
> > On the brl source view, I get an error at the <attributes> ->
> > BuildError: Unable to resolve ObjectType 'Item'
> > It seems to not be able to see my class, which is public, belonging to
> > the same package, and included as an import in drools.package. I can
> > get the rule to work if I don't reference Item (simple "eval(true)" in
> > the LHS, for example)....
> > I am running Drools 5.1.1 on Eclipse 3.5.
> > Am I overlooking something simple here?
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> --
> Vincent LEGENDRE
> /Consultant S?nior/
15 years
Drools Execution Server - SOAP Support / XML Format
by Miguel Fernando Cabrera
Hello to all,
Right now I am testing Drools Execution Server 5.1.1
I already made it work with Jboss and ran the test using the restful
interface (I used the Poster firefox extension).
Now I was checking if I could create a SOAP Service. On the documentation
is not even mentioned [1] . So I kept looking. On the Weblog of Lucas
Amador, I found this article[2] (it was written some months ago but compared
to the documentation it looks updated) and it says:
"If you want to have SOAP support, you need to create your custom Drools
Policy." (Whathever that means).
However, I see some example of Soap endpoint "out-of-the-box" in this post
of Salaboy [3]. I tried to reproduce those configuration but I failed to do
so because it on the webpage showing the available services
(in my case http://localhost:8080/drools-5.1.1-server/kservice/ ) the Soap
endpoint never shows up.
Here is the camel-server.xml (http://pastebin.com/Hf0yvNHQ) and the
knowledge-services.xml (http://pastebin.com/jqrUS9aK). They are both very
basic, they are small modification to the default ones.
So, rounding up, my question is, does Drools Execution Server 5.1.1 supports
Soap endpoints? if so, based on the configuration files what am I doing
wrong?
And additional question is, where I can find the XML serialization format.
For example, when using the test that comes with drools-server (REST end
point) I sent the following xml:
<batch-execution lookup="ksession1">
<insert out-identifier="person1" return-object="true">
*<org.test.Message>*
* <text>Wepaje</text>*
* </org.test.Message*>
</insert>
</batch-execution>
What if for example org.test.Message contains other complex object (with
properties and so on). How the XML should look like?
Thanks in advance for your help
[1]
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-integrati...
[2]
http://lucazamador.wordpress.com/2010/07/20/drools-server-configuration-u...
[3]
http://salaboy.wordpress.com/2010/11/24/drools-server-drools-grid-for-rem...
--
Miguel Fernando Cabrera Granados
http://mfcabrera.com
"A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es
mayor el viento que se opone a su ascenso." - José Ingenieros
15 years
Re: [rules-users] A question about using "lane" in Drools-flow (Tihomir Surdilovic)
by Wen Yao
Thanks Tihomir.
Attached is my bpmn file which I haven't edited. I don't think I am using
jBPM. I just new a ruleflow file which is supported by Drools 5.1. It's a
bpmn file.
For question 3, I created a bpmn file in eclipse and didn't edit it. Then
try to import it into oryx. It didn't work.
Thanks for your answer!
Best regards,
----
Wen
On Tue, Mar 15, 2011 at 12:00 PM, <rules-users-request(a)lists.jboss.org>wrote:
> Send rules-users mailing list submissions to
> rules-users(a)lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
> rules-users-request(a)lists.jboss.org
>
> You can reach the person managing the list at
> rules-users-owner(a)lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
> 1. Importing existing .dslr + .dsl to Guvnor (wantastic)
> 2. Re: A question about using "lane" in Drools-flow
> (Tihomir Surdilovic)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 15 Mar 2011 07:24:16 -0700 (PDT)
> From: wantastic <wantastic(a)gmail.com>
> Subject: [rules-users] Importing existing .dslr + .dsl to Guvnor
> To: rules-users(a)lists.jboss.org
> Message-ID: <1300199055985-2681597.post(a)n3.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hello everyone,
>
> I am a newbie to Guvnor. I have a set of .dslr files with .dsl to
> translate
> them.
> I know I can just copy and paste .dslr file and .dsl file. However, the
> problem is that
> I call external function within .dsl file and when I try to validate the
> dsl, it complains for not having the method.
>
> ex)
>
> [condition][Trade]xpathMatch "{xpath}"=trade : Trade( type ==
> Trade.TRADE_TYPE ) and eval( DslHelper.xmlContentMatches(trade, "{xpath}")
> )
>
> This is my condition and it has all models like Trade. However, it
> complains
> about not having DslHelper function. This function has so many dependencies
> that I cannot upload through POJO jar.
>
> Is there any elegant way to solve this problem?
>
>
> Thanks in advance :)
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Importing-existing-ds...
> Sent from the Drools - User mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 15 Mar 2011 10:24:40 -0400
> From: Tihomir Surdilovic <tsurdilo(a)redhat.com>
> Subject: Re: [rules-users] A question about using "lane" in
> Drools-flow
> To: rules-users(a)lists.jboss.org
> Message-ID: <4D7F76A8.5030108(a)redhat.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On 3/14/11 9:27 PM, Wen Yao wrote:
> > Hi,
> >
> > When I was working on a project using Drools-flow, I had some problems
> > with the "lane" and "laneset".
> >
> > 1. In eclipse, I used the Flow editor to create a process and add some
> > swimlanes. When I tried to run it, it always had this error:
> > org.xml.sax.SAXParseException: <lane> is after an invalid element:
> > org.drools.xml.Handler
> > Then I looked into the XML file and changed the following code:
> >
> > <laneSet>
> > <lane name="Patient" >
> > </lane>
> > <lane name="Doctor" >
> > </lane>
> > </laneSet>
> >
> > to:
> > <laneSet>
> > <lane name="Patient" >
> > </lane>
> > </laneSet>
> > <laneSet>
> > <lane name="Doctor" >
> > </lane>
> > </laneSet>
> > It worked. Could you explain why?
>
> Are you using jbpm-5.0-Final? I am not able to reproduce the mentioned
> error. Upload your bpmn2 please.
> >
> > 2. I created a process in the web-based oryx designer with a pool that
> > contains several lanes. Then I imported this file in Eclipse, which
> > cannot open it correctly because of the lane issue, since the format
> > in oryx exported file is like this:
> > <laneSet id="XXX">
> > <lane name="Patient" >
> > </lane>
> > <lane name="Doctor" >
> > </lane>
> > </laneSet>
> Oryx follows the bpmn2 schema correctly.
> >
> > 3. The bpmn file I created in Eclipse, although validated to be
> > correct, cannot be imported in Oryx. I am wondering whether it can be
> > done this way.
> Is this after you made your custom xml changes?
> >
> > Could you kindly address my concerns?
> >
> > Thank you very much!
> >
> >
> >
> > Best regards,
> > ----
> > Wen
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/rules-users/attachments/20110315/9a11773...
>
> ------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> End of rules-users Digest, Vol 52, Issue 67
> *******************************************
>
15 years
InvocationTargetException in KnowledgeStoreServiceImpl - full code
by Odelya Holiday
Hi!
I posted my previous message from the web client and it was corrupted. So here is the full one:
get InvocationTargetException after the following:
return constructor.newInstance( kbase, conf, env );
in KnowledgeStoreServiceImpl.
I see that in return (T) constructorAccessor.newInstance(initargs) of Constructor class it throws the InvocationTargetException.
The exception is null so I can't see what it the problem!
I call the code from this:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
I define the transaction manager in my spring beans like this:
<!-- Bitronix Transaction Manager embedded configuration -->
<bean id="xaDataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource"
init-method="init" destroy-method="close">
<property name="className" value="bitronix.tm.resource.jdbc.lrc.LrcXADataSource" />
<property name="uniqueName" value="java/DS1" />
<property name="maxPoolSize" value="5" />
<property name="minPoolSize" value="0" />
<property name="allowLocalTransactions" value="false" />
<property name="testQuery" value="SELECT 1 FROM DUAL" />
<property name="driverProperties">
<props>
<prop key="user">username</prop>
<prop key="password">username</prop>
<prop key="url">url</prop>
<prop key="driverClassName">oracle.jdbc.OracleDriver</prop>
</props>
</property>
</bean>
<bean id="btmConfig" factory-method="getConfiguration"
class="bitronix.tm.TransactionManagerServices">
<property name="serverId" value="spring-btm" />
</bean>
<bean id="bitronixTransactionManager" factory-method="getTransactionManager"
class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig,xaDataSource"
destroy-method="shutdown" />
<bean id="jtaTransactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="bitronixTransactionManager" />
<property name="userTransaction" ref="bitronixTransactionManager" />
</bean>
<!-- end of Bitronix Transaction Manager embedded configuration -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="OnMediaSessionFactory" />
</bean>
I see that bitronix is up via the debugging messages. (2011-03-16 12:14:53,399 DEBUG ( PoolingDataSource.java:84) - building XA pool for java/DS1 with 0 connection(s) etc..)
in persistence.xml I have:
<persistence-unit name="org.drools.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java/DS1</jta-data-source>
<mapping-file>persistenceorm.xml</mapping-file>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup" />
</properties>
</persistence-unit>
What could cause the problem?
When I defined the btm with tomcat and not with spring - it worked fine. (but I had context reloading problems). when I define it only with spring - it get this weird exception.
Thanks!
Odelya
15 years
Can business people write rules?
by Jim West
Hi there,
True, DSLs allows us to write rules (on DSRLs) in plain English, and
friendly enough for business people; but our use case requires business
people to write their own rules.
We found some support for this inside Guvnor. Guvnor's manual describe this
in:
1.4.2.4.1.2. Augmenting with DSL sentences
1.4.2.4.2. DSL rulesHowever, it appears once you include a "DSL Sentence" in
a Business rules with the guided editor, you can not modify (or build on
top) that row of the rule any further (forcing us to define the DSL Sentence
to be self contained since nothing can be added to that rule row through the
guided editor). Is this limitation going to be waived in the future?
Also, Augmenting with DSL sentences presents a 'form like' with data entries
for the rule author. This is good, but is it possible to make these data
entries 'combo boxes like' and actually provide to the rule author with a
list of options for each data entry? Something similar to the dynamic enum
support already in Guvnor.
Thanks in advance for your help/comments.
Best regards,
Jim
15 years
Problems with Guided Rule Editor in Eclipse
by John Peterson
I am experimenting with the Guided Rule Editor in Eclipse, but I am unable to get a Guided Rule to parse.
I have created a Drools Project using the basic "Hello World" example for starters. I've created a class called "Item" with 3 attributes - itemPrice (float), ItemNumber (int), and itemDescription (String) with getters/setters. I do a "New-Drools-Guided Rule" to create a .brl file called "GuidedRule.brl" and get the "drools.package" created automatically. In drools.package, I add "package com.sample;" and "import com.sample.Item;" and save it.
Then I go over to GuidedRule.brl and create a simple rule in the guided editor (this is the DRL view of it):
rule "GuidedRule"
dialect "mvel"
when
item : Item()
then
item.setItemDescription("New Description");
end
When I click "save" I get errors.
On the Generated drl (read only), I get two problems ->
BuildError: Unable to build expression for 'consequence': Failed to compile: 2 compilation error(s):
- (1,4) unqualified type in strict mode for: item
- (1,44) unable to resolve method using strict-mode: java.lang.Object.setItemDescription(java.lang.String) ' item.setItemDescription( "New Description" );'
On the brl source view, I get an error at the <attributes> -> BuildError: Unable to resolve ObjectType 'Item'
It seems to not be able to see my class, which is public, belonging to the same package, and included as an import in drools.package. I can get the rule to work if I don't reference Item (simple "eval(true)" in the LHS, for example)....
I am running Drools 5.1.1 on Eclipse 3.5.
Am I overlooking something simple here?
15 years