Well done zhangtaihao!!

This is a fantastic improvement to the usability of rules in terms of defining the logic and flows.. On my site it will effectively reduce my total number of rules to about 25% of the original number because I was having to repeat so many to effectively create your "switch" functionality..

Thank you!

Comments

zhangtaihao’s picture

Thanks for your compliments.

On that note, I'm still trying to finalize #1666802: Keep embedded elements under compatible containers in container UI. If you or someone you work with can test Rules patches, I would love some help to RTBC the issue so that we can move towards releasing 7.x-1.0-rc1.

wipeout_dude’s picture

Interesting.. I have had the error but naturally resolved it by making sure everything was in the right place.. :)

Unfortunately I am not a programmer at all but I am happy to help test the patch.. Would that help??

If so I will refresh my dev setup as soon as I have finished consolidating my rules and do some testing..

zhangtaihao’s picture

Any help would be great. Thanks!

dadderley’s picture

I will second what wipeout_dude said. This is awesome.

I have been trying to Set a data value in a custom field. I could not do it because I could not get the action to recognize the field. Now I can.

I have a Rule set up so that when a user has finished a Quiz it fires a Rule. This loads a node and populates one of the results fields.

Event
After updating existing content

Conditions Elements
Content is of type
Parameter: Content: [node], Content types: Quiz

Data comparison
Parameter: Data to compare: [node:nid], Data value: 8

Actions Elements
Show a message on the site (just to see if this puppy is working)
Parameter: Message: Dude you fished quiz 1!

Fetch entity by property
Parameter: Entity type: Node, Property: User Reference, Value: [site:current-user], Limit result count: 1
Provides variables: Fetched result node (entity_fetched_result)

Conditional
-------- If: Entity has field
--------Parameter: Entity: [entity-fetched-result:0], Field: field_result_1

----------------Set a data value
----------------Parameter: Data: [entity-fetched-result:0..., Value: 21

dadderley’s picture

StatusFileSize
new95.08 KB

Here is an attached screenshot of the set up. Hopefully this may help others.

mitchell’s picture

@dougzilla: You're putting a support request here?

dadderley’s picture

@mitchell
Actually I was joining wipeout_dude in complimenting the creators/maintainers of this module. Conditional Rules extends the functionality of the Rules module.
In the use case that I detailed, it seemed like the only way to accomplish what I wanted.

zhangtaihao’s picture

Thank you!

mitchell’s picture

Sorry, @dougzilla. Obviously I got a little confused.

I would also like to join in the thanks and praise. :) Thank you, @zhangtaihao!!!
If there becomes a way to nominate this for best project of 2012, I'll be in line for the process.

@dougzilla: I started adding your example to the IF/ THEN / ELSE (conditional) docs. The goal for that page, as of yet, is to explain the configuration process and to also explain the concepts. Whatever changes you make will also be valued, and thank you for posting your use case.

dadderley’s picture

@mitchell
In the example above, it does not actually fetch the quiz results.
It check to see if the quiz in question (NID 8) has been updated. If so, the action gets triggered.

Currently the quiz module is not really super well integrated with the Rules module. You have to assign an action to the individual quiz so that on completion of the quiz the action is Save content.
It would be nice if you could actually get the quiz result and then creating an action base on this.

User freddura suggests a way of doing this in this post http://drupal.org/node/1149930#comment-5742160.
This involves using VBO and Rules.
I have not yet tried this, but I am going to.

Using this sort of Rules And Quiz integration you could build a very useful learning management system emulating Moodle functionality.

umuthan’s picture

@dougzilla i didn't see User Reference at Property section. Which module should i use it to choose User Reference?

dadderley’s picture

@umuthan
I have been using Entity Reference http://drupal.org/project/entityreference
It is robust and intuitive to set up.

It has a couple of nice little helper modules as well.
Corresponding Entity References http://drupal.org/project/cer
Entity Reference View Widget http://drupal.org/project/entityreference_view_widget

The quiz module still feels really beta and not really stable.
If you are developing quizzes do lots of back ups.
I lost a whole bunch of questions due to some wackiness with the text input setting being lost in multi-choice questions (well after they were created).

Conditional Rules on the other hand is just pure awesome.

alansaviolobo’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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