Class ModelService
Note: BPMModel instances are not Thread save. For this reason the service the method getBPMNModel returns an exclusive version of a BPMNModel object.
- Author:
- rsoika
- See Also:
-
ModelManager
org.imixs.workflow.jee.ejb.ModelManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addModelData
(String version, org.openbpmn.bpmn.BPMNModel model, ItemCollection metadata) Adds a BPMNModel with its metadata into the local model store.void
deleteModelData
(String version) This method deletes an existing Model from the database and removes the model data form the internal ModelStore.This method returns a sorted list of all model groups over all models.findVersionByGroup
(String group) Returns a version by Group.org.openbpmn.bpmn.BPMNModel
getBPMNModel
(String version) This method should return a thread save version of a stored BPMN Modelreturns a sorted String list of all stored model versionsboolean
hasModelVersion
(String version) Returns true if the given Model Version exists in the local storevoid
init()
Lazy loading of ModelManagerloadModelMetaData
(String version) This method loads a Model metadata form the internal model store.void
removeModelData
(String version) Removes a BPMNModel form the local model storevoid
saveModel
(org.openbpmn.bpmn.BPMNModel model) This method saves a BPMNModel into the database and adds the model into the internal model store.void
This method saves a BPMNModel with its meta data into the database and adds the model into the internal model store.
-
Field Details
-
documentService
-
ctx
protected jakarta.ejb.SessionContext ctx
-
-
Constructor Details
-
ModelService
public ModelService()
-
-
Method Details
-
init
@PostConstruct public void init()Lazy loading of ModelManager -
addModelData
public void addModelData(String version, org.openbpmn.bpmn.BPMNModel model, ItemCollection metadata) Adds a BPMNModel with its metadata into the local model store.The method pre initialize all processes within the BPMNModel to avoid the lazing loading.
The Method does not store the data in the database. To store new model data call
saveModel
-
getVersions
returns a sorted String list of all stored model versions- Returns:
-
loadModelMetaData
This method loads a Model metadata form the internal model store.To access a BPMNModel object directly use the method
getModel(version)
- Returns:
- the ItemCollection with the model meta data
-
getBPMNModel
This method should return a thread save version of a stored BPMN Model- Parameters:
version
-- Returns:
-
removeModelData
Removes a BPMNModel form the local model store -
hasModelVersion
Returns true if the given Model Version exists in the local store- Parameters:
group
-- Returns:
-
findAllWorkflowGroups
This method returns a sorted list of all model groups over all models.Note: A workflow group may exist in different models by the same name!
- Parameters:
group
-- Returns:
-
findVersionByGroup
Returns a version by Group. The method computes a sorted list of all 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
- - name of the workflow group- Returns:
- list of matching model versions
- Throws:
ModelException
-
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 with its meta data into the database and adds the model into the internal model store. In the database entry the BPMNmodel is attached as an embedded XML 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 corresponding model document.
- Parameters:
model
-- Throws:
ModelException
-
deleteModelData
This method deletes an existing Model from the database and removes the model data 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:
bpmnModel
-
-