KRACOEUS-7847 and KRACOEUS-7282

Please review this PR, some more work pending, don't merge it just yet.
I'd rather see you use: getWorkflowDocument().isProcessed() || getWorkflowDocument().isFinal() rather than equals comparisons.