Is there a way to define a task that is completed after a migration has occurred?

Comments

Andrey Zakharov’s picture

what is "task".
anyway take a look into

public Migration->endProcess()
protected Migration->postImport()

methods to override.

mikeryan’s picture

Status: Active » Fixed

Also, you can derive a "migration" step derived from MigrationBase - see wine.inc in migrate_example for examples.

bleedev’s picture

I read http://drupal.org/node/1327812 earlier, and it pointed to the preImport() and postImport() functions. I am not sure of the etiquette, but could I rewrite that page part of "Advanced Topics" for pre and post/import and rollback functions, using the Rules code as an example?

bleedev’s picture

Status: Fixed » Needs review

I meant as a part of "Advanced Topics", instead of the "Cookbook" section of the documentation.

mikeryan’s picture

Title: Post Migration Tasks » Document preImport/postImport etc.
Category: support » task
Status: Needs review » Active

"needs review" is used when you've posted a patch that needs review.

What we need here in the documentation is a page under http://drupal.org/node/1006984 for the less commonly implemented Migration methods.

bleedev’s picture

Started... http://drupal.org/node/1343112. Hope that is a good start.

mikeryan’s picture

Status: Active » Fixed

Tweaked it a bit, thanks!

Status: Fixed » Closed (fixed)

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

mgifford’s picture

Status: Closed (fixed) » Needs work

Well, there's this one page that lists them, but it's hardly a good example of a well documented function:
http://drupal.org/node/1343112

I'll add the link to the disabled rules section, but let's try to add some more to this section so it's easier to understand.

mikeryan’s picture

Status: Needs work » Postponed (maintainer needs more info)

@mgifford: The functions are very simple - what more would you like to see written about them?

mgifford’s picture

I'd like to see the variables filled in so that it's clear what goes into the functions and what comes out.

mikeryan’s picture

I don't understand what you mean by "see the variables filled in" - what variables? If you mean arguments, these functions take no arguments and return no values, they operate on the current object.

mgifford’s picture

I just want an example that I see that demonstrates this.. The docs on the site don't say much at all about how to use the functions.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed

Rewritten.

Status: Fixed » Closed (fixed)

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