I have a use case where a rule is evaluated and the result has to be returned to invoker (a kind of return value action)
Does rules design support returning values to invoker ?
Here is a concrete example (actually trying to write some ubercart integration) :
I have a product that can be added to (uber) cart only if a rule is met :
- I created an event 'An item is being added to the cart'. + a few conditions (like cart contains product x)
- I invoke this event inside my implementation of the cart_add_item hook from uc_cart. When implementing this hook you should return TRUE or FALSE to tell uc_cart if it can/must-not add the product to the cart.
What i want to say is that there is no callback in this scenerio and you have to return a value while your on the stack. Check it out here for more info
Comments
Comment #1
redben commentedI have found a workaround for this. Not elegant but should work. Create a global variable before invoking the rule set and add an action to set that global variable's value.
Comment #2
amitaibuAFAIK this is planned for Rules2
Comment #3
redben commentedDo you have any idea on when Rules 2 dev is going to start ?
Comment #4
fagoYep, that's planned. Rule2 dev already started.
Comment #5
mitchell commented@fago: Please update status.
Comment #6
fagorules2 already supports providing new variables with rules sets. :)
Comment #7
redben commented@fago greate !