@Service public class ModelServiceImpl extends Object implements ModelService
| Modifier and Type | Field and Description |
|---|---|
protected AppDefinitionService |
appDefinitionService |
protected BpmnJsonConverter |
bpmnJsonConverter |
protected BpmnXMLConverter |
bpmnXMLConverter |
protected DeploymentService |
deploymentService |
protected ModelHistoryRepository |
modelHistoryRepository |
protected ModelImageService |
modelImageService |
protected ModelRelationRepository |
modelRelationRepository |
protected ModelRepository |
modelRepository |
static String |
NAMESPACE |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected static String |
PROCESS_NOT_FOUND_MESSAGE_KEY |
protected UserCache |
userCache |
| Constructor and Description |
|---|
ModelServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOrUpdateExtensionElement(String name,
String value,
UserTask userTask) |
Model |
createModel(ModelRepresentation model,
String editorJson,
User createdBy) |
Model |
createModel(Model newModel,
User createdBy) |
protected ModelHistory |
createNewModelhistory(Model model) |
Model |
createNewModelVersion(Model modelObject,
String comment,
User updatedBy) |
ModelHistory |
createNewModelVersionAndReturnModelHistory(Model modelObject,
String comment,
User updatedBy) |
void |
deleteModel(String modelId,
boolean cascadeHistory,
boolean deleteRuntimeApp) |
protected void |
deleteModelAndChildren(Model model) |
BpmnModel |
getBpmnModel(AbstractModel model) |
BpmnModel |
getBpmnModel(AbstractModel model,
Map<String,Model> formMap,
Map<String,Model> decisionTableMap) |
byte[] |
getBpmnXML(AbstractModel model) |
byte[] |
getBpmnXML(BpmnModel bpmnModel) |
Model |
getModel(String modelId) |
Long |
getModelCountForUser(User user,
int modelType) |
ModelHistory |
getModelHistory(String modelId,
String modelHistoryId) |
List<AbstractModel> |
getModelsByModelType(Integer modelType) |
protected void |
handleAppModelProcessRelations(AbstractModel appModel,
com.fasterxml.jackson.databind.node.ObjectNode appModelJsonNode) |
protected void |
handleBpmnProcessDecisionTaskModelRelations(AbstractModel bpmnProcessModel,
com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode) |
protected void |
handleBpmnProcessFormModelRelations(AbstractModel bpmnProcessModel,
com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode) |
protected void |
handleModelRelations(AbstractModel bpmnProcessModel,
Set<String> idsReferencedInJson,
String relationshipType)
Generic handling of model relations: deleting/adding where needed.
|
protected AbstractModel |
internalCreateNewModelVersion(Model modelObject,
String comment,
User updatedBy,
boolean returnModelHistory) |
protected void |
internalDeleteModelAndChildren(Model model,
List<Model> allModels) |
protected Model |
internalSave(String name,
String key,
String description,
String editorJson,
boolean newVersion,
String newVersionComment,
byte[] imageBytes,
User updatedBy,
Model modelObject) |
protected Model |
persistModel(Model model) |
protected ModelHistory |
persistModelHistory(ModelHistory modelHistory) |
protected void |
populateModelBasedOnHistory(Model model,
ModelHistory basedOn) |
ReviveModelResultRepresentation |
reviveProcessModelHistory(ModelHistory modelHistory,
User user,
String newVersionComment) |
Model |
saveModel(Model modelObject) |
Model |
saveModel(Model modelObject,
String editorJson,
byte[] imageBytes,
boolean newVersion,
String newVersionComment,
User updatedBy) |
Model |
saveModel(String modelId,
String name,
String key,
String description,
String editorJson,
boolean newVersion,
String newVersionComment,
User updatedBy) |
ModelKeyRepresentation |
validateModelKey(Model model,
Integer modelType,
String key) |
public static final String NAMESPACE
protected static final String PROCESS_NOT_FOUND_MESSAGE_KEY
@Autowired protected DeploymentService deploymentService
@Autowired protected ModelImageService modelImageService
@Autowired protected ModelRepository modelRepository
@Autowired protected ModelHistoryRepository modelHistoryRepository
@Autowired protected ModelRelationRepository modelRelationRepository
@Autowired protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
@Autowired protected UserCache userCache
@Autowired protected AppDefinitionService appDefinitionService
protected BpmnJsonConverter bpmnJsonConverter
protected BpmnXMLConverter bpmnXMLConverter
public Model getModel(String modelId)
getModel in interface ModelServicepublic List<AbstractModel> getModelsByModelType(Integer modelType)
getModelsByModelType in interface ModelServicepublic ModelHistory getModelHistory(String modelId, String modelHistoryId)
getModelHistory in interface ModelServicepublic byte[] getBpmnXML(AbstractModel model)
getBpmnXML in interface ModelServicepublic byte[] getBpmnXML(BpmnModel bpmnModel)
getBpmnXML in interface ModelServicepublic ModelKeyRepresentation validateModelKey(Model model, Integer modelType, String key)
validateModelKey in interface ModelService@Transactional public Model createModel(Model newModel, User createdBy)
createModel in interface ModelService@Transactional public Model createModel(ModelRepresentation model, String editorJson, User createdBy)
createModel in interface ModelService@Transactional public Model createNewModelVersion(Model modelObject, String comment, User updatedBy)
createNewModelVersion in interface ModelService@Transactional public ModelHistory createNewModelVersionAndReturnModelHistory(Model modelObject, String comment, User updatedBy)
createNewModelVersionAndReturnModelHistory in interface ModelServiceprotected AbstractModel internalCreateNewModelVersion(Model modelObject, String comment, User updatedBy, boolean returnModelHistory)
public Model saveModel(Model modelObject)
saveModel in interface ModelService@Transactional public Model saveModel(Model modelObject, String editorJson, byte[] imageBytes, boolean newVersion, String newVersionComment, User updatedBy)
saveModel in interface ModelService@Transactional public Model saveModel(String modelId, String name, String key, String description, String editorJson, boolean newVersion, String newVersionComment, User updatedBy)
saveModel in interface ModelServiceprotected Model internalSave(String name, String key, String description, String editorJson, boolean newVersion, String newVersionComment, byte[] imageBytes, User updatedBy, Model modelObject)
@Transactional public void deleteModel(String modelId, boolean cascadeHistory, boolean deleteRuntimeApp)
deleteModel in interface ModelServiceprotected void deleteModelAndChildren(Model model)
protected void internalDeleteModelAndChildren(Model model, List<Model> allModels)
@Transactional public ReviveModelResultRepresentation reviveProcessModelHistory(ModelHistory modelHistory, User user, String newVersionComment)
reviveProcessModelHistory in interface ModelServicepublic BpmnModel getBpmnModel(AbstractModel model)
getBpmnModel in interface ModelServicepublic BpmnModel getBpmnModel(AbstractModel model, Map<String,Model> formMap, Map<String,Model> decisionTableMap)
getBpmnModel in interface ModelServiceprotected void addOrUpdateExtensionElement(String name, String value, UserTask userTask)
public Long getModelCountForUser(User user, int modelType)
getModelCountForUser in interface ModelServiceprotected ModelHistory persistModelHistory(ModelHistory modelHistory)
protected void handleBpmnProcessFormModelRelations(AbstractModel bpmnProcessModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
protected void handleBpmnProcessDecisionTaskModelRelations(AbstractModel bpmnProcessModel, com.fasterxml.jackson.databind.node.ObjectNode editorJsonNode)
protected void handleAppModelProcessRelations(AbstractModel appModel, com.fasterxml.jackson.databind.node.ObjectNode appModelJsonNode)
protected void handleModelRelations(AbstractModel bpmnProcessModel, Set<String> idsReferencedInJson, String relationshipType)
protected ModelHistory createNewModelhistory(Model model)
protected void populateModelBasedOnHistory(Model model, ModelHistory basedOn)
Copyright © 2017 Alfresco. All rights reserved.