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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

patrickd’s picture

Status: Active » Needs review

Update: please do not test it if your are using rules >7.x-beta3
issue http://drupal.org/node/1285856 will break your site down!

Itangalo’s picture

Status: Needs review » Needs work

Awesome!

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?)

derhasi’s picture

I 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.

patrickd’s picture

FileSize
6.43 KB

Okay, 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.

patrickd’s picture

Status: Needs work » Needs review
Itangalo’s picture

The approach in #3 seems very nice to me.
Anyone interested in working further with this?

Itangalo’s picture

Status: Needs review » Fixed

Comitted! 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!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

.