Package org.imixs.workflow.engine
Class ModelService
java.lang.Object
org.imixs.workflow.engine.ModelService
- All Implemented Interfaces:
ModelManager
@DeclareRoles({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"})
@RolesAllowed({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"})
public class ModelService
extends Object
implements ModelManager
The ModelManager is independent form the IX JEE Entity EJBs and uses the
standard IntemCollection Object as a data transfer object to communicate with
clients.
Since Version 1.7.0
The Implementation handles multiple model versions. Different Versions of an
Model Entity can be saved and updated. The Getter methods can be furthermore
Controlled by providing a valid Model Version. If no model version is set
this Implementation automatically defaults to the highest available
ModelVersion
- Author:
- rsoika
- See Also:
-
ModelManager
org.imixs.workflow.jee.ejb.ModelManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This Method adds a model into the internal model store.void
deleteModel
(String version) This method deletes an existing Model from the database and removes the model form the internal ModelStore.findVersionsByGroup
(String group) This method returns a sorted list of model versions containing the requested workflow group.findVersionsByRegEx
(String modelRegex) This method returns a sorted list of model versions matching a given regex for a model version.getDataObject
(ItemCollection bpmnElement, String name) Returns a BPMN DataObject, part of a Task or Event element, by its nameThe method returns a sorted list of all available workflow groupsReturns a sorted String list of the latest version for each workflowGroupReturns a Model by version.getModelByWorkitem
(ItemCollection workitem) Returns a Model matching a given workitem.returns a sorted String list of all stored model versionsloadModelEntity
(String version) This method loads an existing Model Entities from the database.void
removeModel
(String modelversion) This method removes a specific ModelVersion form the internal model store.void
This method saves a BPMNModel into the database and adds the model into the internal model store.void
This method saves a BPMNModel into the database and adds the model into the internal model store.
-
Constructor Details
-
ModelService
public ModelService()
-
-
Method Details
-
addModel
This Method adds a model into the internal model store. The model will not be saved in the database! Use saveModel to store the model permanently.- Specified by:
addModel
in interfaceModelManager
- Throws:
ModelException
-
removeModel
This method removes a specific ModelVersion form the internal model store. If modelVersion is null the method will remove all models. The model will not be removed from the database. Use deleteModel to delete the model from the database.- Specified by:
removeModel
in interfaceModelManager
- Throws:
AccessDeniedException
-
getModel
Returns a Model by version. In case no matching model version exits, the method throws a ModelException.- Specified by:
getModel
in interfaceModelManager
- Returns:
- Model
- Throws:
ModelException
-
getModelByWorkitem
Returns a Model matching a given workitem. In case not matching model version exits, the method returns the highest Model Version matching the corresponding workflow group. The method throws a ModelException in case the model version did not exits.- Specified by:
getModelByWorkitem
in interfaceModelManager
- Returns:
- Model
- Throws:
ModelException
-
getVersions
returns a sorted String list of all stored model versions- Returns:
-
getLatestVersions
Returns a sorted String list of the latest version for each workflowGroup- Returns:
-
getGroups
The method returns a sorted list of all available workflow groups- Returns:
-
findVersionsByGroup
This method returns a sorted list of model versions containing the requested workflow group. The result is sorted in reverse order, so the highest version number is the first in the result list.- Parameters:
group
-- Returns:
-
findVersionsByRegEx
This method returns a sorted list of model versions matching a given regex for a model version. The result is sorted in reverse order, so the highest version number is the first in the result list.- Parameters:
group
-- Returns:
-
saveModel
This method saves a BPMNModel into the database and adds the model into the internal model store.If a model with the same model version exists in the database the old version will be deleted form the database first.
- Parameters:
model
-- Throws:
ModelException
-
saveModel
This method saves a BPMNModel into the database and adds the model into the internal model store. The model is attached as an embedded file with the given filename.If a model with the same model version exists in the database the old version will be deleted form the database first.
The param 'filename' is used to store the bpmn file in the correspondig model document.
- Parameters:
model
-- Throws:
ModelException
-
deleteModel
This method deletes an existing Model from the database and removes the model form the internal ModelStore.A model entity is identified by the type='model' and its name (model version). After the model entity was deleted form the database, the method will also remove the model from the ModelManager
- Parameters:
model
-
-
loadModelEntity
This method loads an existing Model Entities from the database. A model entity is identified by its name (model version).- Parameters:
model
-
-
getDataObject
Returns a BPMN DataObject, part of a Task or Event element, by its nameDataObjects can be associated in a BPMN Diagram with a Task or an Event element
- Parameters:
bpmnElement
-- Returns:
-