本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.ModelEntity类的典型用法代码示例。如果您正苦于以下问题:Java ModelEntity类的具体用法?Java ModelEntity怎么用?Java ModelEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModelEntity类属于org.activiti.engine.impl.persistence.entity包,在下文中一共展示了ModelEntity类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
@RequestMapping(value = "/model/get/{id}", method = RequestMethod.POST)
@ResponseBody
public ModelVo get(@PathVariable("id") String id) {
ModelEntity model = (ModelEntity) repositoryService.getModel(id);
ModelVo vo = new ModelVo();
BeanUtils.copyProperties(model, vo);
try {
ObjectNode metaInfo = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
vo.setId(model.getId());
String description = metaInfo.get(ModelDataJsonConstants.MODEL_DESCRIPTION).toString();
description = description.equals("null") ? null : description;
vo.setDescription(description);
} catch (Exception e) {
LOGGER.error("Error get model id=" + id, e);
throw new ActivitiException("Error get model id=" + id, e);
}
return vo;
}
示例2: copyModal
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
/**
* 模型复制
*
* @param id
* @return
*/
@RequestMapping(value = "/model/copy/{id}", method = RequestMethod.POST)
@ResponseBody
public Result copyModal(@PathVariable("id") String id) throws IOException {
ModelEntity newModel = (ModelEntity) repositoryService.newModel();
ModelEntity model = (ModelEntity) repositoryService.getModel(id);
BeanUtils.copyProperties(model, newModel, "id", "revision");
ObjectNode modelNode;
if (!StrUtil.isEmpty(model.getMetaInfo())) {
modelNode = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
newModel.setMetaInfo(modelNode.toString());
}
newModel.setDeploymentId(null);
newModel.setEditorSourceExtraValueId(null);
newModel.setEditorSourceValueId(null);
newModel.setName(model.getName() + "(副本)");
repositoryService.saveModel(newModel);
repositoryService.addModelEditorSource(newModel.getId(), repositoryService.getModelEditorSource(model.getId()));
repositoryService.addModelEditorSourceExtra(newModel.getId(), repositoryService.getModelEditorSourceExtra
(model.getId()));
return new Result(true, newModel.getId(), "流程复制成功");
}
示例3: testNativeQuery
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public void testNativeQuery() {
assertEquals("ACT_RE_MODEL", managementService.getTableName(Model.class));
assertEquals("ACT_RE_MODEL", managementService.getTableName(ModelEntity.class));
String tableName = managementService.getTableName(Model.class);
String baseQuerySql = "SELECT * FROM " + tableName;
assertEquals(1, repositoryService.createNativeModelQuery().sql(baseQuerySql).list().size());
assertEquals(1, repositoryService.createNativeProcessDefinitionQuery().sql(baseQuerySql + " where NAME_ = #{name}")
.parameter("name", "my model").list().size());
// paging
assertEquals(1, repositoryService.createNativeProcessDefinitionQuery().sql(baseQuerySql).listPage(0, 1).size());
assertEquals(0, repositoryService.createNativeProcessDefinitionQuery().sql(baseQuerySql).listPage(1, 5).size());
}
示例4: saveModel
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
@Override
public void saveModel(Model model) {
commandExecutor.execute(new SaveModelCmd((ModelEntity) model));
}
示例5: SaveModelCmd
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public SaveModelCmd(ModelEntity model) {
this.model = model;
}
示例6: execute
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
@Override
public ModelEntity execute(CommandContext commandContext) {
return commandContext.getModelEntityManager().findModelById(modelId);
}
示例7: saveModel
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public void saveModel(Model model) {
commandExecutor.execute(new SaveModelCmd((ModelEntity) model));
}
示例8: SaveModelCmd
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public SaveModelCmd(ModelEntity model) {
this.model = model;
}
示例9: execute
import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public ModelEntity execute(CommandContext commandContext) {
return Context.getCommandContext().getModelEntityManager().findModelById(modelId);
}