I have a form that lists entities and each of the entities has a checkbox. The form also contains a list of actions(Action plugin) that can be performed on selected entities as a select list.
I would like to be able to configure actions that extend the \Drupal\Core\Action\ConfigurableActionBase class, which means they are configurable, right in my form since some actions can have very different settings and creating action entity for each variation of those setting is just impossible. I would create a new action entity from those settings, without saving it, and use it to perform the action(although I could do it just with the plugin, but that's not important right now).
I am able to retrieve the form elements for those configurable actions and display them in my form. The issue I have is that incorporating those elements into form is tricky on its own, but validating and submitting them is on another level since I cannot just encapsulate those form elements under some specific form array/key because the validation and submit handler for those plugins will not work with that.
The \Drupal\Core\Plugin\PluginFormInterface::buildConfigurationForm() is not a proper D8 form but it just holds the form elements so it's not like I am trying to embed a form within another form, but it is stillquite impossible as I am seeing it right now.
So how can I do this? Or can you recommend a different approach?
This is the initial design: http://pastebin.com/b8SCFvUQ