Interface NonTransactionalJobHandler<Output>
- All Superinterfaces:
JobHandler
Internal interface for non-transactional job handler implementations.
This interface extends from the regular
JobHandler, however the 'normal' execute method should not be called,
because there's no VariableScope or CommandContext
available as no transaction is currently ongoing when the job is executed.- Author:
- Joram Barrez
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterExecute(JobEntity job, String configuration, Output output, CommandContext commandContext) Method invoked with the result fromexecuteNonTransactionally(JobEntity, String).default voidexecute(JobEntity job, String configuration, VariableScope variableScope, CommandContext commandContext) executeNonTransactionally(JobEntity job, String configuration) Execute the job handler logic outside a transaction.Methods inherited from interface org.flowable.job.service.JobHandler
getType
-
Method Details
-
execute
default void execute(JobEntity job, String configuration, VariableScope variableScope, CommandContext commandContext) - Specified by:
executein interfaceJobHandler
-
executeNonTransactionally
Execute the job handler logic outside a transaction. If the handler needs to execute certain login transactionally, it can return some output and that use that in theafterExecute(JobEntity, String, Object, CommandContext)(which gets executed in a transaction).- Parameters:
job- the job that is being executedconfiguration- the job handler configuration- Returns:
- the result of the non-transactional execution
-
afterExecute
default void afterExecute(JobEntity job, String configuration, Output output, CommandContext commandContext) Method invoked with the result fromexecuteNonTransactionally(JobEntity, String). This should be used when the result of the non-transactional execution should be executed in a transaction.- Parameters:
job- The job that is being executedconfiguration- the job configurationoutput- the output from the non-transactional executioncommandContext- the command context of the current transaction
-