Answers.Body: <p>The way I'm doing it is to use Path Rules module to check the CiviCRM URL for the transact page. 
  So we look for the path say /civicrm/contribute/transact?reset=1&amp;id=1</p>
  
  <p>That triggers the rule. We then fetch the CiviCRM contact entity for the current user.</p>
  
  <p>The Contact entity has all of the custom data in it.</p>
  
  <p>We pass that to a rule component that evaluates a custom field value and does an action as appropriate.</p>
  
  <p>So this rule could be used in a situation where a user has to complete a complex professional registration procedure using Webform CiviCRM, where a profile is not appropriate. Upon completion they are directed to a membership renewal page. </p>
  
  <p>If they try to access the renewal page first, without having made the declaration they are redirected back to the webform.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-11T22:15:41.973Z
Answers.Text: Interesting, thanks for posting your solution. Adding Path Rules to the toolbox!
Answers.UserDisplayName: jackrabbithanna
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-24T12:55:27.257Z
Answers.LastActivityDate: 2017-11-27T17:13:10.810Z
Answers.LastEditDate: 2017-11-27T17:13:10.810Z
Answers.UserDisplayName: Tony Horrocks
Answers.Body: <p>The rule will only trigger when the Drupal version of the contribution page at path /civicrm-contribution-page/(id)</p>
  
  <p>We haven't added a feature to trigger the rule event when the civi version of the contribution page is viewed. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-24T08:55:44.580Z
Answers.Text: Woo. In all my years I did not know that you could have Drupal versions of contribution pages. Thanks for the tip.
Answers.UserDisplayName: Tony Horrocks
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-24T12:03:40.857Z
Answers.Text: Ah I see where this is coming from, CiviCRM Entity. What I actually want to trigger a rule when the user visits the transaction page for the contribution, rather than the contribution page itself. So, for example, if someone visits a contribution transcation page for member renewal, I can check whether they have filled in data elsewhere.
Answers.UserDisplayName: Tony Horrocks
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-23T19:37:36.073Z
Answers.LastActivityDate: 2017-11-23T21:36:10.760Z
Answers.LastEditDate: 2017-11-23T21:36:10.760Z
Answers.UserDisplayName: jackrabbithanna
Body: <p>I have CiviCRM Entity installed, Drupal Rules, up to date versions of both.</p>
  
  <p>I'm just creating a simple rule that says when a CiviRM Contribution Page is viewed, a "Hello World" message is displayed.</p>
  
  <p>Getting nowhere with it. It does not even trigger Rules at all, so no debug, no log entries.</p>
  
  <p>Works fine with Drupal content.</p>
  
  <p>Am I missing something?</p>
  
Tags: <civicrm-entity><drupal-rules>
Title: Can CiviCRM entities be used as events to trigger Drupal Rules?
ThreadText: # Can CiviCRM entities be used as events to trigger Drupal Rules?
  
  (Asked by: username_0 on 2017-11-23)
  
  I have CiviCRM Entity installed, Drupal Rules, up to date versions of both.
  
  I'm just creating a simple rule that says when a CiviRM Contribution Page is viewed, a "Hello World" message is displayed.
  
  Getting nowhere with it. It does not even trigger Rules at all, so no debug, no log entries.
  
  Works fine with Drupal content.
  
  Am I missing something?
  
  **Tags:** civicrm-entity, drupal-rules
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-11-23. Score: 3 | Accepted answer
  
  The rule will only trigger when the Drupal version of the contribution page at path /civicrm-contribution-page/(id)
  
  We haven't added a feature to trigger the rule event when the civi version of the contribution page is viewed.
  
  > **Comments:**
  > **username_0**: Woo. In all my years I did not know that you could have Drupal versions of contribution pages. Thanks for the tip.  
  > **username_0**: Ah I see where this is coming from, CiviCRM Entity. What I actually want to trigger a rule when the user visits the transaction page for the contribution, rather than the contribution page itself. So, for example, if someone visits a contribution transcation page for member renewal, I can check whether they have filled in data elsewhere.  
  
  ---
  
  ### Answer by username_0 on 2017-11-24. Score: 2
  
  The way I'm doing it is to use Path Rules module to check the CiviCRM URL for the transact page.
  So we look for the path say /civicrm/contribute/transact?reset=1&id=1
  
  That triggers the rule. We then fetch the CiviCRM contact entity for the current user.
  
  The Contact entity has all of the custom data in it.
  
  We pass that to a rule component that evaluates a custom field value and does an action as appropriate.
  
  So this rule could be used in a situation where a user has to complete a complex professional registration procedure using Webform CiviCRM, where a profile is not appropriate. Upon completion they are directed to a membership renewal page.
  
  If they try to access the renewal page first, without having made the declaration they are redirected back to the webform.
  
  > **Comments:**
  > **username_1**: Interesting, thanks for posting your solution. Adding Path Rules to the toolbox!  
  
  ---
  
  