Package de.xima.fc.dao.interfaces
Interface IWorkflowVersionDao
-
- All Superinterfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<WorkflowVersion,Long,IEntityContext>
,IGenericDao<WorkflowVersion>
,IProjektDependentBaseDao<WorkflowVersion>
- All Known Implementing Classes:
WorkflowVersionDao
public interface IWorkflowVersionDao extends IProjektDependentBaseDao<WorkflowVersion>
Data access object for creating, updating, and deletingWorkflowVersion
entities.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorkflowVersion
createNewWorkflowVersion(Projekt project, long versionNumber)
Creates a new workflow version with the default workflow states and an empty process, but does not persist it yet.void
deleteExistingVersion(IEntityContext ec, WorkflowVersion workflowVersion)
Delete an existing (persisted) workflow version.long
findNewVersionNumber(IEntityContext ec, Projekt project)
Finds a version number for a new version entity.WorkflowVersion
getActiveByProject(IEntityContext ec, Projekt project)
Finds the active workflow version for the given project.WorkflowVersion
getByVersionNumber(IEntityContext ec, Projekt project, long versionNumber)
Finds the workflow version with the given version number, if such a version exists.WorkflowVersion
loadFullVersion(IEntityContext ec, long workflowVersionId)
Loads the workflow version with the given entity and all associated entities (makes sure lazy associations are initiated).WorkflowVersion
replaceVersion(IEntityContext ec, WorkflowVersion oldWorkflowVersion, WorkflowVersion newWorkflowVersion)
Replaces the given old workflow version with the data of the new workflow version.WorkflowVersion
saveVersion(IEntityContext ec, WorkflowVersion workflowVersion)
Saves the workflow version.-
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
-
-
-
Method Detail
-
createNewWorkflowVersion
WorkflowVersion createNewWorkflowVersion(Projekt project, long versionNumber)
Creates a new workflow version with the default workflow states and an empty process, but does not persist it yet.- Parameters:
project
- Project for which to create a new version.versionNumber
- Version number of the workflow version.- Returns:
- A new, non-persisted workflow version.
-
deleteExistingVersion
void deleteExistingVersion(IEntityContext ec, WorkflowVersion workflowVersion)
Delete an existing (persisted) workflow version. Makes sure to delete all processes, tasks, triggers, and nodes as well.- Parameters:
ec
- The current entity context to use for interacting with the database.workflowVersion
- A persisted workflow version to delete.
-
findNewVersionNumber
long findNewVersionNumber(IEntityContext ec, Projekt project)
Finds a version number for a new version entity. It is guaranteed that this number is different from all version numbers of theProjekt.getWorkflowVersions()
of the given project.- Parameters:
ec
- The current entity context to use for interacting with the database.project
- The project with workflow versions for which a new version number is sought.- Returns:
- A new version number different from all version of the given project.
-
getActiveByProject
WorkflowVersion getActiveByProject(IEntityContext ec, Projekt project)
Finds the active workflow version for the given project. Creates a new workflow version when no version exists yet.- Parameters:
ec
- The current entity context to use for interacting with the database.project
- The project for which to find the active workflow version.- Returns:
- The currently active workflow version of the given project. Returns
null
when the project does not use the new workflow.
-
getByVersionNumber
WorkflowVersion getByVersionNumber(IEntityContext ec, Projekt project, long versionNumber)
Finds the workflow version with the given version number, if such a version exists.- Parameters:
ec
- The current entity context to use for interacting with the database.project
- The project to search for the workflow version.versionNumber
- The version number of the workflow version to find.- Returns:
- The workflow version with the given version number that belong to the given project, or
null
if no such workflow version exists.
-
loadFullVersion
WorkflowVersion loadFullVersion(IEntityContext ec, long workflowVersionId)
Loads the workflow version with the given entity and all associated entities (makes sure lazy associations are initiated).- Parameters:
ec
- The current entity context to use for interacting with the database.workflowVersionId
- ID of the workflow version to load.- Returns:
- The workflow version with the given ID;
null
when no such version exists.
-
saveVersion
WorkflowVersion saveVersion(IEntityContext ec, WorkflowVersion workflowVersion)
Saves the workflow version. Makes sure to persist all processes, tasks, triggers, and nodes as well.- Parameters:
ec
- The current entity context to use for interacting with the database.workflowVersion
- A workflow version to persist.- Returns:
- The newly persisted workflow version.
-
replaceVersion
WorkflowVersion replaceVersion(IEntityContext ec, WorkflowVersion oldWorkflowVersion, WorkflowVersion newWorkflowVersion)
Replaces the given old workflow version with the data of the new workflow version. Makes sure to persist all processes, tasks, triggers, and nodes as well.When
oldWorkflowVersion
isnull
, thenewWorkflowVersion
will be created. WhennewWorkflowVersion
isnull
, theoldWorkflowVersion
will be deleted.- Parameters:
ec
- The current entity context to use for interacting with the database.oldWorkflowVersion
- Old workflow version to replace.newWorkflowVersion
- New workflow version to replace the old one.- Returns:
- The updated workflow version.
-
-