Package com.axelor.meta.db.repo
Class MetaWorkflowRepository
java.lang.Object
com.axelor.db.JpaRepository<MetaWorkflow>
com.axelor.meta.db.repo.AbstractMetaWorkflowRepository
com.axelor.meta.db.repo.MetaWorkflowRepository
- All Implemented Interfaces:
Repository<MetaWorkflow>
-
Field Summary
Fields inherited from class com.axelor.db.JpaRepository
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertNoInflight(MetaWorkflow entity) Reject an operation (edit, remove, or app undeploy) that would strand in-flight instances — a run parked at a task/wait, or a pending approval task.findByModelNameJson(String model, String name, String jsonModel) The lone definition for a (model, name) with the given jsonModel (blank when none).booleanhasInflight(MetaWorkflow entity) True when any run is parked (waiting) or any task pending on this definition.voidremove(MetaWorkflow entity) Remove the given entity.The same resolution for many runs, in one query instead of one per run.save(MetaWorkflow entity) Save the given entity.Methods inherited from class com.axelor.meta.db.repo.AbstractMetaWorkflowRepository
findByID, findByModelAndName, findByModule, findByNameMethods inherited from class com.axelor.db.JpaRepository
all, all, copy, create, fields, find, findById, findByIds, flush, getReferenceById, isPermitted, isPermitted, merge, of, persist, populate, refresh, validate
-
Constructor Details
-
MetaWorkflowRepository
public MetaWorkflowRepository()
-
-
Method Details
-
save
Description copied from interface:RepositorySave the given entity.Depending on the implementation, it may return same entity or a copy of it. For example JPA implementation may return a copy if the given entity can't be managed.
- Specified by:
savein interfaceRepository<MetaWorkflow>- Overrides:
savein classJpaRepository<MetaWorkflow>- Parameters:
entity- the entity object to save- Returns:
- an instance of the entity with saved state
-
remove
Description copied from interface:RepositoryRemove the given entity.- Specified by:
removein interfaceRepository<MetaWorkflow>- Overrides:
removein classJpaRepository<MetaWorkflow>- Parameters:
entity- the entity object
-
resolveGraphsForRuns
The same resolution for many runs, in one query instead of one per run.Worth having because the cost is the query, not the payload: a 359-character definition and an 11 000-character one measure the same per call, so what a record with several parked runs pays on every save is one round trip each. Runs on the same record usually share very few distinct definitions, so the pairs asked for here collapse to a handful.
Returns run id to definition XML, with no entry for a run whose definition is gone. A run with no pinned revision falls back to the definition as it stands, one query each -- in practice only hand-built runs, i.e. tests.
-
resolveGraphForRun
-
findByModelNameJson
The lone definition for a (model, name) with the given jsonModel (blank when none). -
hasInflight
True when any run is parked (waiting) or any task pending on this definition. -
assertNoInflight
Reject an operation (edit, remove, or app undeploy) that would strand in-flight instances — a run parked at a task/wait, or a pending approval task. The caller must complete or cancel them first. Shared by the save-time edit guard and the remove/undeploy path.
-