Have a look at this Rules Component (an Action Set), in Rules export format:
{ "rules_fetch_all_nodes_of_a_selected_content_type" : {
"LABEL" : "Fetch all nodes of a selected content type",
"PLUGIN" : "action set",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : { "fetched_content_type" : { "label" : "Fetched content type", "type" : "token" } },
"ACTION SET" : [
{ "entity_query" : {
"USING" : {
"type" : "node",
"property" : "type",
"value" : [ "fetched-content-type" ]
},
"PROVIDE" : { "entity_fetched" : { "node_fetched" : "Fetched node" } }
}
},
{ "LOOP" : {
"USING" : { "list" : [ "node-fetched" ] },
"ITEM" : { "current_node" : "Current node" },
"DO" : [
{ "drupal_message" : { "message" : "Title of current node (with nid = [current-node:nid]) is [current-node:title]" } }
]
}
}
]
}
}
After you import it in your own site, use the "execute" link (to the right of it) to experiment with it in your own site.
As a sample, enter a value like article
for its input parameter (=fetched_content_type
, which is the machine name of the content type to be processed). After you do, it'll show a Drupal message for each of your nodes with a content type that matches the value of your parameter. Here is a sample of such messages:
Title of current node (with nid = 19) is How to do X?
Title of current node (with nid = 53) is Hello World ...
Title of current node (with nid = 57) is Bonjour!