Class 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 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:
  • Field Details

    • modelManager

      protected ModelManager modelManager
    • documentService

      @Inject protected DocumentService documentService
    • ctx

      protected jakarta.ejb.SessionContext ctx
  • Constructor Details

    • ModelService

      public ModelService()
  • Method Details

    • init

      @PostConstruct public void init()
      Lazy loading of ModelManager
    • getModelManager

      public ModelManager getModelManager()
      Returns an instance of a modelManager
      Returns:
    • addModel

      @Deprecated public void addModel(org.openbpmn.bpmn.BPMNModel model) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • loadProcess

      @Deprecated public ItemCollection loadProcess(ItemCollection workitem) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • loadDefinition

      @Deprecated public ItemCollection loadDefinition(org.openbpmn.bpmn.BPMNModel model) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • loadEvent

      @Deprecated public ItemCollection loadEvent(ItemCollection workitem) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • loadTask

      @Deprecated public ItemCollection loadTask(ItemCollection workitem) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • nextModelElement

      @Deprecated public ItemCollection nextModelElement(ItemCollection event, ItemCollection workitem) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • removeModel

      @Deprecated public void removeModel(String modelversion)
      Deprecated.
      Deprecated method, use instead getModelManager()..
    • getModel

      @Deprecated public org.openbpmn.bpmn.BPMNModel getModel(String version) throws ModelException
      Deprecated.
      Deprecated method, use instead getModelManager()..
      Throws:
      ModelException
    • getModelByWorkitem

      @Deprecated public org.openbpmn.bpmn.BPMNModel getModelByWorkitem(ItemCollection workitem) throws ModelException
      Deprecated.
      Returns a BPMNModel by a workItem. The workitem must at least provide the item '$modelversion' or '$workflowgroup' to resolve the model. The $modelversion can be a regular expression.

      The BPMNModel instance can be used to access all BPMN model elements.

      Parameters:
      version - - $modelVersion
      Returns:
      a BPMN model instance or null if not found by $modelVersion
      Throws:
      ModelException
    • getVersions

      @Deprecated public List<String> getVersions()
      Deprecated.
      Deprecated method, use instead getModelManager()..
    • getWorkflowGroups

      @Deprecated public List<String> getWorkflowGroups(org.openbpmn.bpmn.BPMNModel model)
      Deprecated.
      This method returns a sorted list of all model groups stored in a given BPMNModel.

      Note: A workflow group may exist in different models by the same name!

      Parameters:
      group -
      Returns:
    • 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.

      Parameters:
      model -
      Throws:
      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.

      Parameters:
      model -
      Throws:
      ModelException
    • getModelEntityStore

      public Map<String,ItemCollection> getModelEntityStore()
      This method puts a model entity into the internal store.
      Parameters:
      modelEntity -
    • loadModel

      public ItemCollection loadModel(String version)
      This method loads a Model entity with its meta data form the internal model store.

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

      Returns:
      the ItemCollection with the model meta data
    • deleteModel

      public void deleteModel(String version)
      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 -
    • findModelEntity

      public ItemCollection findModelEntity(String version)
      This method fetches an existing Model Entity from the model store
      Parameters:
      model -