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


Java ProcessDefinition.getResourceName方法代码示例

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


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

示例1: viewXml

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
/**
 * 显示流程定义的xml.
 */
@RequestMapping("console-viewXml")
public void viewXml(
        @RequestParam("processDefinitionId") String processDefinitionId,
        HttpServletResponse response) throws Exception {
    RepositoryService repositoryService = processEngine
            .getRepositoryService();
    ProcessDefinition processDefinition = repositoryService
            .createProcessDefinitionQuery()
            .processDefinitionId(processDefinitionId).singleResult();
    String resourceName = processDefinition.getResourceName();
    InputStream resourceAsStream = repositoryService.getResourceAsStream(
            processDefinition.getDeploymentId(), resourceName);
    response.setContentType("text/xml;charset=UTF-8");
    IOUtils.copy(resourceAsStream, response.getOutputStream());
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:19,代码来源:ConsoleController.java

示例2: loadByDeployment

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
/**
 * 读取资源,通过部署ID
 *
 * @param processDefinitionId 流程定义
 * @param resourceType        资源类型(xml|image)
 * @throws Exception
 */
@RequestMapping(value = "/resource/read")
public void loadByDeployment(@RequestParam("processDefinitionId") String processDefinitionId,
                             @RequestParam("resourceType") String resourceType,
                             HttpServletResponse response) throws Exception {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
    String resourceName = "";
    if (resourceType.equals("image")) {
        resourceName = processDefinition.getDiagramResourceName();
    } else if (resourceType.equals("xml")) {
        resourceName = processDefinition.getResourceName();
    }
    InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName);
    byte[] b = new byte[1024];
    int len = -1;
    while ((len = resourceAsStream.read(b, 0, 1024)) != -1) {
        response.getOutputStream().write(b, 0, len);
    }
}
 
开发者ID:batizhao,项目名称:microservice,代码行数:26,代码来源:ActivitiController.java

示例3: loadByProcessInstance

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
/**
 * 读取资源,通过流程ID
 *
 * @param resourceType      资源类型(xml|image)
 * @param processInstanceId 流程实例ID
 * @param response
 * @throws Exception
 */
@RequestMapping(value = "/resource/process-instance")
public void loadByProcessInstance(@RequestParam("type") String resourceType, @RequestParam("pid") String processInstanceId, HttpServletResponse response)
        throws Exception {
    InputStream resourceAsStream = null;
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processInstance.getProcessDefinitionId())
            .singleResult();

    String resourceName = "";
    if (resourceType.equals("image")) {
        resourceName = processDefinition.getDiagramResourceName();
    } else if (resourceType.equals("xml")) {
        resourceName = processDefinition.getResourceName();
    }
    resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName);
    byte[] b = new byte[1024];
    int len = -1;
    while ((len = resourceAsStream.read(b, 0, 1024)) != -1) {
        response.getOutputStream().write(b, 0, len);
    }
}
 
开发者ID:batizhao,项目名称:microservice,代码行数:30,代码来源:ActivitiController.java

示例4: SimpleProcessDefinition

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
public SimpleProcessDefinition(ProcessDefinition definition) {
    id = definition.getId();
    category = definition.getCategory();
    name = definition.getName();
    key = definition.getKey();
    description = definition.getDescription();
    version = definition.getVersion();

    resourceName = definition.getResourceName();
    deploymentId = definition.getDeploymentId();
    diagramResourceName = definition.getResourceName();

    suspended = definition.isSuspended();

    hasGraphicalNotation = definition.hasGraphicalNotation();
    hasStartFormKey = definition.hasStartFormKey();
    tenantId = definition.getTenantId();

}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:20,代码来源:SimpleProcessDefinition.java

示例5: resourceRead

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
/**
 * 读取资源,通过部署ID
 * @param processDefinitionId  流程定义ID
 * @param processInstanceId 流程实例ID
 * @param resourceType 资源类型(xml|image)
 */
public InputStream resourceRead(String procDefId, String proInsId, String resType) throws Exception {
	
	if (StringUtils.isBlank(procDefId)){
		ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(proInsId).singleResult();
		procDefId = processInstance.getProcessDefinitionId();
	}
	ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
	
	String resourceName = "";
	if (resType.equals("image")) {
		resourceName = processDefinition.getDiagramResourceName();
	} else if (resType.equals("xml")) {
		resourceName = processDefinition.getResourceName();
	}
	
	InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName);
	return resourceAsStream;
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:25,代码来源:ActProcessService.java

示例6: downloadFlow

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
@RequestMapping(value = "/processdef/export/{type}/{id}", method = RequestMethod.GET)
public void downloadFlow(@PathVariable("type") String type, @PathVariable("id") String id, HttpServletResponse response) {
    try {
        ProcessDefinition processDefinition = repositoryService.getProcessDefinition(id);
        String resourceName = "";
        if (type.equals("image")) {
            resourceName = processDefinition.getDiagramResourceName();
        } else if (type.equals("xml")) {
            resourceName = processDefinition.getResourceName();
        }
        InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName);
        IOUtils.copy(resourceAsStream, response.getOutputStream());
        response.setHeader("Content-Disposition", "attachment; filename=" + resourceName);
        response.flushBuffer();
    } catch (Exception e) {
        LOGGER.error("导出流程定义的" + type + "文件失败:processDefId={}", id, e);
    }
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:19,代码来源:ProcessDefController.java

