`
m17185082163
  • 浏览: 29951 次
文章分类
社区版块
存档分类
最新评论

flowable流程引擎通过模型ID部署流程

 
阅读更多
	/**部署流程定义
	 */
	@RequestMapping(value="/deployment")
	@RequiresPermissions("fhmodel:edit")
	@ResponseBody
	public Object deployment(){
		Map<String,Object> map = new HashMap<String,Object>();
		String result = "success";
		PageData pd = new PageData();
		pd = this.getPageData();
		try{
			deploymentProcessDefinitionFromUIModelId(pd.getString("modelId"));//部署流程定义
		}catch (Exception e){
			result = "error";
		}finally{
			map.put("result", result);
		}
		return map;
	}
 
/**部署流程定义(from fhadmin.cn)
	 * @param modelId 模型ID
	 * @return 部署ID
	 */ 
	protected String deploymentProcessDefinitionFromUIModelId(String modelId)throws Exception{
		Model model = modelService.getModel(modelId);
		BpmnModel bpmnModel = modelService.getBpmnModel(model);
		Deployment deployment = repositoryService.createDeployment()
		.name(model.getName())
		.addBpmnModel(model.getKey() + ".bpmn", bpmnModel).deploy();
        return deployment.getId();	//部署ID
	}
 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics