0

I use actually registration entity for a project. The registration follows a specific process with ecommerce.

Actually what i need to do is :

  • to give the "canceled" status to registrations that have "complete" status after 30 minutes
  • to give the "complete" status to registration that are on "wait list"

For this I created 2 components and a rule :

  • the first allows to set a new data value to a registration (Selected data: registration:state - Value : Canceled)
  • the second allows to schedule component evaluation on the previous component with the expected delay of 30 minutes
  • finally the rule is launched after saving a new registration, with a condition based on "NOT entity exists by property" which has "wait list" value and the action is the action set which is scheduling component evaluation after 30 minutes.

Here is my "base rule" :

{ "rules_schedule_registration_management_after_30_minutes" : {
    "LABEL" : "Schedule registration management after 30 minutes",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "Registration" ],
    "REQUIRES" : [ "commerce", "rules", "registration" ],
    "ON" : { "registration_insert" : [] },
    "IF" : [
      { "NOT entity_exists" : { "type" : "registration", "property" : "state", "value" : "waitlist" } }
    ],
    "DO" : [
      { "component_rules_setcron_30_minutes" : { "registration" : [ "registration" ] } }
    ]
  }
}

This part works fine but i have to define a second rule concerning the registrations which were on "wait list" and are with the "Complete" status. I have to :

  • send a mail when their status is changing from "wait list" to "complete"
  • set them as "canceled" after 24 hours

Here i am completelly stuck. Thanks for your help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.