Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm currently working on a project where each rule of a rule set have to be processed trough a batch.
It took some time understanding the rules framework, but I think it's quite good.
Because I'm currently suffering of this Issue I couldn't test it very well.
README.txt:
-- SUMMARY --
Batched Rules
Provides a batched rule set component to rules. Using a batched rule set you
can execute very performance heavy rule sets without fearing of running out
of execution time.
-- REQUIREMENTS --
Rules (http://drupal.org/project/rules)
-- HOW TO USE? --
Install as usual, see http://drupal.org/node/895232 for further information.
Configuration
No initial configuration neccessary.
Batched rule sets
After installation a new 'Batched rule set' component was added and can be
used just like the default 'Rule set'.
Alter batch context
Per default the batch status message will be the last processed rule's title
and any rule will only be executed once.
This behaviour can be modified by the 'Alter batch context' action. Using it
in a rule set that is configured to use the batch API, the progress message
can be altered and a rule can be marked to get re-executed.
Schedule
Unfortunately batched rule sets can not be scheduled technically.
I'd like to add this to rules bonus pack and keep maintaining it (as rb co-maintainer).
Comment | File | Size | Author |
---|---|---|---|
#4 | rb_batch-1342126-3.patch | 6.43 KB | patrickd |
#3 | RulesBatchLoop--1342126-4.patch | 9.38 KB | derhasi |
rb_patch_batched_rules_plugin.patch | 6.7 KB | patrickd |
Comments
Comment #1
patrickd CreditAttribution: patrickd commentedUpdate: please do not test it if your are using rules >7.x-beta3
issue http://drupal.org/node/1285856 will break your site down!
Comment #2
Itangalo CreditAttribution: Itangalo commentedAwesome!
I'd like to commit this, but then I would like it all to be in the sub folder rb_batch, and also that the module name is changed to this. (The 'plugins' directory is right used for Ctools plugins, which unlike Rules plugins require their own files.)
With these changes I'm happy to commit!
(The issue in #1 doesn't break the rest of RB functionality, right? Only this plugin?)
Comment #3
derhasi CreditAttribution: derhasi commentedI only want to contribute my 2 cents for that... on a project I did a quick shot on a similar module, but using a RulesBatchLoop instead of a RuleSet. It was very quick an dirty, but works so far. I attached a "patch" for that. Maybe it can help to provide batch processing in different ways.
The patch does not modify patrickd's patch in any way, as it uses a different approach.
Comment #4
patrickd CreditAttribution: patrickd commentedOkay, here it goes
No, you have to activate rb_batch and then you have to create a rule using rules >7.x-beta3
This would break it.
I hope issues
http://drupal.org/node/1285856
http://drupal.org/node/1341344
will soon be resolved.
Comment #5
patrickd CreditAttribution: patrickd commentedComment #6
Itangalo CreditAttribution: Itangalo commentedThe approach in #3 seems very nice to me.
Anyone interested in working further with this?
Comment #7
Itangalo CreditAttribution: Itangalo commentedComitted! Patch from #4 will appear in dev in less than 12 hours, and can be fetched with Git right away. :-)
Thanks patrickd for the patch!
Comment #8.0
(not verified) CreditAttribution: commented.