@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;
}
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();
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結