当前位置: 首页>>代码示例>>Java>>正文


Java ModelEntity类代码示例

本文整理汇总了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;
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:20,代码来源:ModelOperationController.java

示例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(), "流程复制成功");
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:28,代码来源:ModelOperationController.java

示例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());
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:16,代码来源:ModelQueryTest.java

示例4: saveModel

import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
@Override
public void saveModel(Model model) {
    commandExecutor.execute(new SaveModelCmd((ModelEntity) model));
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:RepositoryServiceImpl.java

示例5: SaveModelCmd

import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public SaveModelCmd(ModelEntity model) {
    this.model = model;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:4,代码来源:SaveModelCmd.java

示例6: execute

import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
@Override
public ModelEntity execute(CommandContext commandContext) {
    return commandContext.getModelEntityManager().findModelById(modelId);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:GetModelCmd.java

示例7: saveModel

import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public void saveModel(Model model) {
  commandExecutor.execute(new SaveModelCmd((ModelEntity) model));
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:4,代码来源:RepositoryServiceImpl.java

示例8: SaveModelCmd

import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public SaveModelCmd(ModelEntity model) {
  this.model = model;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:4,代码来源:SaveModelCmd.java

示例9: execute

import org.activiti.engine.impl.persistence.entity.ModelEntity; //导入依赖的package包/类
public ModelEntity execute(CommandContext commandContext) {
  return Context.getCommandContext().getModelEntityManager().findModelById(modelId);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:4,代码来源:GetModelCmd.java


注:本文中的org.activiti.engine.impl.persistence.entity.ModelEntity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。