how to update object modified by call to remote web service
by lhorton
We are at 5.2.0 Final
We recently moved our rules server (written in-house) to its own Tomcat
instance. Some of our existing rules call a service to modify facts. With
the move of the rules server, these calls to the service no longer happen in
the working memory of the rules server. The rule must now capture the
return from the call to the remote service, in order to see the changes made
by the remote service call.
Within the rule, this change is working fine. The RHS was:
applicationService.applyInstruction($step);
as above, the $step fact would not be updated within the rule WM now that
the service is called remotely. However, when I changed this to
$step = applicationService.applyInstruction($step);
then $step did have the changes(I am verifying this by writing debug info to
the log). BUT, the object that was passed in to execute() on the knowledge
session did NOT have the changes. I have tried several things to fix this.
one was to update($step) but this failed with "Update error: handle not
found for object," I assume because the fact handle changed in the object
returned from the service call.
I also tried some variations on retracting and inserting the step:
retract($step);
$step = applicationService.applyInstruction($step);
insert($step);
and also tried using a different variable name:
retract($step);
$step2 = applicationService.applyInstruction($step);
insert($step2);
update($step2);
both these above did not get errors, but also did not cause the updated
object to return from session.execute() call.
To summarize:
in a call to execute() on a stateless knowledge session, an object is passed
in
a rule fires that calls a remote service that modifies the object
within the rule, we catch the changed object that is returned from the
service call
within the rule, the changes to the object ARE visible
on the return from execute(), the changes are NOT visible
thanks for your help...
--
View this message in context: http://drools.46999.n3.nabble.com/how-to-update-object-modified-by-call-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
drools-server Vs drools-grid
by DroolersEye
Hi,
Please let me know what is the difference between drools-server and
drools-grid, when I read salaboy blog (great blog contains lots of useful
informations about drools, Hats off to him) and drools web site documents I
am not clear, Please provide some abstract details about these two
components.
thanks & best regards,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/drools-server-Vs-drools-grid-tp3227204p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
Fact in Guvnor
by S.M.H.Jamali
Hello All
After upload a jar file which contains some java bean (Fact) to Guvnor , gwt-console don't detect my process definitions ! I have facts , processes and rules all in Guvnor and i build the defaultPackage successfully but gwt-console process list don't show my newly added process !
Is it a gwt-console bug ? or is it my error ? can you help me ?
Thanks in advance
S.M.H.Jamali
14 years, 7 months
Drools-Fusion : Inserting an Event in to an "entry-point" stream in the RHS of a rule?? Pls help
by Chetan Mahadev
Hi
Can we insert an Event in the RHS part of a rule to an entry-point?
basically i am trying to do this. Pls let me know if this is possible? if
not any alternative approaches? Any example would be useful pls
declare TransactionEvent
@role( event )
end
$tmp : TestClass()
$tmp.message == "TRUE"
then
TransactionEvent ev1 = new TransactionEvent (); // This should be
inserted in to an entry-pont "Temporal Reasoning" stream
ev1.setMessage("Temporal Reasoning")
insert (ev1) to entry-point "Temporal Reasoning"
end
rule "Temporal Reasoning"
$tmp : TransactionEvent ( message== "Temporal Reasoning") from entry-point
"Temporal Reasoning"
then
System.out.println("Rule fired due to entry point ");
end
Regds
Chetan
14 years, 7 months
Java 1.4 Application
by Sumeet Karawal
Hi All,
I have to use Drools in a Java Application with Java version 1.4
Can I use Drools 5.0 for that or do I have to use Drools 4.0.x version?
Please help me on this.
Thanks & Regards
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 7 months
False error indication
by Hezi Stern
I am using Drools 5.2.0 and I encountered the following problem perhaps
there is a solution or workaround.
I added a new operator called supersetOf which works fine.
When I add a rule of the sort:
when
$myClass: MyClass(X supersetOf $z)
then
.
End
It works fine and no errors are displayed in the IDE (eclipse).
But when I use nested fields e.g:
when
$myClass: MyClass(X.Y supersetOf $z)
then
.
End
It works fine but I get an error indication by the eclipse marking the drl
as a compilation error but looking inside the drl shows no error.
Is there any way to resolve this or even workaround by suppressing the error
indication?
It is quite annoying as my project is filled with false error indication
which kind if make it difficult to work.
Thanks
Hezi
14 years, 7 months