Details
Description
Group all service rendering methods in the TaskService and indicate that rendering is done
RepositoryService.getStartFormByKey --> Object TaskService.getRenderedStartFormByKey(String processDefinitionKey)
RepositoryService.getStartFormById --> Object TaskService.getRenderedStartFormById(String processDefinitionId)
TaskService.getTaskForm(String taskId) --> Object TaskService.getRenderedTaskForm(String taskId)
For external rendering, following methods can be used:
Task: String getFormResourceKey();
ProcessDefinition: String getStartFormResourceKey(); (TODO add javadocs)
ProcessDefinition: String getDeploymentId();
RepositoryService: InputStream getResourceAsStream(String deploymentId, String resourceName);
(Extracting a pluggable FormRenderingSession in the ProcessEngineConfiguration is left for later)
To be honest I have no other answer than that it probably felt quite natural to put them there.
Possibly because it might have been driven by a discussion that started in the REST API where we have urls like:
/process-definition/{processDefinitionId}/form
/task/{taskID}/form
...which kind of indicates that the form methods "live" inside the "Process(Definition)Service" and "TaskService"?
Now, if the start form is aquired from the "RepositoryService" nowadays I guess this doesn't feel as natural anymore, even a bit confusing I guess. So moving the methods into a FormService might make more sense.
Cheers,
Erik