项目说明
该项目综合参考了:chenhai201 和 secsea
在进行下面的项目实践时,请先生成一个spring boot项目,并配置swagger2,开发工具建议使用IDEA。为了方便正文的描述,下面先给出项目的整体目录结构。
项目已经上传到github,需要可以自行下载
Activitig下载
首先从github上下载Activiti的源码,命令如下
git clone /Activiti/
git checkout 5.23.0-release
项目依赖
在项目中加上对activiti的依赖,整体项目pom如下所示
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="/POM/4.0.0" xmlns:xsi="http:///2001/XMLSchema-instance"
xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId></groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId></groupId>
<artifactId>activitidemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>activitidemo</name>
<description>Demo project for Spring Boot Activiti</description>
<properties>
<>UTF-8</>
<>UTF-8</>
<>1.8</>
<>5.22.0</>
<>2.6.1</>
</properties>
<dependencies>
<dependency>
<groupId></groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId></groupId>-->
<!--<artifactId>spring-cloud-starter-eureka</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId></groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-spring-boot-starter-basic</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-spring-boot-starter-actuator</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-rest</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>batik-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>batik-css</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>batik-svg-dom</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>batik-svggen</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-explorer</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-diagram-rest</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-simple-workflow</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>activiti-spring</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<!--<version>5.1.19</version>-->
<!--<version>8.0.11</version>-->
<scope>runtime</scope>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- swagger -->
<dependency>
<groupId></groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${}</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>jjwt</artifactId>
<version>0.7.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId></groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId></groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
整合编辑器代码
1)在包下建立包,然后在下载的Activiti源码中,找到目录modules\activiti-webapp-explorer2\src\main\java\org\activiti\explorer\servlet,然后复制、、到上面建立的包下,如下所示
2)从目录modules\activiti-webapp-explorer2中复制src\main\resources路径下的文件到本地项目的resources目录下
3)从目录modules\activiti-webapp-explorer2中复制src\main\webapp路径下的文件diagram-viewer和editor-app目录,以及文件
4)从目录modules\activiti-webapp-explorer2中复制src\main\java\org\activiti\reset\editor路径下的文件main和model到controller下的editor包
如下所示:
修改及扩展代码
1)找到和中的、、,统一在类上加
@RequestMapping(value = "/service")
2)在Spring boot的启动类ActivitidemoApplication,加上如下注解【ComponentScan里面的第二个包记得换成自己的包】
@ComponentScan({"", ""})
@EnableAutoConfiguration(exclude = {
,
,
})
并在启动类中加上Bean,如下
@Bean
public JsonpCallbackFilter filter(){
return new JsonpCallbackFilter();
}
3)修改resource/static/editor-app下的为
= {
'contextRoot' : '/service',
};
4)在constant包下,添加两个辅助类和
package ;
import ;
/**
* 分页类
*/
public class Pagination<T> {
public static int DEFAULT_PAGENUMBER = 1;
public static int DEFAULT_PAGESIZE = 10;
private List<T> rows = null; //当前返回的记录列表
private int rowTotal = 0; //总记录数
private int pageTotal = 0; //总页数
protected int pageNumber = DEFAULT_PAGENUMBER; //页码
protected int pageSize = DEFAULT_PAGESIZE; //每页记录数
public Pagination() {
this(DEFAULT_PAGENUMBER, DEFAULT_PAGESIZE);
}
public Pagination(int pageNumber, int pageSize) {
setPageNumber(pageNumber);//pageNumber从1开始不是从0开始
setPageSize(pageSize);
}
public static Pagination getInstance(int pageNumber, int pageSize) {
return new Pagination(pageNumber, pageSize);
}
public static Pagination getInstance2Top(int top) {
return new Pagination(1, top);
}
public List<T> getRows() {
return rows;
}
public void setRows(List<T> rows) {
= rows;
}
public int getRowTotal() {
return rowTotal;
}
public void setRowTotal(int rowTotal) {
= rowTotal;
}
public int getPageTotal() {
return pageTotal;
}
public void setPageTotal(int pageTotal) {
= pageTotal;
}
public int getPageNumber() {
return pageNumber;
}
public void setPageNumber(int pageNumber) {
= pageNumber;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
= pageSize;
}
public int getStart(){
return (getPageNumber()-1)*getPageSize();
}
public int getEnd(){
return getStart() + getPageSize();
}
}
package ;
/**
* 用于维护响应需要的常量信息
*/
public class ResponseConstantManager {
public static final String STATUS_SUCCESS = "success";
public static final String STATUS_FAIL = "fail";
}
在service包下,加入接口类,建立包,在下加入,如下
package ;
import ;
import ;
/** 流程模型管理的接口 */
public interface ModelService {
/** 新建一个模型 */
HashMap<String, Object> newModel(String modelName, String description, String key);
/** 获取所有模型 */
HashMap<String, Object> modelList();
/** 获取指定页码的模型 */
HashMap<String, Object> modelsPage(int pageSize, int pageNumber);
/** 删除指定模型 */
HashMap<String, Object> deleteModel(String modelId);
/** 部署模型 */
HashMap<String, Object> deployModel(String modelId);
/** 上传已有xml文件,并生成相应模型*/
HashMap<String, Object> uploadModel(MultipartFile modelFile);
}
package ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import .;
import ;
import ;
import ;
import org.;
import org.;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
import ;
@Service
public class ModelServiceImpl implements ModelService {
private static final Logger logger = ();
@Autowired
RepositoryService repositoryService;
@Autowired
ObjectMapper objectMapper;
@Override
public HashMap<String, Object> newModel(String modelName, String description, String key) {
HashMap<String, Object> result = new HashMap<>();
//初始化一个空模型
Model model = ();
//int revision = 1;
ObjectNode modelNode = ();
(ModelDataJsonConstants.MODEL_NAME, modelName);
(ModelDataJsonConstants.MODEL_DESCRIPTION, description);
// (ModelDataJsonConstants.MODEL_REVISION, revision);
(modelName);
(key);
(());
(model);
String id = ();
//完善ModelEditorSource
ObjectNode editorNode = ();
("id", "canvas");
("resourceId", "canvas");
ObjectNode stencilSetNode = ();
("namespace",
"/stencilset/bpmn2.0#");
("stencilset", stencilSetNode);
try {
(id, ().getBytes("utf-8"));
("status", ResponseConstantManager.STATUS_SUCCESS);
("modelId", id);
} catch (UnsupportedEncodingException e) {
("status", ResponseConstantManager.STATUS_FAIL);
("message", ());
}
return result;
}
@Override
public HashMap<String, Object> modelList() {
HashMap<String, Object> result = new HashMap<>();
List<Model> models = ().orderByCreateTime().asc().list();
("status", ResponseConstantManager.STATUS_SUCCESS);
("models", models);
return result;
}
@Override
public HashMap<String, Object> modelsPage(int pageNumber, int pageSize) {
HashMap<String, Object> result = new HashMap<>();
Pagination pagination = new Pagination(pageNumber, pageSize);
int totalCount = (int) ().count();
int totalPages = (int) (totalCount / pageSize);
(totalCount);
(totalPages);
List<Model> models = ()
.orderByCreateTime().asc().listPage((), ());
(models);
("status", ResponseConstantManager.STATUS_SUCCESS);
("modelsPage", pagination);
return result;
}
@Override
public HashMap<String, Object> deleteModel(String modelId) {
HashMap<String, Object> result = new HashMap<>();
(modelId);
("status", ResponseConstantManager.STATUS_SUCCESS);
return result;
}
@Override
public HashMap<String, Object> deployModel(String modelId) {
HashMap<String, Object> result = new HashMap<>();
//获取模型
Model modelData = (modelId);
byte[] bytes = (());
if (bytes == null) {
("status", ResponseConstantManager.STATUS_FAIL);
("message", "模型数据为空,请先设计流程并成功保存,再进行发布。");
return result;
}
try {
JsonNode modelNode = new ObjectMapper().readTree(bytes);
BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
if (().size() == 0) {
("status", ResponseConstantManager.STATUS_FAIL);
("message", "数据模型不符要求,请至少设计一条主线流程。");
}
//debug
byte[] bpmnBytes = new BpmnXMLConverter().convertToXML(model);
// (new String(bpmnBytes, "UTF-8"));
//发布流程
String processName = () + ".";
// DeploymentBuilder deploymentBuilder = ()
// .name(())
// .addString(processName, new String(bpmnBytes, "UTF-8"));
DeploymentBuilder deploymentBuilder = ()
.name(())
.addBpmnModel(processName, model);
Deployment deployment = ();
(());
(modelData);
} catch (Exception e) {
("status", ResponseConstantManager.STATUS_FAIL);
("message", ());
}
return result;
}
@Override
public HashMap<String, Object> uploadModel(MultipartFile modelFile) {
HashMap<String, Object> result = new HashMap<>();
InputStreamReader in = null;
try {
try {
boolean validFile = false;
String fileName = ();
if ((".") || (".bpmn")) {
validFile = true;
XMLInputFactory xif = ();
in = new InputStreamReader(new ByteArrayInputStream(()), "UTF-8");
XMLStreamReader xtr = (in);
BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
if (() == null || ().getId() == null) {
// (Messages.MODEL_IMPORT_FAILED,
// (Messages.MODEL_IMPORT_INVALID_BPMN_EXPLANATION));
("status", ResponseConstantManager.STATUS_FAIL);
("message", "数据模型无效,必须有一条主流程");
} else {
if (().isEmpty()) {
// (Messages.MODEL_IMPORT_INVALID_BPMNDI,
// (Messages.MODEL_IMPORT_INVALID_BPMNDI_EXPLANATION));
("status", ResponseConstantManager.STATUS_FAIL);
("message", "locationMap为空");
} else {
String processName = null;
if ((().getName())) {
processName = ().getName();
} else {
processName = ().getId();
}
Model modelData;
modelData = ();
ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
(ModelDataJsonConstants.MODEL_NAME, processName);
(ModelDataJsonConstants.MODEL_REVISION, 1);
(());
(processName);
(modelData);
BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
ObjectNode editorNode = (bpmnModel);
byte[] bpmnBytes = new BpmnXMLConverter().convertToXML(bpmnModel);
// (new String(bpmnBytes, "UTF-8"));
// (editorNode);
((), ().getBytes("utf-8"));
("status", ResponseConstantManager.STATUS_SUCCESS);
("modelId", ());
}
}
} else {
// (Messages.MODEL_IMPORT_INVALID_FILE,
// (Messages.MODEL_IMPORT_INVALID_FILE_EXPLANATION));
("status", ResponseConstantManager.STATUS_FAIL);
("message", "后缀名无效");
("err3");
}
} catch (Exception e) {
// String errorMsg = ().replace((""), "<br/>");
// (Messages.MODEL_IMPORT_FAILED, errorMsg);
("status", ResponseConstantManager.STATUS_FAIL);
("message", ());
}
} finally {
if (in != null) {
try {
();
} catch (IOException e) {
// ("Server-side error", ());
("status", ResponseConstantManager.STATUS_FAIL);
("message", ());
}
}
}
return result;
}
}
在包下,加入 ,代码如下:
package ;
import ;
import ;
import ;
import org.;
import org.;
import ;
import ;
import ;
import .*;
import ;
import ;
import ;
/**
* 流程模型Model操作相关
* Created by chenhai on 2017/5/23.
*/
@Api(description = "流程模型Model操作相关", tags = {"activitimodeler"})
@RestController
@RequestMapping("models")
public class ModelController {
private final static Logger logger = ();
@Autowired
private ModelService modelService;
/**
* 新建一个空模型
*
* @return
* @throws UnsupportedEncodingException
*/
@ApiOperation(value = "新建一个空模型")
@PostMapping(value = "newModel")
public ResponseEntity<?> newModel(@RequestParam(value = "modelName") String modelName,
@RequestParam(value = "description") String description,
@RequestParam(value = "key") String key) throws UnsupportedEncodingException {
HashMap<String, Object> responseBody = (modelName, description, key);
return ().body(responseBody);
}
/**
* 获取所有模型
*
* @return
*/
@ApiOperation(value = "获取所有模型")
@GetMapping("/getAll")
public ResponseEntity<?> modelList() {
HashMap<String, Object> responseBody = ();
return ().body(responseBody);
}
/**
* 删除模型
*
* @param modelId
* @return
*/
@ApiOperation(value = "删除模型")
@DeleteMapping("delete/{modelId}")
public ResponseEntity<?> deleteModel(@PathVariable("modelId") String modelId) {
HashMap<String, Object> responseBody = (modelId);
return ().body(responseBody);
}
/**
* 发布模型为流程定义
*
* @param modelId
* @return
*/
@ApiOperation(value = "发布模型为流程定义")
@PostMapping("deploy/{modelId}")
public ResponseEntity<?> deploy(@PathVariable("modelId") String modelId) {
HashMap<String, Object> responseBody = (modelId);
return ().body(responseBody);
}
@ApiOperation(value = "上传一个已有模型")
@PostMapping(value = "/uploadFile")
public ResponseEntity<?> deployUploadedFile(@RequestParam("modelFile") MultipartFile modelFile) {
HashMap<String, Object> responseBody = (modelFile);
return ().body(responseBody);
}
}
5)修改,如下
@RestController
@RequestMapping(value = "/service")
public class ModelSaveRestResource implements ModelDataJsonConstants {
protected static final Logger LOGGER = ();
@Autowired
private RepositoryService repositoryService;
@Autowired
private ObjectMapper objectMapper;
@RequestMapping(value="/model/{modelId}/save", method = )
@ResponseStatus(value = )
public void saveModel(@PathVariable String modelId, @RequestParam("name") String name,
@RequestParam("json_xml") String json_xml, @RequestParam("svg_xml") String svg_xml,
@RequestParam("description") String description) {//对接收参数进行了修改
try {
Model model = (modelId);
ObjectNode modelJson = (ObjectNode) (());
(MODEL_NAME, name);
(MODEL_DESCRIPTION, description);
(());
(name);
(model);
((), json_xml.getBytes("utf-8"));
InputStream svgStream = new ByteArrayInputStream(svg_xml.getBytes("utf-8"));
TranscoderInput input = new TranscoderInput(svgStream);
PNGTranscoder transcoder = new PNGTranscoder();
// Setup output
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(outStream);
// Do the transformation
(input, output);
final byte[] result = ();
((), result);
();
} catch (Exception e) {
("Error saving model", e);
throw new ActivitiException("Error saving model", e);
}
}
}
上面 操作之后整体目录结构如下所示:
6)进行数据库配置
先进行配置文件,内容如下
=activitidemo
=8082
-class-name=
=jdbc:mysql://XXXX:3306/activiti_demo?ccharacterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
=XXX
=XXX
=.MySQL5Dialect
.=update
-sql=true
#关闭activiti的自动部署机制
-process-definitions=false
从上述的项目github地址中,下载db下的sql文件,并运行生成activiti的数据库表
测试
运行Spring Boot项目,访问http://localhost:8082/,界面图如下所示:
点击newModel,填充参数,生成一个新的模型图,获取模型编号,如下
访问地址:http://localhost:8082/?modelId=297501
界面如下
随便编辑,然后保存
自定义编辑器访问地址
加入thymeleaf依赖
<dependency>
<groupId></groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
加入配置
#thymeleaf
=classpath:/templates
=.html
#=classpath:/templates
=LEGACYHTML5
#=false
在resources加入templates目录,同时加入文件
!doctype html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Activiti Editor</title>
<meta name="description" content="">
<meta name="viewport"
content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width">
<!-- Place and in the root directory -->
<link rel="Stylesheet" media="screen" href="editor-app/libs/ng-grid-2.0." type="text/css"/>
<link rel="stylesheet" href="editor-app/libs/bootstrap_3.1.1/css/"/>
<link rel="Stylesheet" media="screen" href="editor-app/editor/css/" type="text/css"/>
<link rel="stylesheet" href="editor-app/css/" type="text/css"/>
<link rel="stylesheet" href="editor-app/css/">
<link rel="stylesheet" href="editor-app/css/">
</head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse" role="navigation" >
<div class="navbar-header">
<a href="" ng-click="backToLanding()" class="navbar-brand"
title="{{'-TITLE' | translate}}"><span
class="sr-only">{{'-TITLE' | translate}}</span></a>
</div>
</div>
<!--[if lt IE 9]>
<div class="unsupported-browser">
<p class="alert error">You are using an unsupported browser. Please upgrade your browser in order to use the
editor.</p>
</div>
<![endif]-->
<div class="alert-wrapper" ng-cloak>
<div class="alert fadein {{}}" ng-show="" ng-click="dismissAlert()">
<i class="glyphicon"
ng-class="{'glyphicon-ok': == 'info', 'glyphicon-remove': == 'error'}"></i>
<span>{{}}</span>
<div class="pull-right" ng-show=" > 0">
<span class="badge">{{ + 1}}</span>
</div>
</div>
</div>
<div class="wrapper full clearfix" ng-style="{height: + 'px'}" ng-app="activitiModeler" ng-include="'editor-app/'">
</div>
<!--[if lt IE 9]>
<script src="editor-app/libs/es5-shim-15.3.4.5/"></script>
<script src="editor-app/libs/json3_3.2.6/lib/"></script>
<![endif]-->
<script src="editor-app/libs/jquery_1.11.0/"></script>
<script src="editor-app/libs/jquery-ui-1.10."></script>
<script src="editor-app/libs/angular_1.2.13/"></script>
<script src="editor-app/libs/angular_1.2.13/"></script>
<script src="editor-app/libs/bootstrap_3.1.1/js/"></script>
<script src="editor-app/libs/angular-resource_1.2.13/"></script>
<script src="editor-app/libs/angular-cookies_1.2.13/"></script>
<script src="editor-app/libs/angular-sanitize_1.2.13/"></script>
<script src="editor-app/libs/angular-route_1.2.13/"></script>
<script src="editor-app/libs/angular-translate_2.4.2/"></script>
<script src="editor-app/libs/angular-translate-storage-cookie/"></script>
<script src="editor-app/libs/angular-translate-loader-static-files/"></script>
<script src="editor-app/libs/angular-strap_2.0.5/"></script>
<script src="editor-app/libs/angular-strap_2.0.5/"></script>
<script src="editor-app/libs/momentjs_2.5.1/"></script>
<script src="editor-app/libs/-0.0." type="text/javascript"></script>
<script src="editor-app/libs/ng-grid-2.0." type="text/javascript"></script>
<script src="editor-app/libs/-1.0." type="text/javascript"></script>
<script src="editor-app/libs/mousetrap-1.4." type="text/javascript"></script>
<script src="editor-app/libs/" type="text/javascript"></script>
<script src="editor-app/libs/prototype-1.5." type="text/javascript"></script>
<script src="editor-app/libs/path_parser.js" type="text/javascript"></script>
<script src="editor-app/libs/angular-scroll_0.5.7/" type="text/javascript"></script>
<!-- Configuration -->
<script src="editor-app/?v=1"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/editor/i18n/translation_en_us.js" type="text/javascript"></script>
<script src="editor-app/editor/i18n/translation_signavio_en_us.js" type="text/javascript"></script>
<script src="editor-app/editor/" type="text/javascript"></script>
<script src="editor-app/"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
<script src="editor-app/configuration/" type="text/javascript"></script>
</body>
</html>
在下加入
package ;
import ;
import ;
import ;
import ;
import ;
//这里要使用Controller,因为RestController是返回json数据的
@Api(tags = "EditorController", description = "模型编辑器")
@Controller
public class EditorController {
/**
* 等同于访问:?modelId=300001,这个是静态资源直接访问
* @return
*/
@ApiOperation(value = "进入流程编辑器,需要接入模型参数,editor?modelId=XXX")
@GetMapping(value = "editor")
public String edtior() {
return "modeler";
}
}
访问http://localhost:8082/editor?modelId=297501