当前位置:网站首页>org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘outgoing‘ 开头的无效内容
org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘outgoing‘ 开头的无效内容
2022-07-06 06:19:00 【不允许摆烂】
前言
今天实例化部署Activiti流程的时候保存了
错误信息如下
org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘outgoing’ 开头的无效内容。应以 ‘{“http://www.omg.org/spec/BPMN/20100524/MODEL”:documentation, “http://www.omg.org/spec/BPMN/20100524/MODEL”:extensionElements, “http://www.omg.org/spec/BPMN/20100524/MODEL”:auditing, “http://www.omg.org/spec/BPMN/20100524/MODEL”:monitoring, “http://www.omg.org/spec/BPMN/20100524/MODEL”:categoryValueRef, “http://www.omg.org/spec/BPMN/20100524/MODEL”:incoming, “http://www.omg.org/spec/BPMN/20100524/MODEL”:outgoing, “http://www.omg.org/spec/BPMN/20100524/MODEL”:property, “http://www.omg.org/spec/BPMN/20100524/MODEL”:dataOutput, “http://www.omg.org/spec/BPMN/20100524/MODEL”:dataOutputAssociation, “http://www.omg.org/spec/BPMN/20100524/MODEL”:outputSet, “http://www.omg.org/spec/BPMN/20100524/MODEL”:eventDefinition, “http://www.omg.org/spec/BPMN/20100524/MODEL”:eventDefinitionRef}’ 之一开头。

看了下网上的解决方案,发现有以下两种解决方案
解决方案1
在部署流程时调用disableSchemaValidation()方法,禁止校验文件就可以了

直接把全部代码贴过来了
package com.wyh.test;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.junit.Test;
/** * @program: Activiti01 * @description: 测试流程部署 * @author: 魏一鹤 * @createDate: 2022-07-04 23:27 **/
public class ActivitiDemo {
//测试流程部署
@Test
public void testDeployment(){
// 1.创建ProcessEngine
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// 2.使用ProcessEngine得到操作数据库的服务(RepositoryService)
RepositoryService repositoryService = processEngine.getRepositoryService();
// 3.使用RepositoryService进行流程部署,定义一个流程的名字,把bpmn文件和png文件部署到数据库里
Deployment deploy = repositoryService.createDeployment()
.name("出差申请流程")//流程名称
.addClasspathResource("bpmn/evection.bpmn") //资源文件 bpmn配置文件
.addClasspathResource("bpmn/evection.png") //资源文件 png流程图
.disableSchemaValidation()//禁止校验文件
.deploy();
// 4.输出部署信息
System.out.println("流程部署的ID:"+deploy.getId());
System.out.println("流程部署的名字:"+deploy.getName());
}
}
解决方案2
找到要部署的bpmn文件,用notepad++打开,或者转为xml文件,把标签中的xmlns=" "删掉,这个可能是插件和Idea不兼容的问题导致
<!--把process标签中的 xmlns=""删掉即可,这个可能是插件和Idea不兼容的问题导致-->
<process xmlns="" id="myProcess_2" isClosed="false" isExecutable="true" name="报销流程" processType="None">
两种方式都亲测可以,个人推荐第一种,简单命令,一行代码搞定
边栏推荐
- Digital triangle model acwing 1015 Picking flowers
- 模拟卷Leetcode【普通】1405. 最长快乐字符串
- GTSAM中ISAM2和IncrementalFixedLagSmoother说明
- 【无App Push 通用测试方案
- Linux regularly backs up MySQL database
- Left matching principle of joint index
- Online and offline problems
- Aike AI frontier promotion (2.13)
- [wechat applet] build a development tool environment
- Properties file
猜你喜欢

Pat (Grade B) 2022 summer exam

二维码的前世今生 与 六大测试点梳理
![[wechat applet] build a development tool environment](/img/f6/51f97b1c927337b34c5b3a4207abb4.png)
[wechat applet] build a development tool environment

Summary of anomaly detection methods

调用链监控Zipkin、sleuth搭建与整合

自定义指定路由上的Gateway过滤器工厂

Manage configuration using Nacos

Application du Groupe Li dans gtsam

On weak network test of special test
![[API interface tool] Introduction to postman interface](/img/03/c1541fca65dd726fd4bdc8793b605e.png)
[API interface tool] Introduction to postman interface
随机推荐
Testing and debugging of multithreaded applications
[no app push general test plan
全链路压测:构建三大模型
异常检测方法总结
The latest 2022 review of "graph classification research"
联合索引的左匹配原则
进程和线程的理解
Coordinatorlayout+nestedscrollview+recyclerview pull up the bottom display is incomplete
曼哈顿距离与曼哈顿矩形-打印回字型矩阵
Still worrying about how to write web automation test cases? Senior test engineers teach you selenium test case writing hand in hand
【C语言】字符串左旋
properties文件
【Postman】测试(Tests)脚本编写和断言详解
【微信小程序】搭建开发工具环境
Simulation volume leetcode [general] 1218 Longest definite difference subsequence
MySQL之基础知识
Detailed explanation of P problem, NP problem, NPC problem and NP hard problem
Basic knowledge of error
Simulation volume leetcode [general] 1143 Longest common subsequence
MySQL之数据类型