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


Java Model.getName方法代码示例

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


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

示例1: deploy

import org.activiti.engine.repository.Model; //导入方法依赖的package包/类
/**
 * 根据Model部署流程
 */
@RequestMapping(value = "deploy/{modelId}")
public String deploy(@PathVariable("modelId") String modelId, RedirectAttributes redirectAttributes) {
    try {
        Model modelData = repositoryService.getModel(modelId);
        ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
        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)).deploy();
        redirectAttributes.addFlashAttribute("message", "部署成功,部署ID=" + deployment.getId());
    } catch (Exception e) {
        logger.error("根据模型部署流程失败:modelId={}", modelId, e);
    }
    return "redirect:/workflow/model/list";
}
 
开发者ID:batizhao,项目名称:microservice,代码行数:22,代码来源:ModelController.java

示例2: deployModel

import org.activiti.engine.repository.Model; //导入方法依赖的package包/类
@PutMapping("{modelId}/deploy")
public ResponseMessage deployModel(@PathVariable String modelId) throws Exception {
    Model modelData = repositoryService.getModel(modelId);
    if (modelData == null) {
        throw new NotFoundException("模型不存在!");
    }
    ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
    BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
    byte[] bpmnBytes = new BpmnXMLConverter().convertToXML(model);
    String processName = modelData.getName() + ".bpmn20.xml";
    Deployment deployment = repositoryService.createDeployment()
            .name(modelData.getName())
            .addString(processName, new String(bpmnBytes, "utf8"))
            .deploy();
    return ResponseMessage.ok(deployment).include(Deployment.class, "id", "name", "new");
}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:17,代码来源:FlowableModelManagerController.java

示例3: deploy

import org.activiti.engine.repository.Model; //导入方法依赖的package包/类
/**
 * 根据Model部署流程
 */
@RequestMapping(value = "deploy/{modelId}")
public String deploy(@PathVariable("modelId") String modelId, RedirectAttributes redirectAttributes) {
    try {
        Model modelData = repositoryService.getModel(modelId);
        ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
        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)).deploy();
        redirectAttributes.addFlashAttribute("message", "部署成功,部署ID=" + deployment.getId());
    } catch (Exception e) {
        logger.error("根据模型部署流程失败:modelId={}", modelId, e);
    }
    return "redirect:/chapter20/model/list";
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:22,代码来源:ModelController.java

示例4: deploy

import org.activiti.engine.repository.Model; //导入方法依赖的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

示例5: deployProcess

import org.activiti.engine.repository.Model; //导入方法依赖的package包/类
/**
 * 将一个设计中的流程定义发布为运行时流程.
 * 
 * @param modelId
 *            流程模型Id.
 */
@RequestMapping(value = "/model/{modelId}/deploy", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public void deployProcess(@PathVariable String modelId, String category) {

	try {
		Model modelNode = repositoryService.getModel(modelId);

		byte[] extra = repositoryService.getModelEditorSourceExtra(modelId);
		ByteArrayInputStream extraSteam = new ByteArrayInputStream(extra);

		byte[] modelEditorSource = repositoryService.getModelEditorSource(modelId);
		JsonNode jsonNode = new ObjectMapper().readTree(modelEditorSource);
		BpmnModel bpmnModel = new BpmnJsonExConverter().convertToBpmnModel(jsonNode);

		String processName = modelNode.getName() + ".bpmn20.xml";
		String pngName = modelNode.getName() + ".png";

		repositoryService.createDeployment().name(modelNode.getName()).category(category)
				.tenantId(modelNode.getTenantId()).addInputStream(pngName, extraSteam)
				.addBpmnModel(processName, bpmnModel).deploy();

	} catch (Exception e) {
		logger.error("Error Deploy Model", e);
		throw new ActivitiException("Error Deploy Model", e);
	}
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:33,代码来源:ModelRestResource.java

示例6: BpmModelVo

import org.activiti.engine.repository.Model; //导入方法依赖的package包/类
public BpmModelVo(Model o) {
	this.id = o.getId();
	this.category = o.getCategory();
	this.name = o.getName();
	this.key = o.getKey();
	this.version = o.getVersion();
	this.updateTime = o.getLastUpdateTime();
	this.deploymentId = o.getDeploymentId();
	this.resourceName = "";
	this.diagramResourceName = "";
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:12,代码来源:BpmModelVo.java


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