OG Tasks provides a mechanism to create tasks to be run for a group, either automatically on creation, or optionally once the group has been created.
Tasks are defined by way of a hook function, hook_og_tasks_info(). This function takes two parameters: $entity_type and $entity. Both of these parameters refer to the OG entity. The type is often "node" or "taxonomy_term", and the entity itself as an object is passed into the second param. They can be used to set up different tasks for different types of OG objects, for example.
The hook_og_tasks_info() function should return an array of og_tasks objects.
A typical hook_og_tasks_info function will look something like this:
/**
* Implements hook_og_tasks_info().
*/
function my_module_og_tasks_info($entity_type, $entity) {
$tasks = array();
$path = drupal_get_path('module', 'my_module');
// Navigation menu.
$tasks['menu'] = new og_task(array(
'title' => t('Create Navigation'),
'description' => t('Creating a menu that is associated to the site that will drive the navigation.'),
'required' => TRUE,
'callback' => 'my_module_og_task_create_menu',
'file' => $path . '/includes/menu.inc',
'completed' => my_module_has_menu($entity),
));
return $tasks;
}