Hi guys,
Working on #2051953: Affiliation rules - integrating Domain and Rules - I try to reach into a property in an action, but get this error message: "The specified variable is not wrapped correctly"

I pass a "domain" (which is not an entity) as a variable to a Rules event:

/**
*
* Implements hook_rules_event_info()
*/
function domain_rules_rules_event_info() {
  return array(
...
    'domain_node_added_to_domain' => array(
      'label' => t('Node is added to a domain'),
      'group' => t('Domains'),
      'variables' => array(
        'domain' => array('type' => 'domain', 'label' => t('Domain')),
        'node' => array('type' => 'node', 'label' => t('Node')),
      ),
    ),
    'domain_node_removed_from_domain' => array(
      'label' => t('Node is removed from a domain'),
      'group' => t('Domains'),
      'variables' => array(
        'domain' => array('type' => 'domain', 'label' => t('Domain')),
        'node' => array('type' => 'node', 'label' => t('Node')),
      )
    ),
  );
}

Setting the domain in the hook_rules_data_info:

/**
* Implements hook_rules_data_info().
*/
function domain_rules_rules_data_info() {
  return array(
    'domain' => array(
      'label' => t('Domain'),
      'group' => t('Domain'),
      'property info' => _domain_rules_domain_info(),
    ),
  );
}

And the properties are:
/**
* Defines property info for watchdog log entries, used by the log entry data
* type to provide an useful metadata wrapper.
*/
function _domain_rules_domain_info() {
  return array(
    'subdomain' => array(
      'type' => 'text',
      'label' => t('Subdomain'),
    ),
    'machine_name' => array(
      'type' => 'text',
      'label' => t('Machine name'),
    ),
    'schema' => array(
      'type' => 'text',
      'label' => t('Schema'),
    ),
    'sitename' => array(
      'type' => 'text',
      'label' => ('Site name'),
    ),
    'domain_id' => array(
      'type' => 'integer',
      'label' => t('Domain id'),
    ),
    'weight' => array(
      'type' => 'integer',
      'label' => t('Weight'),
    ),
    'path' => array(
      'type' => 'uri',
      'label' => t('Path'),
    ),
    'valid' => array(
      'type' => 'boolean',
      'label' => t('Valid'),
    ),
    'is_default' => array(
      'type' => 'boolean',
      'label' => t('Is default'),
    ),
    'site_grant' => array(
      'type' => 'boolean',
      'label' => t('Site grant'),
    ),
  );
}

I tried to find some more information and examples, and I guess I need some specific implementation of 'ui class' and 'wrapper class', but it seems a bit too complicated.
Any help would be appreciated.
Regards,
Shushu