How to call a Rules action settings form via drupal_get_form So, I'm trying to embed the form I find at '/admin/config/workflow/rules/reaction/manage/commerce_payment_paypal_wps/edit/3' - which contains the settings for the PayPal business, etc (from commerce_paypal_wps.module).

Looking in rules/ui/ui.controller.inc I can see it's called thus:

$items[$base_path . '/manage/%rules_config/edit/%rules_element'] = array(
      'title callback' =&gt; 'rules_get_title',
      'title arguments' =&gt; array('Editing !plugin "!label"', $base_count + 3),
      'page callback' =&gt; 'drupal_get_form',
      'page arguments' =&gt; array('rules_ui_edit_element', $base_count + 1, $base_count + 3, $base_path),
      'access arguments' =&gt; array('administer rules'),
      'load arguments' =&gt; array($base_count + 1),
      'file' =&gt; 'ui/ui.forms.inc',
      'file path' =&gt; drupal_get_path('module', 'rules'),
    );


I'm not entirely sure what extra things I should be passing into drupal_get_form('rules_ui_edit_element') to make it render the form as it does normally.

How on earth do I get that rules action settings form to render either through drupal_get_form, or some other mechanism, so I can put it at the URL of my choosing, and make it look a bit more presentable to our clients?
You must be using an old version of commerce to get an url like that. It was changed long ago to dmin/commerce/config/payment-methods/...

In hook_menu, the commerce_payment_ui module creates the path, where the rules forms should be located:

// Add the menu items for the various Rules forms.
$controller = new RulesUIController();
$items += $controller-&gt;config_menu('admin/commerce/config/payment-methods');


You could alter those if you want to change the url. You should however be aware that this url is also used elsewhere:

/**
 * Builds the payment settings page using the Rules UI overview table filtered
 *   to display payment method rules.
 */
function commerce_payment_ui_admin_page() {
  RulesPluginUI::$basePath = 'admin/commerce/config/payment-methods';

  ...
}


Since most of what Rules does, including creating these settings form is classed based, it wont exactly be easy to create the form. I haven't delved much into the Rules code, but I remember seeing public functions called


form
form_validate
form_submit


I believe these are used to create the form, but how it ends up in the FAPI is beyond me. If all you want is to change the path, you could just use hook_menu_alter and for commerce, overwrite the commerce_payment_ui_admin_page function with your own to create the overview table.