HR processes are mostly a special type of processors or stateful long running tasks. The intent here is to keep the process logic in the Activiti workflow, so it can be easily extensible without the need of digging in the code.
Both HR processors or long running tasks executes the same Activiti workflow process, the difference is in the time of execution: - processors executes process immediately, when identity contract is changed (active operation) - long running tasks are scheduled, mainly over night. So only the contract change is saved, and the HR processes are executed separately. Choosing the way is configurable - processor can be disabled, long running tasks can be scheduled or not.
The AbstractWorkflowStatefulExecutor
bears the responsibility of launching workflow tasks. The idea right now is fairly simple - execute the process synchronously for one user and return the operation result. The convention is that the processed item (of AbstractDto
type) is passed into the workflow, which in turn writes the OperationResult
as "operationResult" variable. You are advised to list through the standard set of workflow to see the real-world examples.
Developer tip: avoid asynchronous workflow execution if possible.
The process is:
HrEnableContractProcess
executor and hrEnableContract
Activiti workflow.The process is:
HrEndContractProcess
executor and hrEndContract
Activiti workflow.The process is:
HrContractExclusionProcess
executor and hrContractExclusion
Activiti workflow.