Class WorkflowEventRunner
- java.lang.Object
-
- de.xima.fc.workflow.processor.engine.WorkflowEventRunner
-
- All Implemented Interfaces:
IWorkflowEventRunner
public final class WorkflowEventRunner extends Object implements IWorkflowEventRunner
Default implementation of theIWorkflowEventRunner
. Create a new instance via the constructor, which currently does not required any parameters. You can then trigger an event and have the corresponding tasks be executed.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IWorkflowEventRunner
newInstance()
com.google.common.collect.Table<Projekt,Vorgang,IEventExecutionResult>
triggerEvent(IWorkflowEventData eventData)
Finds allWorkflowTrigger
to which the given event applies and executes them in order.IEventExecutionResult
triggerFormRecordEvent(IFormRecordProvidingEvent eventData)
Similar toIWorkflowEventRunner.triggerEvent(IWorkflowEventData)
, but for an event that pertains to a specificVorgang
.
-
-
-
Method Detail
-
triggerEvent
public com.google.common.collect.Table<Projekt,Vorgang,IEventExecutionResult> triggerEvent(IWorkflowEventData eventData) throws WorkflowEventRunnerException
Description copied from interface:IWorkflowEventRunner
Finds allWorkflowTrigger
to which the given event applies and executes them in order. Note that an event may apply to multiple form records or event form records of different projects. All applicable form records are grouped by the project they belong to, and executed in that order. Returns the workflow result for each form record, grouped first by theProjekt
, then by theVorgang
.- Specified by:
triggerEvent
in interfaceIWorkflowEventRunner
- Parameters:
eventData
- Data of the event to run.- Returns:
- The result of the workflow execution for each form record, grouped first by the project of the form record and then by the form record itself.
- Throws:
WorkflowEventRunnerException
- When an unhandled exception while attempting to execute the workflow. Note that this does not include errors in the configured workflow tasks themselves (such as when an email could not be sent)-- useIEventExecutionResult.getException()
to check for the result of each workflow task.
-
triggerFormRecordEvent
public IEventExecutionResult triggerFormRecordEvent(IFormRecordProvidingEvent eventData)
Description copied from interface:IWorkflowEventRunner
Similar toIWorkflowEventRunner.triggerEvent(IWorkflowEventData)
, but for an event that pertains to a specificVorgang
. This guarantees that only the tasks of that specific form record are executed. Returns the result for that form record.- Specified by:
triggerFormRecordEvent
in interfaceIWorkflowEventRunner
- Parameters:
eventData
- Event data for a form record specific event.- Returns:
- The result of running the tasks of the triggers that were triggered by the given event.
-
newInstance
public static IWorkflowEventRunner newInstance()
- Returns:
- A new instance of a workflow event runner for running the tasks triggered by an event.
-
-