I experimented a little bit with loops and wsclient data types. This particular programmatic rule failed:

$rule = rule(array('text' => array('type' => 'text')));
$rule->action('wsclient_google_translate', array(
       'param_q:select' => 'text',
       'param_langpair' => 'de|en',
       'result:var' => 'translation',
     ))
     ->action('wsclient_twitter_search_search', array('param_q:select' => 'translation:responseData:translatedText', 'result:var' => 'twitter'));
$loop = rules_loop(array('list:select' => 'twitter:results'));
$loop->action('drupal_message', array('message:select' => 'list-item:text'));
$rule->action($loop);
$rule->execute('Programmierung');

Solution: Loop defines "list-item" as default item name, but variable names must not use dashes. Underscore is better and the rule from above works. Patch attached.

CommentFileSizeAuthor
rules-loop-item-name.patch522 bytesklausi

Comments

fago’s picture

Component: Rules Core » Rules Engine
Status: Needs review » Fixed

good catch. Thanks, committed.

Status: Fixed » Closed (fixed)

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