模型管理页面——》添加模型按钮
modelList.html
/**
* 跳转到-新增模型
*/
@GetMapping("/add")
public String addModel() {
return prefix + "/addModel";
}
addModel.html
/**
* 创建模型
*/
@RequiresPermissions("activiti:model:add")
@Log(title = "创建模型", businessType = BusinessType.INSERT)
@RequestMapping("/createModle")
@ResponseBody
public AjaxResult createModle(HttpServletRequest request) {
Map paramMap = WebUtil.paramsToMap(request.getParameterMap());
actModelService.createModle(paramMap);
return AjaxResult.success();
}
ActModelServiceImpl
ActModelController
请求stencilset.json文件
getStencilset
打开modeler.html页面
方法名:edit
目标名称空间
http://www.activiti.org/processdef
idea打印
modelId:
192529
name:
领用申请
description:
资产领用申请测试
json_xml:
{"resourceId":"192529","properties":{"process_id":"process","name":"","documentation":"","process_author":"sys","process_version":"","process_namespace":"http://www.activiti.org/processdef","executionlisteners":"","eventlisteners":"","signaldefinitions":"","messagedefinitions":""},"stencil":{"id":"BPMNDiagram"},"childShapes":[{"resourceId":"sid-0506450A-57F9-423E-8D1E-D963B3755317","properties":{"overrideid":"start","name":"领用申请开始","documentation":"","executionlisteners":"","initiator":"apply","formkeydefinition":"/zc/lysq/form","formproperties":""},"stencil":{"id":"StartNoneEvent"},"childShapes":[],"outgoing":[{"resourceId":"sid-488A788B-13F4-41AD-9B67-46FE5BD5A4F9"}],"bounds":{"lowerRight":{"x":268.19997791647944,"y":161.99999780952933},"upperLeft":{"x":238.19997791647944,"y":131.99999780952933}},"dockers":[]},{"resourceId":"sid-1102D37A-EBB6-4D62-8FFD-3A5F0B8348D7","properties":{"overrideid":"systemAudit","name":"领导审核","documentation":"","asynchronousdefinition":"false","exclusivedefinition":true,"executionlisteners":"","multiinstance_type":"None","multiinstance_cardinality":"","multiinstance_collection":"","multiinstance_variable":"","multiinstance_condition":"","isforcompensation":"false","usertaskassignment":{"assignment":{"assignee":"system"}},"formkeydefinition":"","duedatedefinition":"","prioritydefinition":"","formproperties":"","tasklisteners":""},"stencil":{"id":"UserTask"},"childShapes":[],"outgoing":[{"resourceId":"sid-896A2EC4-6046-41C1-8250-54142F2C973D"}],"bounds":{"lowerRight":{"x":594.9999926239253,"y":186.99999621510514},"upperLeft":{"x":494.9999926239253,"y":106.99999621510514}},"dockers":[]},{"resourceId":"sid-171BD6C1-C4A0-4111-9A35-D790A1478DA2","properties":{"overrideid":"end","name":"领用申请结束","documentation":"","executionlisteners":""},"stencil":{"id":"EndNoneEvent"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":827.1999576628219,"y":160.99999582767495},"upperLeft":{"x":799.1999576628219,"y":132.99999582767495}},"dockers":[]},{"resourceId":"sid-896A2EC4-6046-41C1-8250-54142F2C973D","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-171BD6C1-C4A0-4111-9A35-D790A1478DA2"}],"bounds":{"lowerRight":{"x":798.5804281881906,"y":146.99999614253082},"upperLeft":{"x":595.2398299552852,"y":146.9999958487937}},"dockers":[{"x":50,"y":40},{"x":14,"y":14}],"target":{"resourceId":"sid-171BD6C1-C4A0-4111-9A35-D790A1478DA2"}},{"resourceId":"sid-488A788B-13F4-41AD-9B67-46FE5BD5A4F9","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-1102D37A-EBB6-4D62-8FFD-3A5F0B8348D7"}],"bounds":{"lowerRight":{"x":494.986708903534,"y":146.9999977230984},"upperLeft":{"x":269.017947413342,"y":146.99999648838266}},"dockers":[{"x":15,"y":15},{"x":50,"y":40}],"target":{"resourceId":"sid-1102D37A-EBB6-4D62-8FFD-3A5F0B8348D7"}}],"bounds":{"lowerRight":{"x":1200,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"stencilsets/bpmn2.0/bpmn2.0.json","namespace":"http://b3mn.org/stencilset/bpmn2.0#"},"ssextensions":[]}
svg_xml:
ActModelController
@Log(title = "部署模型", businessType = BusinessType.UPDATE)
@RequiresPermissions("activiti:model:deploy")
@RequestMapping("/deployModel")
@ResponseBody
public AjaxResult deployModel(HttpServletRequest request) {
Map paramMap = WebUtil.paramsToMap(request.getParameterMap());
System.out.println(paramMap);
// 开始部署的service
return actModelService.deployModel(paramMap);
}
ActModelServiceImpl
方法名 :deployModel
// 下面这行在act_re_model中查
org.activiti.engine.repository.Model modelData = repositoryService.getModel(paramMap.get("id").toString());
ActProcessController
// 流程列表中转为模型(部署之后)
@RequiresPermissions("activiti:process:model")
@GetMapping(value = "/convertToModel/{processId}")
@ResponseBody
public AjaxResult convertToModel(@PathVariable("processId") String processId) {
System.out.println(processId);
try {
// 开始转为模型的service
Model model = actProcessService.convertToModel(processId);
return success(StringUtils.format("转换模型成功,模型编号[{}]", model.getId()));
} catch (Exception e) {
return error("转换模型失败" + e.getMessage());
}
}
ActProcessServiceImpl
方法名 :convertToModel