示例7: readXml

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
public String readXml(String processDefinitionId) throws Exception {
    RepositoryService repositoryService = processEngine
            .getRepositoryService();
    ProcessDefinition processDefinition = repositoryService
            .createProcessDefinitionQuery()
            .processDefinitionId(processDefinitionId).singleResult();
    String resourceName = processDefinition.getResourceName();
    InputStream resourceAsStream = repositoryService.getResourceAsStream(
            processDefinition.getDeploymentId(), resourceName);

    return IOUtils.toString(resourceAsStream, "UTF-8");
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:13,代码来源:BpmProcessController.java

示例8: processDefinitionQueryTest

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
@Test
    public void processDefinitionQueryTest() {
        List<ProcessDefinition> processDefinitionList = repositoryService.createProcessDefinitionQuery()
                .list();
        for (ProcessDefinition processDefinition : processDefinitionList) {
            String tmp = "\r\n" +
                    "#=======================================================================================================================#\r\n" +
                    "# Spring MVC Context 容器初始化完成之后的处理:\r\n" +
                    "#\t getId " + processDefinition.getId() + "\r\n" +
                    "#\t getCategory " + processDefinition.getCategory() + "\r\n" +
                    "#\t getName " + processDefinition.getName() + "\r\n" +
                    "#\t getKey " + processDefinition.getKey() + "\r\n" +
                    "#\t getDescription " + processDefinition.getDescription() + "\r\n" +
                    "#\t getVersion " + processDefinition.getVersion() + "\r\n" +
                    "#\t getResourceName " + processDefinition.getResourceName() + "\r\n" +
                    "#\t getDeploymentId " + processDefinition.getDeploymentId() + "\r\n" +
                    "#\t getDiagramResourceName " + processDefinition.getDiagramResourceName() + "\r\n" +
                    "#\t hasStartFormKey " + processDefinition.hasStartFormKey() + "\r\n" +
                    "#\t hasGraphicalNotation " + processDefinition.hasGraphicalNotation() + "\r\n" +
                    "#\t isSuspended " + processDefinition.isSuspended() + "\r\n" +
                    "#\t getTenantId " + processDefinition.getTenantId() + "\r\n" +
                    "#=======================================================================================================================#\r\n";
            logger.info(tmp);
        }

//        org.activiti.rest.service.application.ActivitiRestServicesApplication
//        org.activiti.rest.service.api.RestActionRequest
    }
 
开发者ID:Lzw2016,项目名称:study,代码行数:29,代码来源:Test02.java

示例9: BpmModelVo

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

示例10: ProcessDefinitionVo

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
public ProcessDefinitionVo(ProcessDefinition o) {
	this.id = o.getId();
	this.category = o.getCategory();
	this.name = o.getName();
	this.key = o.getKey();
	this.description = o.getDescription();
	this.version = o.getVersion();
	this.resourceName = o.getResourceName();
	this.deploymentId = o.getDeploymentId();
	this.diagramResourceName = o.getDiagramResourceName();
	this.hasStartFormKey = o.hasStartFormKey();
	this.hasGraphicalNotation = o.hasGraphicalNotation();
	this.suspended = o.isSuspended();
	this.tenantId = o.getTenantId();
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:16,代码来源:ProcessDefinitionVo.java

示例11: generateResource

import org.activiti.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
/**
 * 生成资源文件,并返回文件路径 给开发者看的
 */
@RequestMapping(value = "/processdef/generate/{type}/{pdId}", method = RequestMethod.POST)
@ResponseBody
public Result generateResource(@PathVariable("type") String type, @PathVariable("pdId") String pdId, HttpServletRequest request) {
    try {
        String dirPath = request.getRealPath("/");
        ProcessDefinition processDefinition = repositoryService.getProcessDefinition(pdId);
        String resourceName = "";
        if (type.equals("image")) {
            resourceName = processDefinition.getDiagramResourceName();
        } else if (type.equals("xml")) {
            resourceName = processDefinition.getResourceName();
        }
        InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName);
        String realPath = dirPath + File.separator + DIR_PATH + File.separator + resourceName;
        realPath=realPath.replaceAll("\\\\", "/");
        File file = new File(realPath);
        if (file.exists()) {
            file.delete();
        }
        FileUtil.copyInputStreamToFile(resourceAsStream, file);
        String realName = (DIR_PATH + File.separator + resourceName).replaceAll("\\\\", "/");
        return new Result(true, realName, "成功生成png");
    } catch (Exception e) {
        LOGGER.error("生成资源文件异常,pdId={}", pdId, e);
        return new Result(false);
    }
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:31,代码来源:ProcessDefController.java


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