Package com.axelor.workflow
Interface WorkflowDefinitions
- All Known Implementing Classes:
WorkflowRegistry
public interface WorkflowDefinitions
Which workflows are deployed, and which of them apply to a given record, trigger or message. The
engine asks;
com.axelor.workflow.registry.WorkflowRegistry answers and is bound in
AppModule, so the engine does not depend on the metadata layer.-
Method Summary
Modifier and TypeMethodDescriptionA stamp over the deployed set as it is now: two captures with different stamps straddle a deployment.booleandispatches(String model, String jsonModel) Whether a save of this kind of record could dispatch a workflow at all.booleanhasWorkflows(String model, String jsonModel) Whether any workflow could be bound to this kind of record, dispatched or not; the delete listener asks this wider question, since a manual workflow parks approvals too.voidrefresh()Rebuild the answers if the deployed set has moved.resolve(String model, String jsonModel, TriggerKind trigger) The definitions eligible for this record and trigger, in the order they should run.resolveByRef(String name) The highest-priority active workflow namedname, or null.resolveOne(String name, String model, String jsonModel) The effective definition for(model, jsonModel, name), for starting one by name.startingOn(String messageName) The definitions that start on this message name, across every model.
-
Method Details
-
dispatches
Whether a save of this kind of record could dispatch a workflow at all. Asked during flush, so it answers from memory, and says true when nothing is known yet.- Parameters:
jsonModel- the custom model, whenmodelisMetaJsonRecord; else null
-
refresh
void refresh()Rebuild the answers if the deployed set has moved. Needs anEntityManager; never call it from a flush. -
hasWorkflows
Whether any workflow could be bound to this kind of record, dispatched or not; the delete listener asks this wider question, since a manual workflow parks approvals too. -
resolve
The definitions eligible for this record and trigger, in the order they should run. -
startingOn
The definitions that start on this message name, across every model. -
resolveOne
The effective definition for(model, jsonModel, name), for starting one by name. -
resolveByRef
The highest-priority active workflow namedname, or null. -
currentStamp
String currentStamp()A stamp over the deployed set as it is now: two captures with different stamps straddle a deployment.
-