I've worked with the "Activiti-family" of process engines for over 10 years: from jBPMN to Activiti, Flowable and recently Camunda. So far I've always written my own form handling functionality using custom commands.
My intention now is to work with instead of around the workflow engine as much as possible, so I'm trying to use the built-in form functionality this time. The most obviously way to do this seems to be using a ProcessEnginePlugin that configures a custom FormEngine. This worked quite well for providing customized rendering. But then I ran into some roadblocks.
Since form rendering and submission are each other's dual, I expect these concerns to be located in the same class. In reality, whereas FormEngine is responsible for rendering, it's the FormHandler that's responsible for submission. This is quite awkward for several reasons:
- the functionality that is common to rendering and submission is needed by these two classes.
- the FormHandler.submitFormVariables method has no access to the FormData.
- the only way to provide a custom FormHandler is by putting the camunda:formHandlerClass attribute on every task.
Sure, I can find ways around these issues, but it quickly becomes quite messy.
Am I missing something, or is this just the result of organically grown functionality over the years? I would be happy to propose (and implement) some improvements if that's the case.