Package org.flowable.ui.modeler.service
Class ModelServiceImpl
- java.lang.Object
-
- org.flowable.ui.modeler.service.ModelServiceImpl
-
- All Implemented Interfaces:
ModelService
@Transactional public class ModelServiceImpl extends Object implements ModelService
-
-
Field Summary
Fields Modifier and Type Field Description protected BpmnJsonConverterbpmnJsonConverterprotected BpmnXMLConverterbpmnXMLConverterprotected CmmnJsonConvertercmmnJsonConverterprotected CmmnXmlConvertercmmnXMLConverterprotected ModelHistoryRepositorymodelHistoryRepositoryprotected ModelImageServicemodelImageServiceprotected ModelRelationRepositorymodelRelationRepositoryprotected ModelRepositorymodelRepositorystatic StringNAMESPACEprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapperprotected static StringPROCESS_NOT_FOUND_MESSAGE_KEY
-
Constructor Summary
Constructors Constructor Description ModelServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddOrUpdateExtensionElement(String name, String value, UserTask userTask)protected Map<String,String>convertToModelKeyMap(Map<String,Model> modelMap)ModelcreateModel(Model newModel, String createdBy)ModelcreateModel(ModelRepresentation model, String editorJson, String createdBy)StringcreateModelJson(ModelRepresentation model)protected ModelHistorycreateNewModelhistory(Model model)ModelcreateNewModelVersion(Model modelObject, String comment, String updatedBy)ModelHistorycreateNewModelVersionAndReturnModelHistory(Model modelObject, String comment, String updatedBy)voiddeleteModel(String modelId)protected voiddeleteModelAndChildren(Model model)BpmnModelgetBpmnModel(AbstractModel model)BpmnModelgetBpmnModel(AbstractModel model, ConverterContext appConverterContext)byte[]getBpmnXML(BpmnModel bpmnModel)byte[]getBpmnXML(AbstractModel model)CmmnModelgetCmmnModel(AbstractModel model)CmmnModelgetCmmnModel(AbstractModel model, ConverterContext converterContext)byte[]getCmmnXML(CmmnModel cmmnModel)byte[]getCmmnXML(AbstractModel model)ModelgetModel(String modelId)LonggetModelCountForUser(String userId, int modelType)ModelHistorygetModelHistory(String modelId, String modelHistoryId)ModelRepresentationgetModelRepresentation(String modelId)List<AbstractModel>getModelsByModelType(Integer modelType)protected voidhandleAppModelProcessRelations(AbstractModel appModel, com.fasterxml.jackson.databind.node.ObjectNode appModelJsonNode)protected voidhandleBpmnProcessDecisionTaskModelRelations(AbstractModel bpmnProcessModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleBpmnProcessFormModelRelations(AbstractModel bpmnProcessModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleCmmnCaseModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleCmmnDecisionModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleCmmnFormModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleCmmnProcessModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleDecisionServiceModelDecisionTableRelations(AbstractModel decisionServiceModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)protected voidhandleModelRelations(AbstractModel bpmnProcessModel, Set<String> idsReferencedInJson, String relationshipType)Generic handling of model relations: deleting/adding where needed.ModelRepresentationimportNewVersion(String modelId, String fileName, InputStream modelStream)protected AbstractModelinternalCreateNewModelVersion(Model modelObject, String comment, String updatedBy, boolean returnModelHistory)protected voidinternalDeleteModelAndChildren(Model model, List<Model> allModels)protected ModelinternalSave(String name, String key, String description, String editorJson, boolean newVersion, String newVersionComment, byte[] imageBytes, String updatedBy, Model modelObject)protected ModelpersistModel(Model model)protected voidpersistModelHistory(ModelHistory modelHistory)protected voidpopulateModelBasedOnHistory(Model model, ModelHistory basedOn)ReviveModelResultRepresentationreviveProcessModelHistory(ModelHistory modelHistory, String userId, String newVersionComment)ModelsaveModel(String modelId, String name, String key, String description, String editorJson, boolean newVersion, String newVersionComment, String updatedBy)ModelsaveModel(Model modelObject)ModelsaveModel(Model modelObject, String editorJson, byte[] imageBytes, boolean newVersion, String newVersionComment, String updatedBy)ModelKeyRepresentationvalidateModelKey(Model model, Integer modelType, String key)
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
- See Also:
- Constant Field Values
-
PROCESS_NOT_FOUND_MESSAGE_KEY
protected static final String PROCESS_NOT_FOUND_MESSAGE_KEY
- See Also:
- Constant Field Values
-
modelImageService
@Autowired protected ModelImageService modelImageService
-
modelRepository
@Autowired protected ModelRepository modelRepository
-
modelHistoryRepository
@Autowired protected ModelHistoryRepository modelHistoryRepository
-
modelRelationRepository
@Autowired protected ModelRelationRepository modelRelationRepository
-
objectMapper
@Autowired protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
bpmnJsonConverter
protected BpmnJsonConverter bpmnJsonConverter
-
bpmnXMLConverter
protected BpmnXMLConverter bpmnXMLConverter
-
cmmnJsonConverter
protected CmmnJsonConverter cmmnJsonConverter
-
cmmnXMLConverter
protected CmmnXmlConverter cmmnXMLConverter
-
-
Method Detail
-
getModel
public Model getModel(String modelId)
- Specified by:
getModelin interfaceModelService
-
getModelRepresentation
public ModelRepresentation getModelRepresentation(String modelId)
- Specified by:
getModelRepresentationin interfaceModelService
-
getModelsByModelType
public List<AbstractModel> getModelsByModelType(Integer modelType)
- Specified by:
getModelsByModelTypein interfaceModelService
-
getModelHistory
public ModelHistory getModelHistory(String modelId, String modelHistoryId)
- Specified by:
getModelHistoryin interfaceModelService
-
getBpmnXML
public byte[] getBpmnXML(AbstractModel model)
- Specified by:
getBpmnXMLin interfaceModelService
-
getBpmnXML
public byte[] getBpmnXML(BpmnModel bpmnModel)
- Specified by:
getBpmnXMLin interfaceModelService
-
getCmmnXML
public byte[] getCmmnXML(AbstractModel model)
- Specified by:
getCmmnXMLin interfaceModelService
-
getCmmnXML
public byte[] getCmmnXML(CmmnModel cmmnModel)
- Specified by:
getCmmnXMLin interfaceModelService
-
validateModelKey
public ModelKeyRepresentation validateModelKey(Model model, Integer modelType, String key)
- Specified by:
validateModelKeyin interfaceModelService
-
createModelJson
public String createModelJson(ModelRepresentation model)
- Specified by:
createModelJsonin interfaceModelService
-
createModel
public Model createModel(Model newModel, String createdBy)
- Specified by:
createModelin interfaceModelService
-
createModel
public Model createModel(ModelRepresentation model, String editorJson, String createdBy)
- Specified by:
createModelin interfaceModelService
-
importNewVersion
public ModelRepresentation importNewVersion(String modelId, String fileName, InputStream modelStream)
- Specified by:
importNewVersionin interfaceModelService
-
createNewModelVersion
public Model createNewModelVersion(Model modelObject, String comment, String updatedBy)
- Specified by:
createNewModelVersionin interfaceModelService
-
createNewModelVersionAndReturnModelHistory
public ModelHistory createNewModelVersionAndReturnModelHistory(Model modelObject, String comment, String updatedBy)
- Specified by:
createNewModelVersionAndReturnModelHistoryin interfaceModelService
-
internalCreateNewModelVersion
protected AbstractModel internalCreateNewModelVersion(Model modelObject, String comment, String updatedBy, boolean returnModelHistory)
-
saveModel
public Model saveModel(Model modelObject)
- Specified by:
saveModelin interfaceModelService
-
saveModel
public Model saveModel(Model modelObject, String editorJson, byte[] imageBytes, boolean newVersion, String newVersionComment, String updatedBy)
- Specified by:
saveModelin interfaceModelService
-
saveModel
public Model saveModel(String modelId, String name, String key, String description, String editorJson, boolean newVersion, String newVersionComment, String updatedBy)
- Specified by:
saveModelin interfaceModelService
-
internalSave
protected Model internalSave(String name, String key, String description, String editorJson, boolean newVersion, String newVersionComment, byte[] imageBytes, String updatedBy, Model modelObject)
-
deleteModel
public void deleteModel(String modelId)
- Specified by:
deleteModelin interfaceModelService
-
deleteModelAndChildren
protected void deleteModelAndChildren(Model model)
-
internalDeleteModelAndChildren
protected void internalDeleteModelAndChildren(Model model, List<Model> allModels)
-
reviveProcessModelHistory
public ReviveModelResultRepresentation reviveProcessModelHistory(ModelHistory modelHistory, String userId, String newVersionComment)
- Specified by:
reviveProcessModelHistoryin interfaceModelService
-
getBpmnModel
public BpmnModel getBpmnModel(AbstractModel model)
- Specified by:
getBpmnModelin interfaceModelService
-
getBpmnModel
public BpmnModel getBpmnModel(AbstractModel model, ConverterContext appConverterContext)
- Specified by:
getBpmnModelin interfaceModelService
-
getCmmnModel
public CmmnModel getCmmnModel(AbstractModel model)
- Specified by:
getCmmnModelin interfaceModelService
-
getCmmnModel
public CmmnModel getCmmnModel(AbstractModel model, ConverterContext converterContext)
- Specified by:
getCmmnModelin interfaceModelService
-
addOrUpdateExtensionElement
protected void addOrUpdateExtensionElement(String name, String value, UserTask userTask)
-
getModelCountForUser
public Long getModelCountForUser(String userId, int modelType)
- Specified by:
getModelCountForUserin interfaceModelService
-
persistModelHistory
protected void persistModelHistory(ModelHistory modelHistory)
-
handleBpmnProcessFormModelRelations
protected void handleBpmnProcessFormModelRelations(AbstractModel bpmnProcessModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleBpmnProcessDecisionTaskModelRelations
protected void handleBpmnProcessDecisionTaskModelRelations(AbstractModel bpmnProcessModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleCmmnFormModelRelations
protected void handleCmmnFormModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleCmmnDecisionModelRelations
protected void handleCmmnDecisionModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleCmmnCaseModelRelations
protected void handleCmmnCaseModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleCmmnProcessModelRelations
protected void handleCmmnProcessModelRelations(AbstractModel caseModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleAppModelProcessRelations
protected void handleAppModelProcessRelations(AbstractModel appModel, com.fasterxml.jackson.databind.node.ObjectNode appModelJsonNode)
-
handleDecisionServiceModelDecisionTableRelations
protected void handleDecisionServiceModelDecisionTableRelations(AbstractModel decisionServiceModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
-
handleModelRelations
protected void handleModelRelations(AbstractModel bpmnProcessModel, Set<String> idsReferencedInJson, String relationshipType)
Generic handling of model relations: deleting/adding where needed.
-
createNewModelhistory
protected ModelHistory createNewModelhistory(Model model)
-
populateModelBasedOnHistory
protected void populateModelBasedOnHistory(Model model, ModelHistory basedOn)
-
-