Logging in Drools?
by Shah, Malay
Hi All,
Is there a way to log drools activity when the engine is running? I tried to look but could not find any online documentation for this.
Thanks,
Malay Shah
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.
14 years, 8 months
RES: Behavior changes between Drools 5.0.1 and 5.1.0
by Carlos Henrique Pinto da Sillva
Hi all,
Last week I sent this message asking for some help identifying either an usage error from us or a possible bug in Drools Fusion 5.1.0, but so far got no answer. If any of you fellows can find any mistake in our implementation please let me know, otherwise I'll assume this is indeed a bug in 5.1.0 and proceed to register it. Thanks in advance for any help.
Carlos
>Hi all,
>We're evaluating the use of Drools Fusion as rule engine for one of our
>projects, but after updating from version 5.0.1 to 5.1.0 to fix one
>persistence issue we faced new errors and some unexpected behavior
>changes in already tested parts of our code, and we aren't unsure if
>it's our fault due to incorrect assumptions or if it's resulting from a
>new bug introduced in last release. Here follows what we are doing:
>1) we declared this in our Test_Rules.drl:
>declare UserEvent @role( event ) @expires( 30s ) end
>query "get user by login" (String login) user : UserEvent(user.login ==
>login) end
>2) this is the code we use to retrieve the Drools session (implemented
>in a singleton):
>public StatefulKnowledgeSession getKnowledgeSessionInstance() {
>if (session == null) { kbase = readKnowledgeBase();
>KnowledgeSessionConfiguration conf =
>KnowledgeBaseFactory.newKnowledgeSessionConfiguration(); session =
>kbase.newStatefulKnowledgeSession(conf, null); }
>return session; }
>3) that's how we load the rules (some non-pertinent code was omitted):
>private KnowledgeBase readKnowledgeBase() { KnowledgeBuilder kbuilder =
>KnowledgeBuilderFactory.newKnowledgeBuilder();
>KnowledgeBaseConfiguration config =
>KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
>config.setOption(EventProcessingOption.STREAM);
>kbuilder.add(ResourceFactory.newClassPathResource("Test_Rules.drl"),
>ResourceType.DRL); KnowledgeBuilderErrors errors = kbuilder.getErrors();
>if (errors.size() > 0) { // (...) throw new
>IllegalArgumentException("Could not parse knowledge."); } KnowledgeBase
>kbase = KnowledgeBaseFactory.newKnowledgeBase(config);
>kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); return
>kbase; }
>(NOTE: Up to this point the code behaves exactly the same way in both
>versions and everything works as expected.)
>4) in this method we check our event expiration, and that's where things
>starts to behave different. In version 5.0.1, the code always worked in
>the same way, returning a null reference to userValidation if the
>expiration time is reached. Also, handleQuery is always an instance of
>EventFactHandle. Based in userValidation reference being null or not, we
>either retrieve it or update it. Again, non-related code was ommited:
>private UserTrackForValidation assertDesktopEvent(DesktopDeviceEvent
>event) { UserEvent userValidation = null; StatefulKnowledgeSession
>session =
>sessionFactory.getKnowledgeSessionInstance(createEnviroment());
>QueryResults results = session.getQueryResults("get user by login", new
>String[] {event.getLogin()});
>if (results.size() > 0) { QueryResultsRow row =
>results.iterator().next(); FactHandle handleQuery =
>row.getFactHandle("user"); userValidation = (UserTrackForValidation)
>row.get("user"); }
>if (userValidation == null) { try { userValidation =
>entityDAO.getUserTrackByLogin(event.getLogin()); } catch (Exception e) {
>e.printStackTrace(); }
>// (...) } else { // (...) session.update(handleQuery, userValidation);
>session.fireAllRules(); } }
>return userValidation; }
>However, starting with version 5.1.0, we observed some odd behaviors:
>a) after time expiration, we may or may not receive a null reference to
>userValidation, which renders the test line "if (userValidation ==
>null)" erratic; b) even when we receive a (as far as we can tell) valid
>reference to userValidation, sometimes a NullPointerException is raised,
>as can be seen in the following stacktrace:
>java.lang.NullPointerException at
>org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.jav
>a:1329) at
>org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.jav
>a:1288) at
>org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSes
>sionImpl.java:248) at
>br.com.todobpo.lam.ejb.session.ContactCenterRuleServiceImpl.assertSimple
>Event(ContactCenterRuleServiceImpl.java:191) at
>br.com.todobpo.lam.ejb.session.ContactCenterRuleServiceImpl.insertEvent(
>ContactCenterRuleServiceImpl.java:89) at
>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39) at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
>at
>org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.j
>ava:122) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:111) at
>org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvo
>cationWrapper.java:69) at
>org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorS
>equencer.java:73) at
>org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(Interc
>eptorSequencer.java:59) at
>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39) at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
>at
>org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:1
>74) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(
>InvocationContextInterceptor.java:72) at
>org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextIn
>terceptor_z_fillMethod_1000702.invoke(InvocationContextInterceptor_z_fil
>lMethod_1000702.java) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(Invoc
>ationContextInterceptor.java:88) at
>org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextIn
>terceptor_z_setup_1000702.invoke(InvocationContextInterceptor_z_setup_10
>00702.java) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(Cach
>edConnectionInterceptor.java:62) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(T
>ransactionScopedEntityManagerInterceptor.java:56) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInte
>rceptor.java:47) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.tx.StatelessBMTInterceptor.handleInvocation(StatelessBMTI
>nterceptor.java:106) at
>org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:55)
>at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessIn
>stanceInterceptor.java:68) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
>at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterc
>eptor.java:76) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
>at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3Authe
>nticationInterceptorv2.java:186) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationIntercepto
>r.java:41) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerSh
>utdownInterceptor.java:67) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(
>CurrentInvocationInterceptor.java:67) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessConta
>iner.java:421) at
>org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(Inv
>okableContextClassProxyHack.java:53) at
>org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91) at
>org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemoti
>ngInvocationHandler.java:82) at
>org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
>at
>org.jboss.remoting.transport.socket.ServerThread.completeInvocation(Serv
>erThread.java:744) at
>org.jboss.remoting.transport.socket.ServerThread.processInvocation(Serve
>rThread.java:697) at
>org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java
>:524) at
>org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:2
>32) at
>org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvo
>ker.java:211) at org.jboss.remoting.Client.invoke(Client.java:1724)
>at org.jboss.remoting.Client.invoke(Client.java:629) at
>org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteIn
>terceptor.java:60) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropa
>gationInterceptor.java:61) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(Security
>ClientInterceptor.java:65) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.jav
>a:74) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
>at $Proxy7.invoke(Unknown Source) at
>org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerB
>ase.invoke(SessionProxyInvocationHandlerBase.java:207)
>at
>org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerB
>ase.invoke(SessionProxyInvocationHandlerBase.java:164)
>at $Proxy6.insertEvent(Unknown Source) at
>br.com.todobpo.lam.ejb.test.Authenticate.authenticationOk(Authenticate.j
>ava:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39) at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
>at
>org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMet
>hod.java:44) at
>org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallab
>le.java:15) at
>org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMetho
>d.java:41) at
>org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod
>.java:20) at
>org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
>.java:76) at
>org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
>.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>at
>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes
>tReference.java:46) at
>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
>va:38) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
>stRunner.java:467) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
>stRunner.java:683) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
>ner.java:390) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
>nner.java:197) at
>org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteIn
>terceptor.java:72) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropa
>gationInterceptor.java:61) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(Security
>ClientInterceptor.java:65) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at
>org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.jav
>a:74) at
>org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.jav
>a:102) at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
>at $Proxy7.invoke(Unknown Source) at
>org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerB
>ase.invoke(SessionProxyInvocationHandlerBase.java:207)
>at
>org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerB
>ase.invoke(SessionProxyInvocationHandlerBase.java:164)
>at $Proxy6.insertEvent(Unknown Source) at
>br.com.todobpo.lam.ejb.test.Authenticate.authenticationOk(Authenticate.j
>ava:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39) at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
>at
>org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMet
>hod.java:44) at
>org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallab
>le.java:15) at
>org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMetho
>d.java:41) at
>org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod
>.java:20) at
>org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
>.java:76) at
>org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
>.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>at
>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes
>tReference.java:46) at
>org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
>va:38) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
>stRunner.java:467) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
>stRunner.java:683) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
>ner.java:390) at
>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
>nner.java:197)
>c) handleQuery can either receive an EventFactHandle or a
>DisconnectedFactHandle, without no apparent pattern. For the later case
>(DisconnectedFactHandle), the returned class lacks a useful isValid()
>method (the current implementation only throws an exception), thus we
>are unable to check the returned object before using it;
>d) finally, we noticed that all mentioned errors happens only when we
>set the real time clock in the KnowledgeSessionConfiguration object.
>Using the pseudo clock, there are no runtime errors and the object
>expiration behavior appears to be correct, like in 5.0.1.
>So, after all this information, we have a couple questions:
>1) Is really correct to assume that after an event expiration the object
>reference will always be null (as observed up to version 5.0.1) ? If
>not, how can we determine the event associated object sanity ? 2) Why
>starting from version 5.1.0 we started to observe the occurrence of
>DisconnectedFactHandle ? Can this detail be safely ignored, or is this a
>sign that something went wrong when trying to retrieve the event ?
>3) Is there something flawed in our presented approach ? Or did we bump
>into a new bug ?
>Any help is apreciated.
>Carlos
Esta mensagem pode conter informa??o confidencial e/ou privilegiada, sendo seu sigilo protegido por lei. Se voc? n?o for o destinat?rio ou a pessoa autorizada a receber esta mensagem, n?o pode usar, copiar ou divulgar as informa??es nela contidas ou tomar qualquer a??o baseada nessas informa??es. Se voc? recebeu esta mensagem por engano, por favor avise imediatamente ao remetente, respondendo o e-mail e em seguida apague-o. Agradecemos sua coopera??o.
This message may contain confidential and/or privileged information, being the sigil protected by law. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
14 years, 8 months
Re: [rules-users] Drools Guvnor: Loading enums programmatically
by Nilima R
Hi All,
Could some one reply to the below mentioned problem..
Thanks,
Nilima
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
From:
Nilima R/PNE/TCS
To:
rules-users(a)lists.jboss.org
Date:
03/31/2010 03:37 PM
Subject:
Drools Guvnor: Loading enums programmatically
Hi All,
I'm trying to do a simple example of loading enums programmatically
following the Drools Guvnor Docuemntation.
I'm on Drools Guvnor 5, Java 1.6 running under Jboss.
I'm trying to define this 'data enumeration/drop down list'
package opensource.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SampleDataSource2 {
public Map<String, List<String>> loadData() {
Map<String, List<String>> data =
new HashMap<String,List<String>>();
List<String> d = new ArrayList<String>();
d.add("A");
d.add("B");
d.add("C");
d.add("D");
d.add("E");
data.put("Employee.band", d);
return data;
}
}
The jar containing the SampleDataSource2 has been defined as a model
within Guvnor and I defined another declarative model Employee with fields
name,band,rating.
Here's what I put in the 'Data enumeration' text window
Employee.band =(new SampleDataSource2()).loadData()
When validating the Data enumeration from Guvnor, I get the following
error:
Unable to load enumeration data.
unable to resolve class: DataEnumSource
Error type: org.mvel.CompileException
Any help will be highly appreciated ...
Thanks,
Nilima
=====-----=====-----=====
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, 8 months
Drools & objects' methods
by Bertrand Grottier
Hello,
In the documentation, it is written (4.8.2.1.1):
"A Field constraint specifies a restriction to be used on
a
named field"
A bit further:
"A field is derived from an accessible method of the
object.
If your model
objects follow the Java Bean pattern, then fields are exposed
using
"getXXX" or "isXXX" methods, where these methods take no
arguments, and return something. Within patterns, fields can
be
accessed using the bean naming convention..."
Is this mean that we have no access to our Objects' method ? (excepting getXXXX or isXXXX)
Is there a way to get around this ?
Thank you in advance.
Regards,
Benoît
_________________________________________________________________
Consultez vos emails Orange, Gmail, Yahoo!, Free ... directement depuis HOTMAIL !
http://www.windowslive.fr/hotmail/agregation/
14 years, 9 months
Drools Flow: Find a Session ID to reload the JPA Stateful session
by tolitius
Wait state is reached (request is sent to an external system), the flow is
persisted, the thread that persisted the flow is gone.
Now, the response came back from the external system, and now would be a
good time to resume the flow (reload the session):
StatefulKnowledgeSession ksession =
JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId, kbase, null,
env );
What would be the best approach to find this SessionID that was suspended?
Is there any out of the box [ flow / business ] mapping that can be used?
Thank you,
/Anatoly
--
View this message in context: http://n3.nabble.com/Drools-Flow-Find-a-Session-ID-to-reload-the-JPA-Stat...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Drools Flow: WORK_ITEM_ID as a flow variable
by tolitius
Not using WS Human Task Handler, just a custom work item handler (since not
every long running process is a human task):
Is there a way to use a Variable Persistence mechanism, to automatically
persist an ID of the work item that causes a flow to suspend [ puts it in a
wait state ]? This way when the flow resumes all we have to do is
processInstance.getVariable("workItemId") to get exactly _that_ work item ID
that needs to be completed.
[ I understand this can be done manually from the a custom work item
handler, but then a different approach is used, different tables get
updated, artificial relationship between session / processInstance and
workItem needs to be manually established, etc.. + we would not be able to
do "processInstance.getVariable("workItemId")" ]
Thank you,
/Anatoly
--
View this message in context: http://n3.nabble.com/Drools-Flow-WORK-ITEM-ID-as-a-flow-variable-tp680939...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Drools Guvnor: Loading enums programmatically
by Nilima R
Hi All,
I'm trying to do a simple example of loading enums programmatically
following the Drools Guvnor Docuemntation.
I'm on Drools Guvnor 5, Java 1.6 running under Jboss.
I'm trying to define this 'data enumeration/drop down list'
package opensource.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SampleDataSource2 {
public Map<String, List<String>> loadData() {
Map<String, List<String>> data =
new HashMap<String,List<String>>();
List<String> d = new ArrayList<String>();
d.add("A");
d.add("B");
d.add("C");
d.add("D");
d.add("E");
data.put("Employee.band", d);
return data;
}
}
The jar containing the SampleDataSource2 has been defined as a model
within Guvnor and I defined another declarative model Employee with fields
name,band,rating.
Here's what I put in the 'Data enumeration' text window
Employee.band =(new SampleDataSource2()).loadData()
When validating the Data enumeration from Guvnor, I get the following
error:
Unable to load enumeration data.
unable to resolve class: DataEnumSource
Error type: org.mvel.CompileException
Any help will be highly appreciated ...
Thanks,
Nilima
=====-----=====-----=====
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, 9 months