Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
Ate provided a patch for this problem.
From Ate:
Yes, I noticed this limitation before as well.
IMO it should be trivial to fix this though.
The WorkflowEventWorkflow #fire() and #fire(Document) methods are only invoked from within two classes (AFAIK):
- org.hippoecm.repository.impl.WorkflowPostActionSimpleQuery
- org.hippoecm.repository.impl.WorkflowPostActionsBoundMethod
Both these classes already have instance String variables for both the triggering workflowCategory and WorkflowMethod.
So, we can easily introduce a new interface, extending WorkflowEventWorkflow implementation to make it 'multiple events (types) capable', e.g. like
interface WorkflowEventsWorkflow extends WorkflowEventWorkflow
{ void setWorkflowCategory(String category); void setWorkflowMethod(String method); }Then those two classes above can simply check if this interface is implemented instead and if so first set these two variables and you've got your generic mediator event(s) workflow implementation!
If the above is feasible this would be a very trivial to implement without any side-effects or backwards compatibility issues.
And I would then also deprecate the original WorkflowEventWorkflow interface.
Update: for the fun of it I've already created and attached a patch for it, took me only 5 minutes to create against repo trunk, but probably can also be applied to previous released version. I haven't actually tested it yet though.
If you could try this patch out and it works, I can create an issue for it and have it applied ASAP.
Attachments
Issue Links
- relates to
-
REPO-312 Provide access to the JCR user and workflow session as well as the subject (if available) of a Workflow instance through the WorkflowContext (protected)
- Closed