JTA Persistence, Fact Objects and High Availability
by Miguel Paraz
Hi,
I'm looking at the possibility of using Drools to store the working state
of my app, in the form of rules.
Can JTA Persistence store fact objects? I read that the fact objects must
be Serializable - are there other requirements or caveats?
Can JTA Persistence take care of High Availability? Even if the system goes
down in the middle of a rules computation? Assuming the database handling
the JPA is a HA system.
Thanks!
Miguel
13 years, 4 months
Unsubscribe
by Brenda Chodkowski
Thank you!
Brenda Chodkowski
Software Engineer
brenda.chodkowski(a)ctg.com
Tel: Cell: 716-696-2313 (Monday, Tuesday) * 716-888-3681 (Wednesday, Thursday, Friday)
CTG * 700 Delaware Ave * Buffalo, NY 14209
www.ctg.com
[cid:image001.jpg@01CDB73A.23606B00]
The information transmitted is intended only for the person or entity to which
it is addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the
intended recipient is prohibited. If you are not the intended recipient of this
message, please contact the sender and delete this material from this computer.
13 years, 4 months
Debug rule functions ?
by ipeshev
Hello,
could some give me some tips for debugging *functions* in .drl ?
by now I'm not able to debug *inside the functions* which are called by the
rule sequence.
I follow the
http://docs.jboss.org/tools/3.0.0.GA/en/drools_tools_ref_guide/html_singl...
JBoss Drools Tools Reference Guide but what is show there is how to debug a
very simple *rule sequence*. I have no problem with that - following the
guide everything is ok.
BUT
There is nothing shown about a more complex case when there are functions
(java-like) in the .drl file and the rule calls one or more of these
functions. And one function calls another etc. (just like in normal
programming)
When a put a breakpoint inside functions I cannot debug them.
I can only debug the *rule* ("then" section)
Any help would be appreciated?
Or any official info if this supported at all.
versions etc.
Best Regards
Ivan
--
View this message in context: http://drools.46999.n3.nabble.com/Debug-rule-functions-tp3689774p3689774....
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Calling Technical rule assets in Guvnor
by Manasi
Hi,
How to call Technical rule assets stored in Guvnor from Java application?
Currently I have one drl rule which is stored in Technical rule assets
section.
But I am not able to call it from my Java application.
I am using following code to call my rules stored in Guvnor :
UrlResource urlResource = (UrlResource)
ResourceFactory.newUrlResource(http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/GuiKontrolKiss.FeltKnapRestriktionerKundeMedAnl/LATEST");
urlResource .setBasicAuthentication("enabled");
urlResource.setUsername("admin");
urlResource.setPassword("admin");
urlResource.setResourceType(ResourceType.PKG);
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
try {
kbuilder.add(ResourceFactory.newInputStreamResource(urlResource
.getInputStream()), ResourceType.PKG);
} catch (IOException e) {
e.printStackTrace();
}
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
// create session
StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();
NyssCaseSO caseSO = droolsRequest.getNyssCaseSO();
NyssCaseStateSO caseState = caseSO.getNyssCaseStateSO();
NyssOfferSO offerSO = droolsRequest.getNyssOfferSO();
session.insert(caseSO);
session.insert(offerSO);
session.insert(caseState);
AgendaFilter filter = new AgendaFilter() {
public boolean accept(Activation activation) {
if (activation.getRule().getName().contains("testDrl")) {
return true;
}
return false;
}
};
session.fireAllRules(filter);
for (Object o : session.getObjects()) {
if (o instanceof ResultSO) {
ResultSO resultSO = (ResultSO) o;
reply.setResultSO(resultSO);
}
}
session.dispose();
With above I am able to call my rules stored in *"Business rule assets"*
section.
Thanks,
Manasi
--
View this message in context: http://drools.46999.n3.nabble.com/Calling-Technical-rule-assets-in-Guvnor...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Error in adding BRL in Guvnor
by vargheseps
I have created a Model named applicationHealth which contain a class
“com.xyz.rims.model.Application” on Guvnor.
Also created a Business rule asset named ‘ApplicationHealthRule’ which
uses ‘Application’. I have
created a business rule task in a BPMN2 process and gave the
‘ruleflow-group’ as same as a Business rule assets .
kbuilder.add(ResourceFactory.newUrlResource(DROOLS_COMMON_URL+"ApplicationHealthRule/binary"),
ResourceType.BRL);
I used the above code to add the resource to kbuilder The error I get is:
[Unable to resolve ObjectType 'Application' : [Rule
name='ApplicationHealthRule']
]
--
View this message in context: http://drools.46999.n3.nabble.com/Error-in-adding-BRL-in-Guvnor-tp4020555...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Field value is different when and then section, very strange. Is it mvel vs java issue
by kina06
I have inserted 3 accounts into knowledge session with the following account
statuses 1-NEW, 2-TRANSFER,3-CLOSE.
EXPECTED BEHAVIOR:
As per below given rules, first rule should change all of them to 'pending'
status, so second rule should never fire and third rule always fire for
above 3 accounts.
ACTUAL BEHAVIOR:
second rule is fired for account with new status, i.e. the first one, but in
the system out its status is shown as PENDING before i set it to ERROR.
Can't figure out what's wrong with this, does it has to do anything with
MVEL vs JAVA usage? I mean in when claues it's mvel and in then clause it's
java, so is that causing problem?
rule "Rule1"
salience -1
when
account : Account();
then
System.out.println("Ac state rule1 before change "+
account.getAccountStatus());
account.setAccountStatus( "PENDING" );
System.out.println("Ac state rule1 after change "+
account.getAccountStatus());
end
rule "Rule2"
salience -2
when
account : Account(StringUtils.equals(accountStatus,"NEW"))
then
System.out.println("Ac state RuleNo2 before change "+
account.getAccountStatus());
account.setAccountStatus("ERROR");
System.out.println("Ac state RuleNo2 after change "+
account.getAccountStatus());
end
rule "Rule3"
salience -3
when
account : Account(StringUtils.equals(accountStatus,"PENDING"))
then
System.out.println("Ac state "+ account.getAccountStatus()+ ".
YES
this is expected");
end
--
View this message in context: http://drools.46999.n3.nabble.com/Field-value-is-different-when-and-then-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Re: [rules-users] Basic rules carrying state/field changes.
by Esteban Aliverti
What you need to understand is that rules evaluation and rules execution
happen in different times. Whenever you insert/update(modify)/retract a
fact, all the rules that could potentially match are evaluated by Drools. A
rule having its conditions satisfied generates an ACTIVATION (but the THEN
part is not yet executed). All the ACTIVATIONS are put together in
something called the AGENDA.
When you call fireAllRules() an algorithm (that takes into account the
salience of the rules) gets ONE activation from the AGENDA and executes it
(the THEN part gets executed). If the execution didn't
insert/modify/retract any fact, then another ACTIVATION is selected and
executed until the AGENDA is empty. If an ACTIVATION causes the
insertion/modification/retraction of a fact, then the rules are evaluated
again possibly generating new ACTIVATIONS or cancelling existing ones.
All this should be explained in drools documentation:
Drools Introduction:
http://docs.jboss.org/drools/release/5.5.0.CR1/droolsjbpm-introduction-do...
Drools Expert:
http://docs.jboss.org/drools/release/5.5.0.CR1/drools-expert-docs/html_si...
I'm not in favor of answering Drools related questions arriving directly to
my inbox. This is the last email I'm going to reply to.
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com
On Tue, Oct 30, 2012 at 5:26 PM, <reachkn6(a)gmail.com> wrote:
>
>
> http://drools.46999.n3.nabble.com/Field-value-is-different-when-and-then-...
>
> Esteban, you seem to understand how Drools Rules work, I'm trying to
> understand how a field value changed in 'then'/consequence be retained so
> next rule can see it.
>
> Posted above is a link for my question, can you help me fix it. Share any
> links that helps me understand how to do it right, I have written about 100
> rules, to my surprise this basic fact that one field changed in rule 1 is
> not visible in rule2, I couldn't test earlier as my data wasn't good enough.
>
> Any help is greatly appreciated.
>
13 years, 4 months
Guvnor 5.4.Final can't save BPMN process imported from 5.3 repo
by mpgong
Hello,
I'm looking to upgrade to from drools 5.3 to 5.4 and i'm having some issues
with Guvnor. The exported repo from 5.3 imported fine and my packages all
built fine but when i go to edit a process and try to save it, after i click
the check in button i get this error. I'm using designer 2.2 as well. Does
anyone know what might be causing this? Thanks.
18:22:48,601 INFO [org.drools.guvnor.server.RepositoryAssetService]
(http--0.0.0.0-8080-2) USER:admin CHECKING IN asset: [ScheduleReportImport]
UUID: [dc38e1fd-987d-4d31-93db-0bbd2d8034f4]
18:22:48,632 ERROR [org.drools.guvnor.server.RepositoryServiceServlet]
(http--0.0.0.0-8080-2) Service method 'public abstract java.lang.String
org.drools.guvnor.client.rpc.AssetService.checkinVersion(org.drools.guvnor.client.rpc.Asset)
throws com.google.gwt.user.client.rpc.SerializationException' th
rew an unexpected exception: java.lang.NullPointerException:
java.lang.NullPointerException
at org.drools.repository.AssetItem.updateContent(AssetItem.java:390)
[guvnor-repository-5.4.0.Final.jar:5.4.0.Final]
at
org.drools.guvnor.server.contenthandler.drools.BPMN2ProcessHandler.storeAssetContent(BPMN2ProcessHandler.java:155)
[classes:]
at
org.drools.guvnor.server.RepositoryAssetOperations.checkinVersion(RepositoryAssetOperations.java:180)
[guvnor-webapp-core-5.4.0.Final.jar:5.4.0.Final]
at
org.drools.guvnor.server.RepositoryAssetOperations$Proxy$_$$_WeldClientProxy.checkinVersion(RepositoryAssetOperations$Proxy$_$$_WeldClientProxy.java)
[guvnor-webapp-core-5.4.0.Final.jar:5.4.0.Final]
at
org.drools.guvnor.server.RepositoryAssetService.checkinVersion(RepositoryAssetService.java:155)
[guvnor-webapp-core-5.4.0.Final.jar:5.4.0.Final]
at
org.drools.guvnor.server.RepositoryAssetService$Proxy$_$$_WeldClientProxy.checkinVersion(RepositoryAssetService$Proxy$_$$_WeldClientProxy.java)
[guvnor-webapp-core-5.4.0.Final.jar:5.4.0.Final]
at
org.drools.guvnor.server.RepositoryServiceServlet.checkinVersion(RepositoryServiceServlet.java:596)
[guvnor-webapp-core-5.4.0.Final.jar:5.4.0.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_01]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_01]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_01]
at java.lang.reflect.Method.invoke(Method.java:601)
[rt.jar:1.7.0_01]
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
[gwt-servlet-2.3.0.jar:]
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
[gwt-servlet-2.3.0.jar:]
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
[gwt-servlet-2.3.0.jar:]
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
[gwt-servlet-2.3.0.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.10.Final.jar:]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.10.Final.jar:]
at
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.10.Final.jar:]
at
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.10.Final.jar:]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)
[jboss-as-web-7.1.0.Final.jar:7.1.0.Final]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626)
[jbossweb-7.0.10.Final.jar:]
at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2033)
[jbossweb-7.0.10.Final.jar:]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-4-Final-can-t-save-BPMN-proces...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months