Klasse ModelService

java.lang.Object
org.imixs.workflow.engine.ModelService

@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
The ModelService provides methods to load and save BPMNModel data form the Database and methods to find model versions based on meta information.

Note: BPMModel instances are not Thread save. For this reason the service the method getBPMNModel returns an exclusive version of a BPMNModel object.

Autor:
rsoika
Siehe auch:
  • ModelManager
  • Ungültige Referenz
    org.imixs.workflow.jee.ejb.ModelManager
  • Felddetails

    • documentService

      @Inject protected DocumentService documentService
    • ctx

      protected jakarta.ejb.SessionContext ctx
  • Konstruktordetails

    • ModelService

      public ModelService()
  • Methodendetails

    • 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

      public List<String> getVersions()
      returns a sorted String list of all stored model versions
      Gibt zurück:
    • loadModelMetaData

      public ItemCollection loadModelMetaData(String version) throws ModelException
      This method loads a Model metadata form the internal model store.

      To access a BPMNModel object directly use the method getModel(version)

      Gibt zurück:
      the ItemCollection with the model meta data
      Löst aus:
      ModelException
    • getBPMNModel

      public org.openbpmn.bpmn.BPMNModel getBPMNModel(String version) throws ModelException
      This method should return a thread save version of a stored BPMN Model
      Parameter:
      version -
      Gibt zurück:
      Löst aus:
      ModelException
    • removeModelData

      public void removeModelData(String version)
      Removes a BPMNModel form the local model store
    • hasModelVersion

      public boolean hasModelVersion(String version)
      Returns true if the given Model Version exists in the local store

      Parameter:
      group -
      Gibt zurück:
    • findAllWorkflowGroups

      public List<String> 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!

      Parameter:
      group -
      Gibt zurück:
    • findVersionByGroup

      public String findVersionByGroup(String group) throws ModelException
      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.
      Parameter:
      group - - name of the workflow group
      Gibt zurück:
      list of matching model versions
      Löst aus:
      ModelException
    • saveModel

      public void saveModel(org.openbpmn.bpmn.BPMNModel model) throws ModelException
      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.

      Parameter:
      model -
      Löst aus:
      ModelException
    • saveModel

      public void saveModel(org.openbpmn.bpmn.BPMNModel model, String _filename) throws ModelException
      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.

      Parameter:
      model -
      Löst aus:
      ModelException
    • deleteModelData

      public void deleteModelData(String version) throws ModelException
      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

      Parameter:
      bpmnModel -
      Löst aus:
      ModelException