Activiti 5 提示:Default sequenceflow has a condition, which is not allowed
Posted 在奋斗的大道
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Activiti 5 提示:Default sequenceflow has a condition, which is not allowed相关的知识,希望对你有一定的参考价值。
今天重拾Activiti 5 + Spring Boot 流程引擎管理,启动一个简单的请假流程实例,在控制台输出如下错误信息:
org.activiti.engine.ActivitiException: Errors while parsing:
[Validation set: 'activiti-executable-process' | Problem: 'activiti-exclusive-gateway-condition-on-seq-flow'] : Default sequenceflow has a condition, which is not allowed - [Extra info : processDefinitionId = 未定义 | id = sid-522696AE-6D29-4D93-9B25-AAC7664690E9 | ] ( line: 7, column: 85)
at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:216) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:136) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:58) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:106) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:37) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) ~[activiti-spring-5.22.0.jar:5.22.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) ~[activiti-spring-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:79) ~[activiti-engine-5.22.0.jar:5.22.0]
at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:156) ~[activiti-engine-5.22.0.jar:5.22.0]
at com.zzg.service.impl.ActivitiServiceImpl.createLeaveWorkFlow(ActivitiServiceImpl.java:51) ~[classes/:na]
at com.zzg.controller.LeaveProcessController.create(LeaveProcessController.java:31) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) ~[druid-1.1.10.jar:1.1.10]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.27.jar:9.0.27]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.27.jar:9.0.27]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
错误含义:指定的单一网关(id=sid-522696AE-6D29-4D93-9B25-AAC7664690E9) 跳线设置不需要设置条件
查看请假流程的xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
<process id="未定义" isExecutable="true">
<startEvent id="sid-26ADDD10-82A2-4A7E-8314-35EE643337D3"></startEvent>
<userTask id="user1" name="发起请假流程"></userTask>
<userTask id="manager1" name="部门经理审批" activiti:assignee="$manager"></userTask>
<exclusiveGateway id="sid-522696AE-6D29-4D93-9B25-AAC7664690E9" default="flow2"></exclusiveGateway>
<endEvent id="sid-8AB4379F-AFD9-460D-A87E-A0312A1E9FEB"></endEvent>
<sequenceFlow id="flow4" sourceRef="user1" targetRef="manager1"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="sid-26ADDD10-82A2-4A7E-8314-35EE643337D3" targetRef="user1"></sequenceFlow>
<sequenceFlow id="flow1" name="同意" sourceRef="sid-522696AE-6D29-4D93-9B25-AAC7664690E9" targetRef="sid-8AB4379F-AFD9-460D-A87E-A0312A1E9FEB">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[$accept =='同意']]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow3" sourceRef="manager1" targetRef="sid-522696AE-6D29-4D93-9B25-AAC7664690E9"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="sid-522696AE-6D29-4D93-9B25-AAC7664690E9" targetRef="user1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[$accept=='驳回']]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_未定义">
<bpmndi:BPMNPlane bpmnElement="未定义" id="BPMNPlane_未定义">
<bpmndi:BPMNShape bpmnElement="sid-26ADDD10-82A2-4A7E-8314-35EE643337D3" id="BPMNShape_sid-26ADDD10-82A2-4A7E-8314-35EE643337D3">
<omgdc:Bounds height="30.0" width="30.0" x="272.0" y="115.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="user1" id="BPMNShape_user1">
<omgdc:Bounds height="80.0" width="100.0" x="435.0" y="90.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="manager1" id="BPMNShape_manager1">
<omgdc:Bounds height="85.0" width="96.0" x="664.0" y="85.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-522696AE-6D29-4D93-9B25-AAC7664690E9" id="BPMNShape_sid-522696AE-6D29-4D93-9B25-AAC7664690E9">
<omgdc:Bounds height="40.0" width="40.0" x="900.0" y="107.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-8AB4379F-AFD9-460D-A87E-A0312A1E9FEB" id="BPMNShape_sid-8AB4379F-AFD9-460D-A87E-A0312A1E9FEB">
<omgdc:Bounds height="28.0" width="28.0" x="1050.0" y="113.5"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="939.5664335664336" y="127.93356643356644"></omgdi:waypoint>
<omgdi:waypoint x="1050.0000849826545" y="127.54878019169809"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="920.5" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="920.5" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="476.0" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="476.0" y="170.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="760.0" y="127.5"></omgdi:waypoint>
<omgdi:waypoint x="900.0" y="127.5"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="535.0" y="129.44933920704847"></omgdi:waypoint>
<omgdi:waypoint x="664.0" y="128.0286343612335"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="302.0" y="130.0"></omgdi:waypoint>
<omgdi:waypoint x="435.0" y="130.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
单一网关的跳线确实配置了条件:
请假流程模型设计
重新编辑请假流程模型,移除跳转条件后。流程实例正常启动。
Spring Boot 后台实例输出:
2022-04-29 14:39:30.113 INFO 1304 --- [nio-8080-exec-2] o.a.e.impl.bpmn.deployer.BpmnDeployer : Processing resource leaveProcess.bpmn20.xml
流程定义的ID:未定义:1:17508
流程实例的ID:17509
以上是关于Activiti 5 提示:Default sequenceflow has a condition, which is not allowed的主要内容,如果未能解决你的问题,请参考以下文章
使用 spsample() 对 SpatialPolygonsDataFrame 进行采样会导致 seq.default() 出错