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


Java RepositoryService.getModel方法代码示例

本文整理汇总了Java中org.activiti.engine.RepositoryService.getModel方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryService.getModel方法的具体用法?Java RepositoryService.getModel怎么用?Java RepositoryService.getModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.RepositoryService的用法示例。


在下文中一共展示了RepositoryService.getModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: modelSave

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@RequestMapping("model/{modelId}/save")
@ResponseBody
public String modelSave(@PathVariable("modelId") String modelId,
        @RequestParam("description") String description,
        @RequestParam("json_xml") String jsonXml,
        @RequestParam("name") String name,
        @RequestParam("svg_xml") String svgXml) throws Exception {
    RepositoryService repositoryService = processEngine
            .getRepositoryService();
    Model model = repositoryService.getModel(modelId);
    model.setName(name);
    // model.setMetaInfo(root.toString());
    logger.info("jsonXml : {}", jsonXml);
    repositoryService.saveModel(model);
    repositoryService.addModelEditorSource(model.getId(),
            jsonXml.getBytes("utf-8"));

    return "{}";
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:20,代码来源:ModelerController.java

示例2: open

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@RequestMapping("modeler-open")
public String open(@RequestParam(value = "id", required = false) String id)
        throws Exception {
    RepositoryService repositoryService = processEngine
            .getRepositoryService();
    Model model = null;

    if (!StringUtils.isEmpty(id)) {
        model = repositoryService.getModel(id);
    }

    if (model == null) {
        model = repositoryService.newModel();
        repositoryService.saveModel(model);
        id = model.getId();
    }

    // return "redirect:/cdn/modeler/editor.html?id=" + id;
    //return "redirect:/widgets/modeler/modeler.html?modelId=" + id;
    return "redirect:/cdn/modeler/modeler.html?modelId=" + id;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:22,代码来源:ModelerController.java

示例3: deploy

import org.activiti.engine.RepositoryService; //导入方法依赖的package包/类
@RequestMapping("modeler-deploy")
public String deploy(@RequestParam("id") String id,
        org.springframework.ui.Model theModel) throws Exception {
    String tenantId = tenantHolder.getTenantId();
    RepositoryService repositoryService = processEngine
            .getRepositoryService();
    Model modelData = repositoryService.getModel(id);
    byte[] bytes = repositoryService
            .getModelEditorSource(modelData.getId());

    if (bytes == null) {
        theModel.addAttribute("message", "模型数据为空,请先设计流程并成功保存,再进行发布。");

        return "modeler/failure";
    }

    JsonNode modelNode = (JsonNode) new ObjectMapper().readTree(bytes);
    byte[] bpmnBytes = null;

    BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
    bpmnBytes = new BpmnXMLConverter().convertToXML(model);

    String processName = modelData.getName() + ".bpmn20.xml";
    Deployment deployment = repositoryService.createDeployment()
            .name(modelData.getName())
            .addString(processName, new String(bpmnBytes, "UTF-8"))
            .tenantId(tenantId).deploy();
    modelData.setDeploymentId(deployment.getId());
    repositoryService.saveModel(modelData);

    List<ProcessDefinition> processDefinitions = repositoryService
            .createProcessDefinitionQuery()
            .deploymentId(deployment.getId()).list();

    for (ProcessDefinition processDefinition : processDefinitions) {
        processEngine.getManagementService().executeCommand(
                new SyncProcessCmd(processDefinition.getId()));
    }

    return "redirect:/modeler/modeler-list.do";
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:42,代码来源:ModelerController.java


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