Re: [rules-users] Flow isn't behaving as I'd expect
I don't think it has. The history of the Jira ticket referenced above shows it getting pushed along from one release to the next. I did come up with an alternative that works, although it's a bit clunkier. Check this thread out - hopefully it'll help you - http://drools.46999.n3.nabble.com/Exclude-certain-rules-td3517185.html#a3519038 -- View this message in context: http://drools.46999.n3.nabble.com/Flow-isn-t-behaving-as-I-d-expect-tp3200994p3619107.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Exclude certain rules
I don't think you can reference a fact in the enabled condition. There's also no way to get a reference to the current rule like you can in the RHS, which is why I had to hard code the name. Vincent, thanks for the comment out the inheritance. I think that would work well for icechunk. I had forgotten about that feature. I've been searching for way to log when a rule was being evaluated and the best I've come up with is an eval() statement that writes a log message. It feels like a hack and I didn't want to clutter all of my rules with it, but inheritance would let me centralize that logging if I create a base rule that all other rules extend from. I'll have to look further into that. -- View this message in context: http://drools.46999.n3.nabble.com/Exclude-certain-rules-tp3517185p3519741.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Exclude certain rules
We did something similar - we implemented a table-based mechanism for turning rules on and off. The business users have a UI that allows them to toggle the rules via a simple boolean value. These values are cached and refreshed on a regular basis. Rather than inserting that cache as a fact, I chose to take advantage of the 'enabled' property, e.g.: // * // Rule 001 - Operator Flagged // When the operator has flagged the order as suspect, add suspect reason code "O" to // the order. // * rule "Rule 001 - Operator Flagged" enabled (FraudRuleEvaluationHelper.isRuleEnabled("Rule 001 - Operator Flagged")) To me, it's cleaner in that it separates the enablement of a rule from the actual business logic of the rule. The only drawback to this approach is that we have to keep the rule name and the string we pass to the enabled check in sync. In hindsight, it would have been better to just use rule numbers instead of the whole name. I'm not sure it's entirely appropriate for your use case since you have some business logic involved in the decision, but it may give you some ideas. -- View this message in context: http://drools.46999.n3.nabble.com/Exclude-certain-rules-tp3517185p3519038.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Preventing re-evaluation on modification of 'output' fact
Thanks for the feedback. When we find the time to implement these changes, I'll report back and let you know how they turned out. -- View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3510471.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Preventing re-evaluation on modification of 'output' fact
bump... Anyone have some thoughts on whether my revise approach makes sense? -- View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3509609.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Preventing re-evaluation on modification of 'output' fact
Thanks for the feedback. Wolfgang, that's a good thought, but we do need to do some re-evaluation along the way - just not as much as we're doing right now - so the 'dirty update' approach doesn't seem applicable here. Robert, your post got me thinking. If I'm interpreting what you're saying correctly - Drools is smart enough to know which rules depend on which types of objects in their LHS, so if you modify an object of a particular type, only the rules that depend on that type get re-evaluated. It seems completely logical, but I hadn't thought about it that way. Am I understanding the mechanics correctly? If so, I think we need to re-design our 'output' fact a bit. It currently contains several lists of codes - 2 lists for the order, 1 for the buyer, and 1 for each of the recipients. It's bound to a variable in the LHS of nearly every rule and is updated in the RHS of a majority of them, which I now realize is causing nearly every rule to be re-evaluated after the firing of a majority of the rules. As a result, performance deteriorates rapidly as the number of facts grows. I'm thinking that we should put the lists of suspect codes directly into the facts that they're related to so that when a list is updated, only the rules that care about that type of fact will get re-evaluated. We'd get rid of the 'output' fact altogether and instead, after the fireAllRules() call completes, we'd iterate through all of the facts we put into the rules engine and retrieve the lists of codes from each. How does this approach sound? -- View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3497378.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Preventing re-evaluation on modification of 'output' fact
I've continued digging in this issue and I've learned a few more things: - Per a suggestion I received via the mailing list, I tried making the 'output' fact a global. This gave me an incredible performance boost - going from > 10 mins to < 100 ms! - BUT - making the output fact a global caused some of my tests to fail. As it turns out, some rules modify the output, which causes re-evaluation to occur, as it should, but it means that I can't use a global. - Some rules specified no-loop and others specified lock-on-active. I tried using lock-on-active on all of them thinking that rules in subsequent ruleflow groups would be re-valuated at the end of the ruleflow group, but there was no change in performance. - In looking at some debugging statements generated via a process listener and an agenda listener, it looks like evaluation happens for all rules regardless of the ruleflow group or the lock-on-active option. Given the performance gain I saw with the switch to a global, I feel like the unnecessary re-evaluation is what's killing my performance as the number of recipients on an order grows. The results we're storing in the output fact only flow downward - i.e., the rules in each ruleflow group only care about modifications to the output fact made by prior groups. They don't care about modifications to the output fact made by other rules in that same group or by subsequent groups. Is there some other way to approach this that will cut down on the amount of reevaluation that's occurring? -- View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3471145.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Preventing re-evaluation on modification of 'output' fact
We're building a fraud detection application that uses rules to analyze orders and the buyers and recipients on those orders. As rules fire, they modify an 'output' fact, which is an object whose only intent is to record the results as rules fire. It's not used in the LHS of any rules other than to get a handle to it, e.g.: rule "Rule 001 - Operator Flagged" enabled (FraudRuleEvaluationHelper.isRuleEnabled("Rule 001 - Operator Flagged")) ruleflow-group "orderAnalysis" lock-on-active when $order: OrderFact(operatorFlagged==true) $results: FraudResultsDTO() then modify($results) { addOrderSuspectReason("O") }; FraudRuleConsequenceHelper.logRuleFiring($order.getOrderId(), "001"); end We're finding that as the number of facts increases, the processing team increases dramatically and I'm wondering if modifying the output fact the way we do causes the rules to get re-evaluated to see if any activations should be created or cancelled. Would removing the modify block help anything? Should we be thinking about this in some other way? -- View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3455022.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Regarding BPEL
I'm not sure your answer directly addresses the question. BPMN and BPEL aren't the same thing - BPMN is an unstructured diagramming notation that an be directly executed from within Drools, where as BPEL is a semi-structured language. While most BPMN flows can be translated to BPEL, not everything in BPMN can be represented in BPEL. I don't believe that Drools can directly execute BPEL (but I'm sure others will correct me if I'm wrong about that) -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Regarding-BPEL-tp3437430p3438367.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows
I've attached a simple stand-alone example to the ticket. -- View this message in context: http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3398007.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows
I created https://issues.jboss.org/browse/JBRULES-3234 JBRULES-3234 . I haven't yet been able to create a stand-alone example, but I'll keep trying. I did attach the three rules in question to the ticket. -- View this message in context: http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3397703.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Memory leak in 5.2/5.3
Thanks, Mark. That's what I figured. Not sure why it worked for Alejandro, but I won't pursue that avenue anymore. As I mentioned earlier, I did try to upgrade to 5.3.0.CR1, but there's a new bug in that version that makes it unusable for me. (You've been involved in that thread as well). I'm planning to open a Jira ticket for the bug this afternoon. Hopefully the next CR for 5.3.0 fixes that bug. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Memory-leak-in-5-2-5-3-tp3280351p3397595.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Memory leak in 5.2/5.3
Thanks for the reply, Alejandro. I'm currently using these jars: knowledge-api-5.2.0.Final.jar drools-core-5.2.0.Final.jar drools-compiler-5.2.0.Final.jar jbpm-flow-5.1.0.Final.jar jbpm-flow-builder-5.1.0.Final.jar jbpm-bpmn2-5.1.0.Final.jar I tried changing the three jbpm jars to 5.1.1 and I got a NoClassDefFoundError on org.drools.time.impl.TimerJobFactoryManager. I only see that class in drools-core-5.3.0.CR1.jar, so I think this is a dead-end for me unless I'm missing something. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Memory-leak-in-5-2-5-3-tp3280351p3397401.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Memory leak in 5.2/5.3
I'm trying to remove the listeners myself as Edson suggests, but I can't figure out how to make it work. I added this to my code just to see how many listeners there were (I expected to see three - one for each of my flows - based on what I see in the heap dump): Collection listeners = session.getAgendaEventListeners(); LOGGER.debug("Agenda event listeners: " + listeners.size()); I was planning to then iterate over the collection and call session.removeEventListener(), However, when I run it, get this exception: java.lang.ClassCastException: org.jbpm.process.instance.ProcessRuntimeImpl$3 incompatible with org.drools.event.rule.AgendaEventListener at org.drools.impl.StatefulKnowledgeSessionImpl.getAgendaEventListeners(StatefulKnowledgeSessionImpl.java:182) Any ideas? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Memory-leak-in-5-2-5-3-tp3280351p3397001.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows
Thanks for all of the feedback. I haven't tried W's handler, but I'm planning to. I did take Edson's advice and was able to get some more info. It appears to involve the interaction between 3 rules. For background, this is a fraud detection application. Under certain conditions, we need to look up additional customer information. Some rules are run to determine whether the lookup is required and then another rule actually does the lookup. In this case: Rule 021 says if the order is small, set the lookup flag to false Rule 042B says if the order is from a 'bad' country, set the lookup flag to true Rule 022 says if the lookup flag is true, do the lookup If rule 021 fires alone, then 022 does not fire and all is well. If rule 042B fires alone, then 022 fires and all is well. If 021 fires to turn off the lookup AND 042B fires to turn on the lookup, then 022 gets and NPE. As Edson suspected, the item is null and the 'rule' variable points to rule 021. I'm not sure if it matters, but each rules involved is in a different agenda group. As I mentioned, this works in 5.2.0.Final, but breaks in 5.3.0.CR1. Hope this helps pinpoint the issue. -- View this message in context: http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3393730.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] 5.3.0 CR1 has broken existing rules/flows
I recently upgraded from 5.2.0 Final to 5.3.0 CR1 because I was experiencing memory leaks in 5.2.0 Final due to a known bug that was fixed in 5.3.0 CR1. I have a suite of FitNesse tests that exercise the majority of my rules and flows, and I can demonstrate that the memory leak is indeed fixed, but one of my tests is now failing. If I revert back to 5.2.0 Final, all is well. I've been trying to determine the root cause for the past 3 days, but I'm not getting anywhere. I suspect that it's related to an interaction between 2 rules, e.g. one rule modifies something that causes the second rule to fire, but the second rule chokes in the consequence when it tries to execute a modify() statement. If I comment out the modify portion, the rule fires fine. I wish I could provide an example, but my implementation is too complex for that and I haven't been able to reproduce it in a stand-alone example. I know a stack trace probably won't tell you much, but I've included it below just in case. If anyone has any ideas, I'd love to hear them. If there's any additional information you think might help diagnose the problem, I'd be happy to provide it. Thanks, Jamie org.drools.runtime.rule.ConsequenceException: rule: Rule 022 - Load Buyer Activity at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39) at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101) at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029) at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672) at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218) at com.llbean.fraud.rule.engine.DroolsRulesEngine.invokeRules(DroolsRulesEngine.java:119) at com.llbean.fraud.rule.engine.DroolsRulesEngine.invokeRules(DroolsRulesEngine.java:81) at com.llbean.fraud.fitnesse.fixtures.tests.TestFraudRules.execute(TestFraudRules.java:116) at fit.ColumnFixture.executeIfNeeded(ColumnFixture.java:57) at fit.ColumnFixture.check(ColumnFixture.java:46) at fit.Binding$QueryBinding.doCell(Binding.java:188) at fit.ColumnFixture.doCell(ColumnFixture.java:37) at fit.Fixture.doCells(Fixture.java:171) at fit.Fixture.doRow(Fixture.java:165) at fit.ColumnFixture.doRow(ColumnFixture.java:25) at fit.Fixture.doRows(Fixture.java:159) at fit.ColumnFixture.doRows(ColumnFixture.java:18) at fit.Fixture.doTable(Fixture.java:153) at fit.Fixture.interpretFollowingTables(Fixture.java:119) at fit.Fixture.interpretTables(Fixture.java:105) at fit.Fixture.doTables(Fixture.java:79) at com.llbean.test.fitnesse.servletrunner.server.LLBFitServer.process(LLBFitServer.java:120) at com.llbean.test.fitnesse.servletrunner.server.LLBFitServer.runTests(LLBFitServer.java:40) at com.llbean.test.fitnesse.servletrunner.servlet.FitServlet.service(FitServlet.java:32) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1530) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:829) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:862) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:178) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFutu
Re: [rules-users] Memory leak in 5.2/5.3
I recently ran into this issue and I've confirmed through testing that Drools 5.3.0.CR1 in conjunction with JBPM 5.1.1 Final fixes the problem. We're currently rolling our JVMs nightly to prevent out of memory errors, so I need to deploy this upgrade to production ASAP. Can anyone tell me what the target is for the final Drools 5.3.0 release? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Memory-leak-in-5-2-5-3-tp3280351p3383181.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] BPMN editor not working
For me, the key was at the very end of my last post - the flow needs to have an ID. If it doesn't, the editor chokes when you re-open the file. -- View this message in context: http://drools.46999.n3.nabble.com/BPMN-editor-not-working-tp3182776p3361784.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Flow isn't behaving as I'd expect
I've found the answer to my problem - it's behaving as designed, but the design is less than intuitive. Apparently others agree. Here's a thread involving Michal Bali and Mark Proctor which discusses the issue: executing-ruleflow-with-AgendaFilter-td60084.html executing-ruleflow-with-AgendaFilter-td60084.html And here's a feature request that's been filed and deferred for several releases now: https://issues.jboss.org/browse/JBRULES-2179 https://issues.jboss.org/browse/JBRULES-2179 Hopefully it will get addressed soon. In the meantime, I'm going to have to cook up some other way of 'turning off' a rule. -- View this message in context: http://drools.46999.n3.nabble.com/Flow-isn-t-behaving-as-I-d-expect-tp3200994p3209887.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule not compiling in IDE after migration to 5.2
Bump... Anyone have any thoughts on this? What's the mechanism for reporting a suspected bug? -- View this message in context: http://drools.46999.n3.nabble.com/Rule-not-compiling-in-IDE-after-migration-to-5-2-tp3183689p3207521.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Flow isn't behaving as I'd expect
Fair enough - I'll try to work out a simplified test case that demonstrates the behavior. In the meantime, can someone answer a very basic rules/flow question for me? In my simple, linear test flow, if I cancel any activation, why don't any of the remaining nodes in the flow get triggered? -- View this message in context: http://drools.46999.n3.nabble.com/Flow-isn-t-behaving-as-I-d-expect-tp3200994p3207507.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Flow isn't behaving as I'd expect
Bump... I really need some help with this issue - can anyone answer even some of my questions? If my problem or my questions aren't clear, let me know and I'll try to clarify. Thanks! -- View this message in context: http://drools.46999.n3.nabble.com/Flow-isn-t-behaving-as-I-d-expect-tp3200994p3206933.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Flow isn't behaving as I'd expect
I'm having some issues with the interaction between Flow, ruleflow-groups and AgendaFilters. I've tried it with 5.1.1, 5.2.0 using .rf files and 5.2.0 using .bpmn files, all with the same results, so I'm sure I'm just misunderstanding something. I have a flow that looks like this: http://drools.46999.n3.nabble.com/file/n3200994/fraud_analysis_flow.jpg Rules 011 and 051 are in ruleflow-group customerAnalysis and rule 018 is in ruleflow-group customerActivityFilterAndLookup. I added some debugging via event listeners and if I don't use an agenda filter, I see the following output: Executing test Rule018TestCase001 Rules engine initialized Invoking rules for rule name Rule 018 - Good AVS Buyer Created activation for [Rule 018 - Good AVS Buyer] Created activation for [Rule 011 - Bad Zip 9 Address] Created activation for [Rule 051 - Suspicious Buyer Email] Triggered node [Order Analysis] Triggered node [Start Fraud Analysis Flow] Triggered node [Customer Analysis] About to fire [Rule 051 - Suspicious Buyer Email] > Rule 051 fired for order: 00022 About to fire [Rule 011 - Bad Zip 9 Address] > Rule 011 fired for order: 00022 Triggered node [Customer Activity Filter And Lookup] About to fire [Rule 018 - Good AVS Buyer] Created activation for [Rule 051 - Suspicious Buyer Email] Created activation for [Rule 011 - Bad Zip 9 Address] > Rule 018 fired for order: 210105 Triggered node [Customer Activity Analysis] Triggered node [Suspect Reason Code Review] Triggered node [End Fraud Analysis Flow] Rules executed successfully The results are roughly what I'd expect, but I have some questions: - Why do the activations get created for these 3 rules before any flows have started? - Why does the [Order Analysis] node get triggered before the [Start Fraud Analysis Flow] node? - Why are activations created again for 011 and 051 just prior to 018 firing? If I introduce an AgendaFilter that only allows a rule with a specific name to fire, things get stranger to me. If I only allow rule 018, I get the following output: Executing test Rule018TestCase001 Invoking rules for rule name Rule 018 - Good AVS Buyer Created activation for [Rule 018 - Good AVS Buyer] Created activation for [Rule 011 - Bad Zip 9 Address] Created activation for [Rule 051 - Suspicious Buyer Email] Triggered node [Order Analysis] Triggered node [Start Fraud Analysis Flow] Triggered node [Customer Analysis] Rejecting firing of [Rule 051 - Suspicious Buyer Email] because name doesn't match. Cancelled activation for [Rule 051 - Suspicious Buyer Email] because FILTER Rejecting firing of [Rule 011 - Bad Zip 9 Address] because name doesn't match. Cancelled activation for [Rule 011 - Bad Zip 9 Address] because FILTER Rules executed successfully Ruleflow customerActivityFilterAndLookup doesn't even get triggered, nor do any nodes after that. Why not? -- View this message in context: http://drools.46999.n3.nabble.com/Flow-isn-t-behaving-as-I-d-expect-tp3200994p3200994.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule not compiling in IDE after migration to 5.2
Thanks for pointing that out, Wolfgang. I had stripped out some parentheses during some testing. We had them there in the 5.1.1 version. They don't seem to make a difference in 5.2.0 for the cases I've been working with. In an attempt to create something stand-alone that I could share in response to Manstis's reply, I found something very interesting. It appears that the trouble stems from a static initialization in one of the called classes that retrieves a string value from a property file and parses it into an int. I was able to recreate the issue with a very simple example. It doesn't even matter if you refer to the variable in your code. Here's are the classes: package com.test; import java.util.ResourceBundle; public class RuleTest { private static ResourceBundle resourceBundle = ResourceBundle.getBundle("some file"); public static String getSomeValue() { return "some value"; } } package com.test; public class TestFact { public int getSomeValue() { return 17; } } and here's the rule: package com.test rule "Test Rule" when $testFact: TestFact(someValue > (RuleTest.getSomeValue())); then //Do something useful end If you remove the 'static' modifier from the resourceBundle variable declaration above, the rule compiles fine in the IDE. Note that it executes fine with or without the static modifier when deployed. -- View this message in context: http://drools.46999.n3.nabble.com/Rule-not-compiling-in-IDE-after-migration-to-5-2-tp3183689p3186253.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule not compiling in IDE after migration to 5.2
I do mean Eclipse. What do you mean by 'vanilla DRL'? It does seem to compile and run correctly when I deploy it. -- View this message in context: http://drools.46999.n3.nabble.com/Rule-not-compiling-in-IDE-after-migration-to-5-2-tp3183689p3183863.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Rule not compiling in IDE after migration to 5.2
This rule used to compile in the IDE under Drools 5.1.1: when $order: OrderFact(numberOfCreditCardDeclines > FraudCCDeclines.find().getCreditCardDeclinesThreshold()) then //do something but it's breaking since I moved to 5.2, although it runs fine when I deploy it to the server. Any idea why? If I make the > comparison static, like this: when $order: OrderFact(numberOfCreditCardDeclines > 5) then //do something It also works fine. What's wrong? -- View this message in context: http://drools.46999.n3.nabble.com/Rule-not-compiling-in-IDE-after-migration-to-5-2-tp3183689p3183689.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] BPMN editor not working
I found the log and the problem. Here's a snippet of the log: !ENTRY org.drools.eclipse 4 120 2011-07-19 11:04:57.102 !MESSAGE Internal error in Drools Plugin: !STACK 0 java.lang.NullPointerException at org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.end(BPMNPlaneHandler.java:75) at org.drools.xml.ExtensibleXmlParser.endElement(ExtensibleXmlParser.java:414) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:795) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930) The issue is that the flow didn't have an ID. This feels like a bug to me. -- View this message in context: http://drools.46999.n3.nabble.com/BPMN-editor-not-working-tp3182776p3182871.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] BPMN editor not working
I'm trying to move from Drools 5.1.1 to 5.2 and I'm reworking my .rf files into .bpmn files, but I've run into an issue - I use the wizard to create a new file like MainFlow.bpmn. After I create it, I open it using the BPMN2 process editor and all is well. However, if I add anything to the diagram and close it, I get an error when I try to reopen it. "An exception occurred while reading in the RuleFlow XML:null See the error log for more details". Any ideas what might be wrong? Where would I find the error log? -- View this message in context: http://drools.46999.n3.nabble.com/BPMN-editor-not-working-tp3182776p3182776.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules
Thanks, Esteban. I'm going to need to do some testing. I'll post back my findings... -- Jamie From: Esteban [via Drools] [mailto:ml-node+2961373-771292982-397...@n3.nabble.com] Sent: Thursday, May 19, 2011 9:41 AM To: Jamie Shaw Subject: Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules I'm not sure how the rete is modified and if the modifications are synchronized with any ongoing operation. If you want to make sure that the rete is modified when your application is in a "safe-point", then you will need to turn off ResourceChangeMonitor service and call its scan() method manually. We are already doing that in some of Kagent's tests. You can take a look to these 2 classes: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/BaseKnowledgeAgentTest.java <https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/BaseKnowledgeAgentTest.java>https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java <https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java>Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/5/17 Jamie <[hidden email]> That's good news - thanks again! -- Jamie From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email][hidden email]<http://user/SendEmail.jtp?type=node&node=2953003&i=0>] Sent: Tuesday, May 17, 2011 11:41 AM To: Jamie Shaw Subject: Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules IIRC, for stateless sessions only the next session you create from the updated RuleBase is affected. -W On 17 May 2011 15:52, Jamie <[hidden email]<http://user/SendEmail.jtp?type=node&node=2952942&i=0>> wrote: Thanks for pointing me to that thread, Wolfgang - very interesting discussion. It confirms my fear, at least for stateful sessions. Do you know if it's true for stateless sessions as well? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2952592.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email]<http://user/SendEmail.jtp?type=node&node=2952942&i=1> https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email]<http://user/SendEmail.jtp?type=node&node=2952942&i=2> https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2952942.html To unsubscribe from [rules-users] Effect of KnowledgeAgent reload on currently running rules, click here. View this message in context: RE: [rules-users] Effect of KnowledgeAgent reload on currently running rules<http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2953003.html> Sent from the Drools: User forum mailing list archive<http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html> at Nabble.com. ___ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2961373.html To unsubscribe from [rules-users] Effect of KnowledgeAgent reload on currently running rules, click here<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2947988&code=anNoYXdAbGxiZWFuLmNvbXwyOTQ3OTg4fC0xNjUwOTk0NDgy>. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2961387.html Sent from the Drools: User forum mailing list archive at Nabble.com.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules
That's good news - thanks again! -- Jamie From: Wolfgang Laun-2 [via Drools] [mailto:ml-node+2952942-1245008499-397...@n3.nabble.com] Sent: Tuesday, May 17, 2011 11:41 AM To: Jamie Shaw Subject: Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules IIRC, for stateless sessions only the next session you create from the updated RuleBase is affected. -W On 17 May 2011 15:52, Jamie <[hidden email]> wrote: Thanks for pointing me to that thread, Wolfgang - very interesting discussion. It confirms my fear, at least for stateful sessions. Do you know if it's true for stateless sessions as well? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2952592.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2952942.html To unsubscribe from [rules-users] Effect of KnowledgeAgent reload on currently running rules, click here<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2947988&code=anNoYXdAbGxiZWFuLmNvbXwyOTQ3OTg4fC0xNjUwOTk0NDgy>. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2953003.html Sent from the Drools: User forum mailing list archive at Nabble.com.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules
Thanks for pointing me to that thread, Wolfgang - very interesting discussion. It confirms my fear, at least for stateful sessions. Do you know if it's true for stateless sessions as well? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2952592.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Effect of KnowledgeAgent reload on currently running rules
Thanks Greg - that's what I was hoping. Just to confirm - I should be able to cache a KnowledgeBase created by a KnowledgeAgent with the 'drools.agent.newInstance' property set to 'false' without seeing any unexpected results if the KnowledgeBase gets refreshed by the agent. Given that, why would I ever set the 'drools.agent.newInstance' property to 'true'? It doesn't seem like it would buy me anything except extra object creation... -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Effect-of-KnowledgeAgent-reload-on-currently-running-rules-tp2947988p2952392.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Effect of KnowledgeAgent reload on currently running rules
If I use the KnowledgeAgent with the 'drools.agent.newInstance' property set to 'false' to automatically reload my KnowledgeBase when resources in the changeset are updated, what happens to any existing sessions when the agent detects changes and reloads the KnowledgeBase? Do they continue to use the old rules or are they somehow reloaded in midstream? What adverse effects might I see? I ask because I'm trying to rework some existing classes that were written to facilitate the loading and caching of KnowledgeBases created in different ways - e.g. loading decision tables, loading .drl and .rf files in the traditional manner, loading .drl and .rf files using an agent. I'd like to be able to grab a KnowledgeBase from the cache regardless of how it was created, create a session from it, and fire all of the rules, but I'm concerned about cached KnowledgeBases created by KnowledgeAgents. If I set the newInstance property to 'true', my cached KnowledgeBase will never see the updates. If I set it to 'false', my cached KnowledgeBase should see the changes, but I'm concerned about the behavior in any currently running sessions. FYI - the classes were originally written using the Drools 4.07 RulesAgent for caching RuleBases that needed to be automatically reloaded. It seems to be working as expected. I'm trying to update those classes to use Drools 5.1 classes instead. Thanks, Jamie ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users