Rules-scheduler

December 13, 2013

Follow the steps:

  1. Go to your /admin/config/workflow/rules/components and click on "Add new Component"
  2. Select "Action set" under Component plugin & Press Continue.
  3. Give appropriate Name.E.g: Flag Node.

    Data type : Content, Label: Node, Machine name:node & Press Continue.

  4. Click on "Add action" & select "Flag a node" ,once it returns the result data,Select which flag should be clicked.

    For => node :Data selector use node &

    For =>User on whose behalf to flag : Data selector use node:author

    & Press Save.

    Done with the component.

    Now Add a New Rule

  5. Go to your /admin/config/workflow/rules and click on "Add new Rule"

  6. Give appropriate Name.E.g: Flag Node Rule.

    React on event : After updating existing content. (as you need)

    & Press Save

  7. You can add conditions if you want whether it should be published or should belong to any content type or what so ever you need. I have used Content is of type.

  8. This is the thing which works like a magic to schedule your event(Here Flag). Click on "Add action" & Select "Schedule component evaluation" under Rule Scheduler

    & Select the Component Value ** as (**Flag Node) which we created just before configuring this rule & Press Continue.

  9. Enter Scheduled evaluation date which will schedule your event when to get triggered.

    Data selector :(Enter Your values as +2 minutes, +2days, +2 weeks etc as your need)

  10. Identifier => Value : [node:title] has been Flagged.(You can use any message you want to see on /admin/config/workflow/rules/schedule along with list of scheduled events.)

  11. Node => Data selector : node

    & Press Save.

    Done with the Rule.

Configuration is done. You can test it now.

But please have a look into this. I was not checking such thing so was not able to see the result. Your event will respond you only after the cron run because it is executed by the cron. The cron triggers a query to check whether something should be published or flagged.If your cron runs every hour and you want something published on 22:35 and it is past that time it will be actually published the next time your cron runs. So if your cron runs at 22:30 and 23:30 the publish will be at 23:30.

Hope this will be helpful for someone.