当前位置:网站首页>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">
两种方式都亲测可以,个人推荐第一种,简单命令,一行代码搞定
边栏推荐
- 模拟卷Leetcode【普通】1109. 航班预订统计
- Application of Lie group in gtsam
- Pat (Grade B) 2022 summer exam
- On weak network test of special test
- 黑猫带你学UFS协议第8篇:UFS初始化详解(Boot Operation)
- Buuctf-[[gwctf 2019] I have a database (xiaoyute detailed explanation)
- MFC关于长字符串unsigned char与CString转换及显示问题
- Simulation volume leetcode [general] 1219 Golden Miner
- Digital triangle model acwing 1015 Picking flowers
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
猜你喜欢
全链路压测:构建三大模型
Database - current read and snapshot read
F - True Liars (种类并查集+DP)
Database isolation level
Idea new UI usage
What are the test sites for tunnel engineering?
Caused by:org. gradle. api. internal. plugins . PluginApplicationException: Failed to apply plugin
【Tera Term】黑猫带你学TTL脚本——嵌入式开发中串口自动化神技能
LeetCode 731. 我的日程安排表 II
keil MDK中删除添加到watch1中的变量
随机推荐
Thoughts on data security (Reprint)
JWT-JSON WEB TOKEN
win10无法操作(删除、剪切)文件
Customize the gateway filter factory on the specified route
LeetCode 732. 我的日程安排表 III
10M25DCF484C8G(FPGA) AMY-6M-0002 BGA GPS模块
Understanding of processes and threads
G - Supermarket
RestTemplate、Feign实现Token传递
模拟卷Leetcode【普通】1405. 最长快乐字符串
Summary of anomaly detection methods
调用链监控Zipkin、sleuth搭建与整合
数据库-当前读与快照读
Function of activation function
Overview of three core areas of Mathematics: geometry
Simulation volume leetcode [general] 1296 Divide an array into a set of consecutive numbers
properties文件
黑猫带你学UFS协议第18篇:UFS如何配置逻辑单元(LU Management)
联合索引的左匹配原则
全程实现单点登录功能和请求被取消报错“cancelToken“ of undefined的解决方法