On Jun 25, 2008, at 12:02 PM, Deepak Pol wrote:


Please make me clear on this because in this what I meant was 'total' will be the supplied input to engine and that will vary in my application for each client. Though as a rule I always want each client's total to be compared to 100 to decide the rule execution. Thats why I kept 100 as hard coded value while total as the value dynamically coming from the client.

Though 'peering' concept should solve my problems. I reckon a global variable created with a peer has a scope 'peer', right?. Can you specify the tentative date when 7.1 will be out? Because I am about to begin on a project where I want to replace my application framework with JESS. And the peering is the concept I need the most.


Global variable themselves exist for all peers, while the values are specific to each peer, which is just what you want. But you don't want to use global variables anyway; use working memory elements (facts) instead.

Unless there's a major issue reported in the next few days, Jess 7.1 final should be released next week.


How to express "when all the rules in this module have fired, proceed to module 2"?


You just have to make sure that the top two entries on the focus stack are module 1 and module 2, in that order.


Following is what I am planning to do:
Condition: module_1 should always fire, if any(Note this 'any') rule in module 2 fires module_3 should fire else module_4 should fire.


There's no specific built-in way to do this kind of thing, but I can think of a few ways to accomplish it. For example, you could use the JessListener event notification API to watch for rule firing; if a rule in module 2 fires, then module4 could be removed from the focus stack and module 3 pushed on. It doesn't sound particularly elegant, but it would work.

But you can consider other ways to structure the whole application. For example, you can use a "control fact" to signal what group of rules should fire first, and the rules in module 2 can modify the control fact. The rules you're calling module 3 and module 4 could simply match a particular state of the control fact.



So currenlty I am thinking about an approach of having a global variable ?*module_2_fired* and a condition
if ?*module_2_fired* then focus module_3 else focus module_4

Yes, you can do things like that. Event listeners can help streamline this sort of thing by watching for particular rule firings.



3. I want to have some modules (which would be set of rules) which are exclusive i.e. only one of them should fire even if others also match. ... Since the conditions in my case are provided by user and not created by me, I cannot change them. So even if I asert fact region after once fired, I can't change rule_a2 to look for absence of fact region it has to be fired with the same condion. Is there any way to do this? Will return in last rule work?


Again, I think using event listeners and manually messing with the focus stack is going to be the only way to achieve this, given that you can't implement any of it in rules.


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com






--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to