A service template will allow you for format service results, but does not help formating the inputs to a service. For this you can use a DSP or JSP (using the WmTomcat package).
But if I understand you correctly, you do not want to create a static DSP. You want to dynamically create an HTML UI. For instance, you want to write pub.db.ui:getUI which has inputs of operationType (insert, update, delete) and tableName.
The user would somehow know to call the service, like clicking on the URL (say in a DSP or JSP): http://host:port/invoke/pub.db.ui:getUI?operationType=insert&tableName=;=hrdb.employee
I would think that there would be at least three services update, insert, delete for each table. Also, you would probably need a query service in order to support update.
You can create a corresponding HTML UI that allows for customized access to each of those three operations:
The output of getUI service would have to be a pipeline that gives you all the data that is needed for a template to create the UI. For instance, you can use %ifval operationType equals(“insert”)% to define the section of the template that should be returned for the insert UI. In that section you would create a FORM that on submit does a POST to the insertHrdbEmployee service and ther rest of the template would create HTML for getting the values appropriate for all the fields of that table.
You can build the HTML string in memory inside getUI and call pub.flow:setResponse to force that as the HTML payload to be returned. You can still use a template for format all or some of the HTML since there are services to run a template you define on the pipeline, so you can view the results as a String.