Batch operation doesn't get called I am trying to write a batch. And I have a problem that none of the batch operations callback functions are getting called.

I wrote drupal_set_message at the start of each callback and none of the messages are displayed.

I can get the batch page, but the callback ops aren't called at all.

Here's the code I used:

function mymdoule_node_batch()
{
    $batch = array(
        'title'         =&gt; t("Migrating"),
        'operations'    =&gt; array(
            array('mycallback_001'),
            array('mycallback_002'),
        ),
        'finished'      =&gt; 'mycallback_finished',
        'init_message'  =&gt; t('Initializing...'),
        'error_message' =&gt; t('An error occurred.'),
    );

    batch_set($batch);
    drupal_set_message("step: 0"); // this is the only message the system returns
}


function mycallback_001(&amp;$context)
{
    drupal_set_message("step: 1");
    $nids = db_select("node", "n")
            -&gt;fields("n", array("nid"))
            -&gt;orderBy("nid", "ASC")
            -&gt;execute()
            -&gt;fetchCol();
}

function mycallback_002(&amp;$context)
{
    drupal_set_message("step: 2");
    $nids = db_select("node", "n")
            -&gt;fields("n", array("nid"))
            -&gt;orderBy("nid", "ASC")
            -&gt;execute()
            -&gt;fetchCol();
}


P.s. The batch is getting called in form submission.

What's wrong in that?
It worked after I added file to the $batch array.

function mymdoule_node_batch()
{
    $batch = array(
        'title'         =&gt; t("Migrating"),
        'operations'    =&gt; array(
            array('mycallback_001'),
            array('mycallback_002'),
        ),
        'finished'      =&gt; 'mycallback_finished',
        'init_message'  =&gt; t('Initializing...'),
        'error_message' =&gt; t('An error occurred.'),
        'file'          =&gt; 'mypatch.ops.inc',
    );

    batch_set($batch);
    drupal_set_message("step: 0");
}