Is it possible to schedule Migrate to import/update my XML regularly, say, once an hour? Maybe in Rules?
EDIT: I have a skeleton of a module written for this now, to hook into Rules.
Event: If there are unimported nodes, or if it has been more than 15 minutes since the last import
Condition: Just the machine name of the Migration, and its enddate timestamp
Actions: I want two, one to do an import and rollback, and another to update and import.
I am having trouble trying to find what functions to call to initiate the actions, and which ones to get my arguments. Is there any good documentation on the core Migrate functions (not field handlers or anything) so that I can see which ones I need?
EDIT 2 I ended up with this cron function. Is this how it's written? And I can put it into my module where the rest of my migration is? I also need to specify that it should update any nodes already imported. How do I do that?
function mymodule_cron() {
$last_run = variable_get('mymodule_last_cron', 0);
$interval = variable_get('mymodule_interval', 60);
if(time() - $last_run > $interval){
variable_set('mymodule_last_cron', time());
$migration = Migration::getInstance('ImportNodes');
$result = $migration->processImport();
}
}