利用java解析bpmn文件然后封装成xml文件 10C

需要利用java,解析bpmn文件然后封装成xml文件,还请哪位大神帮帮忙?

2个回答

bpmn文件本来就是以xml形式存在的,你可以直接以xml editor打开的,如果楼主是想使用流程相关的项目,建议你使用activiti流程引擎

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
activiti 添加bpmn文件报错
activiti 添加bpmn文件时报错:请教下各位 (关键是:有的bpmn文件可以正常添加,有的文件就会报如下错误:) 我的代码: InputStream inputStreamBpmn = this.getClass().getResourceAsStream("exclusiveGateway.bpmn"); Deployment deployment = processEngine.getRepositoryService() .createDeployment() .addInputStream("exclusiveGateway.bpmn", inputStreamBpmn) .deploy(); 下面是报错信息: org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.sql.SQLException: ORA-01460: 转换请求无法实施或不合理 ### The error may involve org.activiti.engine.impl.persistence.entity.ResourceEntity.insertResource-Inline ### The error occurred while setting parameters ### SQL: insert into ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) values (?, 1, ?, ?, ?, ?) ### Cause: java.sql.SQLException: ORA-01460: 转换请求无法实施或不合理
有关activiti的bpmn文件的问题
activiti的bpmn文件中定义连线的位置 <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> <omgdi:waypoint x="347.0" y="135.0"></omgdi:waypoint> <omgdi:waypoint x="347.0" y="182.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> <omgdi:waypoint x="347.0" y="237.0"></omgdi:waypoint> <omgdi:waypoint x="347.0" y="310.0"></omgdi:waypoint> <bpmndi:BPMNLabel> <omgdc:Bounds height="14.0" width="24.0" x="347.0" y="237.0"></omgdc:Bounds> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> omgdi:waypoint标签中的x y 是什么意思,为什么有两个, flow3的连线为什么还多了 <bpmndi:BPMNLabel> <omgdc:Bounds height="14.0" width="24.0" x="347.0" y="237.0"></omgdc:Bounds> </bpmndi:BPMNLabel>这个呢
怎么把前端生成的工作流bpmn图保存到数据库并部署
在开发工作流配置平台,现在前端生成了工作流的bpmn图,把xml文件传到了后端,后端要怎么保存图片并部署呢?
关于ApplicationStartingEvent的问题
``` "C:\Program Files\Java\jdk1.8.0_66\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\IDEA\IntelliJ IDEA 2019.1.1\lib\idea_rt.jar=49516:D:\IDEA\IntelliJ IDEA 2019.1.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_66\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\rt.jar;D:\Test\mcrm-seven\target\classes;D:\apache-tomcat-7.0.10\apache-tomcat-7.0.10\lib\jsp-api.jar;D:\apache-tomcat-7.0.10\apache-tomcat-7.0.10\lib\servlet-api.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\ojdbc14-10.2.0.4.0.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\pinyin4j-2.5.0.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\UserAgentUtils-1.13.jar;D:\Test\mcrm-seven\lib\javax.persistence.jar;D:\Test\mcrm-seven\lib\javax.transaction.jar;D:\Test\mcrm-seven\lib\javax.jms.jar;D:\Test\mcrm-seven\lib\javax.ejb.jar;D:\Test\mcrm-seven\lib\javax.servlet.jsp.jstl.jar;D:\Test\mcrm-seven\lib\javax.resource.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-log4j\1.3.8.RELEASE\spring-boot-starter-log4j-1.3.8.RELEASE.jar;C:\Users\17268\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.7\jcl-over-slf4j-1.7.7.jar;C:\Users\17268\.m2\repository\org\slf4j\jul-to-slf4j\1.7.7\jul-to-slf4j-1.7.7.jar;C:\Users\17268\.m2\repository\org\slf4j\slf4j-log4j12\1.7.7\slf4j-log4j12-1.7.7.jar;C:\Users\17268\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.2.2.RELEASE\spring-boot-starter-logging-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\com\alibaba\druid-spring-boot-starter\1.1.9\druid-spring-boot-starter-1.1.9.jar;C:\Users\17268\.m2\repository\com\alibaba\druid\1.1.9\druid-1.1.9.jar;C:\Users\17268\.m2\repository\org\slf4j\slf4j-api\1.7.7\slf4j-api-1.7.7.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.2.2.RELEASE\spring-boot-autoconfigure-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\net\sf\dozer\dozer\5.5.1\dozer-5.5.1.jar;C:\Users\17268\.m2\repository\org\freemarker\freemarker\2.3.20\freemarker-2.3.20.jar;C:\Users\17268\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\17268\.m2\repository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.2.3\jackson-core-2.2.3.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.2.3\jackson-databind-2.2.3.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.2.3\jackson-annotations-2.2.3.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\module\jackson-module-jaxb-annotations\2.2.3\jackson-module-jaxb-annotations-2.2.3.jar;C:\Users\17268\.m2\repository\net\sf\ehcache\ehcache-core\2.6.11\ehcache-core-2.6.11.jar;C:\Users\17268\.m2\repository\net\sf\ehcache\ehcache-web\2.0.4\ehcache-web-2.0.4.jar;C:\Users\17268\.m2\repository\redis\clients\jedis\3.1.0\jedis-3.1.0.jar;C:\Users\17268\.m2\repository\org\apache\commons\commons-pool2\2.7.0\commons-pool2-2.7.0.jar;C:\Users\17268\.m2\repository\com\thoughtworks\xstream\xstream\1.4.7\xstream-1.4.7.jar;C:\Users\17268\.m2\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;C:\Users\17268\.m2\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;C:\Users\17268\.m2\repository\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar;C:\Users\17268\.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\17268\.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\17268\.m2\repository\commons-fileupload\commons-fileupload\1.3.1\commons-fileupload-1.3.1.jar;C:\Users\17268\.m2\repository\commons-beanutils\commons-beanutils\1.9.1\commons-beanutils-1.9.1.jar;C:\Users\17268\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\analyzer-2012_u6.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\thumbnailator-0.4.2.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\apache-ant-zip-2.3.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\ckfinder-2.3.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\ckfinderplugin-fileeditor-2.3.jar;D:\Test\mcrm-seven\src\main\webapp\WEB-INF\lib\ckfinderplugin-imageresize-2.3.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-data-redis\2.2.2.RELEASE\spring-boot-starter-data-redis-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter\2.2.2.RELEASE\spring-boot-starter-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;C:\Users\17268\.m2\repository\org\springframework\data\spring-data-redis\2.2.3.RELEASE\spring-data-redis-2.2.3.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\data\spring-data-keyvalue\2.2.3.RELEASE\spring-data-keyvalue-2.2.3.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\data\spring-data-commons\2.2.3.RELEASE\spring-data-commons-2.2.3.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-oxm\5.2.2.RELEASE\spring-oxm-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-aop\5.2.2.RELEASE\spring-aop-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-context-support\5.2.2.RELEASE\spring-context-support-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\io\lettuce\lettuce-core\5.2.1.RELEASE\lettuce-core-5.2.1.RELEASE.jar;C:\Users\17268\.m2\repository\io\netty\netty-common\4.1.43.Final\netty-common-4.1.43.Final.jar;C:\Users\17268\.m2\repository\io\netty\netty-handler\4.1.43.Final\netty-handler-4.1.43.Final.jar;C:\Users\17268\.m2\repository\io\netty\netty-buffer\4.1.43.Final\netty-buffer-4.1.43.Final.jar;C:\Users\17268\.m2\repository\io\netty\netty-codec\4.1.43.Final\netty-codec-4.1.43.Final.jar;C:\Users\17268\.m2\repository\io\netty\netty-transport\4.1.43.Final\netty-transport-4.1.43.Final.jar;C:\Users\17268\.m2\repository\io\netty\netty-resolver\4.1.43.Final\netty-resolver-4.1.43.Final.jar;C:\Users\17268\.m2\repository\io\projectreactor\reactor-core\3.3.1.RELEASE\reactor-core-3.3.1.RELEASE.jar;C:\Users\17268\.m2\repository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;C:\Users\17268\.m2\repository\org\apache\poi\poi\3.9\poi-3.9.jar;C:\Users\17268\.m2\repository\org\apache\poi\poi-ooxml\3.9\poi-ooxml-3.9.jar;C:\Users\17268\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;C:\Users\17268\.m2\repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;C:\Users\17268\.m2\repository\org\apache\poi\poi-ooxml-schemas\3.9\poi-ooxml-schemas-3.9.jar;C:\Users\17268\.m2\repository\org\apache\xmlbeans\xmlbeans\2.3.0\xmlbeans-2.3.0.jar;C:\Users\17268\.m2\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\Users\17268\.m2\repository\com\drewnoakes\metadata-extractor\2.6.2\metadata-extractor-2.6.2.jar;C:\Users\17268\.m2\repository\com\adobe\xmp\xmpcore\5.1.2\xmpcore-5.1.2.jar;C:\Users\17268\.m2\repository\xerces\xercesImpl\2.8.1\xercesImpl-2.8.1.jar;C:\Users\17268\.m2\repository\com\google\zxing\core\2.2\core-2.2.jar;C:\Users\17268\.m2\repository\com\google\zxing\javase\2.2\javase-2.2.jar;C:\Users\17268\.m2\repository\com\google\guava\guava\17.0\guava-17.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-engine\5.21.0\activiti-engine-5.21.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-bpmn-converter\5.21.0\activiti-bpmn-converter-5.21.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-bpmn-model\5.21.0\activiti-bpmn-model-5.21.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-process-validation\5.21.0\activiti-process-validation-5.21.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-image-generator\5.21.0\activiti-image-generator-5.21.0.jar;C:\Users\17268\.m2\repository\org\apache\commons\commons-email\1.4\commons-email-1.4.jar;C:\Users\17268\.m2\repository\com\sun\mail\javax.mail\1.5.2\javax.mail-1.5.2.jar;C:\Users\17268\.m2\repository\javax\activation\activation\1.1.1\activation-1.1.1.jar;C:\Users\17268\.m2\repository\org\springframework\spring-beans\5.2.2.RELEASE\spring-beans-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\joda-time\joda-time\2.10.5\joda-time-2.10.5.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-spring\5.21.0\activiti-spring-5.21.0.jar;C:\Users\17268\.m2\repository\org\springframework\spring-context\5.2.2.RELEASE\spring-context-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-expression\5.2.2.RELEASE\spring-expression-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-jdbc\5.2.2.RELEASE\spring-jdbc-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-tx\5.2.2.RELEASE\spring-tx-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-orm\5.2.2.RELEASE\spring-orm-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;C:\Users\17268\.m2\repository\commons-pool\commons-pool\1.6\commons-pool-1.6.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-explorer\5.21.0\activiti-explorer-5.21.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-json-converter\5.21.0\activiti-json-converter-5.21.0.jar;C:\Users\17268\.m2\repository\math\geom2d\javaGeom\0.11.1\javaGeom-0.11.1.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-crystalball\5.21.0\activiti-crystalball-5.21.0.jar;C:\Users\17268\.m2\repository\com\h2database\h2\1.4.200\h2-1.4.200.jar;C:\Users\17268\.m2\repository\org\springframework\spring-core\5.2.2.RELEASE\spring-core-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-jcl\5.2.2.RELEASE\spring-jcl-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\spring-web\5.2.2.RELEASE\spring-web-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\imgscalr\imgscalr-lib\4.2\imgscalr-lib-4.2.jar;C:\Users\17268\.m2\repository\org\codehaus\groovy\groovy-all\2.4.5\groovy-all-2.4.5.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-modeler\5.21.0\activiti-modeler-5.21.0.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-common-rest\5.21.0\activiti-common-rest-5.21.0.jar;C:\Users\17268\.m2\repository\org\springframework\spring-webmvc\5.2.2.RELEASE\spring-webmvc-5.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\security\spring-security-config\5.2.1.RELEASE\spring-security-config-5.2.1.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\security\spring-security-core\5.2.1.RELEASE\spring-security-core-5.2.1.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\security\spring-security-crypto\5.2.1.RELEASE\spring-security-crypto-5.2.1.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\security\spring-security-web\5.2.1.RELEASE\spring-security-web-5.2.1.RELEASE.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-parser\1.7\batik-parser-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-awt-util\1.7\batik-awt-util-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-util\1.7\batik-util-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-xml\1.7\batik-xml-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-transcoder\1.7\batik-transcoder-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\fop\0.94\fop-0.94.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\xmlgraphics-commons\1.2\xmlgraphics-commons-1.2.jar;C:\Users\17268\.m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar;C:\Users\17268\.m2\repository\org\apache\avalon\framework\avalon-framework-api\4.3.1\avalon-framework-api-4.3.1.jar;C:\Users\17268\.m2\repository\org\apache\avalon\framework\avalon-framework-impl\4.3.1\avalon-framework-impl-4.3.1.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-dom\1.7\batik-dom-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-gvt\1.7\batik-gvt-1.7.jar;C:\Users\17268\.m2\repository\xml-apis\xml-apis-ext\1.3.04\xml-apis-ext-1.3.04.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-bridge\1.7\batik-bridge-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-anim\1.7\batik-anim-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-ext\1.7\batik-ext-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-script\1.7\batik-script-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-js\1.7\batik-js-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-codec\1.7\batik-codec-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-css\1.7\batik-css-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-svg-dom\1.7\batik-svg-dom-1.7.jar;C:\Users\17268\.m2\repository\org\apache\xmlgraphics\batik-svggen\1.7\batik-svggen-1.7.jar;C:\Users\17268\.m2\repository\org\activiti\activiti-diagram-rest\5.21.0\activiti-diagram-rest-5.21.0.jar;C:\Users\17268\.m2\repository\org\apache\shiro\shiro-core\1.2.3\shiro-core-1.2.3.jar;C:\Users\17268\.m2\repository\org\apache\shiro\shiro-spring\1.2.3\shiro-spring-1.2.3.jar;C:\Users\17268\.m2\repository\org\apache\shiro\shiro-cas\1.2.3\shiro-cas-1.2.3.jar;C:\Users\17268\.m2\repository\org\jasig\cas\client\cas-client-core\3.2.1\cas-client-core-3.2.1.jar;C:\Users\17268\.m2\repository\org\apache\shiro\shiro-web\1.2.3\shiro-web-1.2.3.jar;C:\Users\17268\.m2\repository\org\apache\shiro\shiro-ehcache\1.2.3\shiro-ehcache-1.2.3.jar;C:\Users\17268\.m2\repository\mysql\mysql-connector-java\8.0.18\mysql-connector-java-8.0.18.jar;C:\Users\17268\.m2\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.3.2\mybatis-spring-boot-starter-1.3.2.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.2.RELEASE\spring-boot-starter-jdbc-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\com\zaxxer\HikariCP\3.4.1\HikariCP-3.4.1.jar;C:\Users\17268\.m2\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.3.2\mybatis-spring-boot-autoconfigure-1.3.2.jar;C:\Users\17268\.m2\repository\org\mybatis\mybatis-spring\1.3.2\mybatis-spring-1.3.2.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.2.2.RELEASE\spring-boot-starter-web-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.2.2.RELEASE\spring-boot-starter-json-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.1\jackson-datatype-jdk8-2.10.1.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.1\jackson-datatype-jsr310-2.10.1.jar;C:\Users\17268\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.1\jackson-module-parameter-names-2.10.1.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-validation\2.2.2.RELEASE\spring-boot-starter-validation-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\jakarta\validation\jakarta.validation-api\2.0.1\jakarta.validation-api-2.0.1.jar;C:\Users\17268\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;C:\Users\17268\.m2\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;C:\Users\17268\.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\Users\17268\.m2\repository\org\projectlombok\lombok\1.18.10\lombok-1.18.10.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.2.2.RELEASE\spring-boot-starter-tomcat-2.2.2.RELEASE.jar;C:\Users\17268\.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\Users\17268\.m2\repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar;C:\Users\17268\.m2\repository\org\mybatis\mybatis\3.5.3\mybatis-3.5.3.jar;C:\Users\17268\.m2\repository\org\springframework\boot\spring-boot\1.4.3.RELEASE\spring-boot-1.4.3.RELEASE.jar;C:\Users\17268\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.29\tomcat-embed-core-9.0.29.jar" com.thinkgem.jeesite.McrmSevenApplication Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/context/event/ApplicationStartingEvent at org.springframework.boot.autoconfigure.BackgroundPreinitializer.onApplicationEvent(BackgroundPreinitializer.java:68) at org.springframework.boot.autoconfigure.BackgroundPreinitializer.onApplicationEvent(BackgroundPreinitializer.java:50) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:63) at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:48) at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) at com.thinkgem.jeesite.McrmSevenApplication.main(McrmSevenApplication.java:13) Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.event.ApplicationStartingEvent at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 12 more Process finished with exit code 1 ```
JBPM 配置文件报错 在线等
SEVERE: Servlet /jbpmDemo threw load() exception org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 21; cvc-elt.1: 找不到元素 'jbpm-configuration' 的声明。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) 下面是 jbpm.cfg.xml![图片说明](https://img-ask.csdn.net/upload/201504/05/1428206897_413365.png) <?xml version="1.0" encoding="UTF-8"?> <jbpm-configuration> <import resource="jbpm.default.cfg.xml" /> <import resource="jbpm.businesscalendar.cfg.xml" /> <import resource="jbpm.tx.spring.cfg.xml" /> <import resource="jbpm.jpdl.cfg.xml" /> <import resource="jbpm.bpmn.cfg.xml" /> <import resource="jbpm.identity.cfg.xml" /> </jbpm-configuration>
Drools6 规则流的问题
在Drools5老版本drl和**规则流xml**文件是通过KnowledgeBuilder 手动加载的,然后执行的过程和执行drl文件方式差不多,只是多了一句对Process的执行,也就是**ksession.startProcess("ruleflow.salary"); **完整代码引用示例: ``` public class EmployTest2 { public static void main(String[] args) { try { // load up the knowledge base KnowledgeBase kbase = readKnowledgeBase(); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test"); // go ! Employ emp = new Employ(); emp.setEduInfo("master"); emp.setResume("tech"); emp.setAnnualExam("good"); emp.setAwardPunish("award"); ksession.insert(emp); ksession.startProcess("ruleflow.salary"); ksession.fireAllRules(); System.out.println("Basic Salary: " + emp.getBasicSalary()); System.out.println("Duty Salary: " + emp.getDutySalary()); System.out.println("Bonus : " + emp.getBonus()); System.out.println("rate : " + emp.getPercent()); System.out.printf("Total Salary: %.0f" , emp.getTotalSalary()); logger.close(); } catch (Throwable t) { t.printStackTrace(); } } private static KnowledgeBase readKnowledgeBase() throws Exception { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newFileResource("./rules/EduInfoRule.drl"), ResourceType.DRL); kbuilder.add(ResourceFactory.newFileResource("./rules/ResumeRule.drl"), ResourceType.DRL); kbuilder.add(ResourceFactory.newFileResource("./rules/BonusRule.drl"), ResourceType.DRL); kbuilder.add(ResourceFactory.newFileResource("./rules/AwardPunish.drl"), ResourceType.DRL); kbuilder.add(ResourceFactory.newFileResource("./rules/TotalRule.drl"), ResourceType.DRL); kbuilder.add(ResourceFactory.newFileResource("./rules/saflow.xml"), ResourceType.BPMN2); KnowledgeBuilderErrors errors = kbuilder.getErrors(); if (errors.size() > 0) { for (KnowledgeBuilderError error: errors) { System.err.println(error); } throw new IllegalArgumentException("Could not parse knowledge."); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); return kbase; } } ``` 在Drools6的环境下执行这段规则流示例没有任何问题,而由于Drools6更新了全新的Kie API,所以现在碰到的问题就是使用KieAPI时并不能执行ksession.startProcess("ruleflow.salary");的逻辑,报错如下: java.lang.IllegalArgumentException: Unknown process ID: ruleflow.salary xml流文件配置如下: **... type="RuleFlow" name="salary" id="ruleflow.salary" package-name="ruleflow" >** 个人想到的原因可能是因为Drools6自动加载kmodule.xml文件指定下的包路径的drl文件, 而并没有加载流配置文件,就是老版本示例中的 ** kbuilder.add(ResourceFactory.newFileResource("./rules/saflow.xml"), ResourceType.BPMN2);** 这句代码, 所以导致报错,,, 不知道大家有过规则流这方面的接触没有, 本人菜鸟到处找资料,然并卵,,, 百度也无力了...
一个activiti的小demo,启动的时候报空指针异常
![图片说明](https://img-ask.csdn.net/upload/201908/14/1565768405_456671.png) ``` package org.crazyit.activiti; import org.activiti.engine.ProcessEngine; import org.activiti.engine.ProcessEngines; import org.activiti.engine.RepositoryService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.task.Task; /** * 第一个流程运行类 * @author yangenxiong * */ public class First { public static void main(String[] args) { // 创建流程引擎 ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); // 得到流程存储服务组件 RepositoryService repositoryService = engine.getRepositoryService(); // 得到运行时服务组件 RuntimeService runtimeService = engine.getRuntimeService(); // 获取流程任务组件 TaskService taskService = engine.getTaskService(); // 部署流程文件 repositoryService.createDeployment() .addClasspathResource("bpmn/First.bpmn").deploy(); // 启动流程 runtimeService.startProcessInstanceByKey("process1"); // 查询第一个任务 Task task = taskService.createTaskQuery().singleResult(); System.out.println("第一个任务完成前,当前任务名称:" + task.getName()); // 完成第一个任务 taskService.complete(task.getId()); // 查询第二个任务 task = taskService.createTaskQuery().singleResult(); System.out.println("第二个任务完成前,当前任务名称:" + task.getName()); // 完成第二个任务(流程结束) taskService.complete(task.getId()); task = taskService.createTaskQuery().singleResult(); System.out.println("流程结束后,查找任务:" + task); // 退出 System.exit(0); } } ``` ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- 只配置相应的数据库属性 --> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <!-- 连接数据库配置 --> <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver"></property> <property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1521:orcl"></property> <property name="jdbcUsername" value="act"></property> <property name="jdbcPassword" value="123456"></property> <!-- 如果表不存在 自动创建 --> <property name="databaseSchemaUpdate" value="true"></property> </bean> </beans> ``` ![图片说明](https://img-ask.csdn.net/upload/201908/14/1565768535_305609.png)
Activiti5 的邮件自动发送报错,卡住一整天了
``` org.activiti.engine.ActivitiException: Could not send e-mail at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:75) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:54) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:66) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:44) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:407) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:105) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:54) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:54) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:45) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:53) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:90) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:571) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:566) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:349) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:98) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37) at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:102) at com.chongzhi.atcrowdfunding.potal.controller.MemberController.startProcess(MemberController.java:172) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2555) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2544) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.qq.com:465 at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421) at org.apache.commons.mail.Email.send(Email.java:1448) at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:73) ... 106 more Caused by: com.sun.mail.smtp.SMTPSendFailedException: 501 mail from address must be same as authorization user ; nested exception is: com.sun.mail.smtp.SMTPSenderFailedException: 501 mail from address must be same as authorization user at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2202) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1693) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1194) at javax.mail.Transport.send0(Transport.java:254) at javax.mail.Transport.send(Transport.java:124) at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411) ... 108 more Caused by: com.sun.mail.smtp.SMTPSenderFailedException: 501 mail from address must be same as authorization user at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1700) ... 112 more ``` 报错代码 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd"> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <property name="mailServerHost" value="smtp.qq.com"/> <property name="mailServerPort" value="587"/> <property name="mailServerUseSSL" value="true"/> <property name="mailServerUsername" value="564@qq.com"/> <property name="mailServerPassword" value="foqsbvgmgtcxbcag"/> <property name="mailServerDefaultFrom" value="564@qq.com"/> <property name="mailServerUseTLS" value="true"/> <property name="dataSource" ref="dataSource" /> <property name="databaseSchemaUpdate" value="true" /> <property name="jobExecutorActivate" value="true" /> <property name="labelFontName" value="宋体" /> <property name="activityFontName" value="宋体" /> <property name="customFormTypes"> <list> <bean class="org.activiti.explorer.form.UserFormType"/> <bean class="org.activiti.explorer.form.ProcessDefinitionFormType"/> <bean class="org.activiti.explorer.form.MonthFormType"/> </list> </property> </bean> <!-- <bean id="processEngineConfiguration1" class="org.activiti.spring.SpringProcessEngineConfiguration"> <property name="dataSource" ref="dataSource" /> <property name="transactionManager" ref="transactionManager" /> <property name="databaseSchemaUpdate" value="true" /> <property name="jobExecutorActivate" value="true" /> <property name="labelFontName" value="宋体" /> <property name="activityFontName" value="宋体" /> <property name="customFormTypes"> <list> <bean class="org.activiti.explorer.form.UserFormType"/> <bean class="org.activiti.explorer.form.ProcessDefinitionFormType"/> <bean class="org.activiti.explorer.form.MonthFormType"/> </list> </property> </bean> --> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy"> <property name="processEngineConfiguration" ref="processEngineConfiguration" /> </bean> <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" /> <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" /> <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" /> <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" /> </beans> ``` Activiti的xml配置信息 ![Activiti的邮件工作流信息](https://img-ask.csdn.net/upload/201903/29/1553789287_718525.png) 麻烦大牛帮忙看看,卡了一整天了,通关到这里卡住了
activiti工作流,退回问题。。
执行退回到上一节点操作时,完成操作执行报错空指针,task的值都取到了啊,执行到taskService.complete 时就报错 ``` try { Map<String, Object> variables; // 取得当前任务.当前任务节点 HistoricTaskInstance currTask = historyService .createHistoricTaskInstanceQuery().taskId(taskId) .singleResult(); // 取得流程实例,流程实例 ProcessInstance instance = runtimeService .createProcessInstanceQuery() .processInstanceId(currTask.getProcessInstanceId()) .singleResult(); if (instance == null) { log.info("流程结束"); log.error("出错啦!流程已经结束"); // return "ERROR"; } variables = instance.getProcessVariables(); // 取得流程定义 ProcessDefinitionEntity definition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) .getDeployedProcessDefinition(currTask .getProcessDefinitionId()); if (definition == null) { log.info("流程定义未找到"); log.error("出错啦!流程定义未找到"); // return "ERROR"; } // 取得上一步活动 ActivityImpl currActivity = ((ProcessDefinitionImpl) definition) .findActivity(currTask.getTaskDefinitionKey()); //也就是节点间的连线 List<PvmTransition> nextTransitionList = currActivity .getIncomingTransitions(); // 清除当前活动的出口 List<PvmTransition> oriPvmTransitionList = new ArrayList<PvmTransition>(); //新建一个节点连线关系集合 List<PvmTransition> pvmTransitionList = currActivity .getOutgoingTransitions(); // for (PvmTransition pvmTransition : pvmTransitionList) { oriPvmTransitionList.add(pvmTransition); } pvmTransitionList.clear(); // 建立新出口 List<TransitionImpl> newTransitions = new ArrayList<TransitionImpl>(); for (PvmTransition nextTransition : nextTransitionList) { PvmActivity nextActivity = nextTransition.getSource(); ActivityImpl nextActivityImpl = ((ProcessDefinitionImpl) definition) .findActivity(nextActivity.getId()); TransitionImpl newTransition = currActivity .createOutgoingTransition(); newTransition.setDestination(nextActivityImpl); newTransitions.add(newTransition); } // 完成任务 List<Task> tasks = taskService.createTaskQuery() .processInstanceId(instance.getId()) .taskDefinitionKey(currTask.getTaskDefinitionKey()).list(); for (Task task : tasks) { taskService.complete(task.getId(), variables); // UserInfo user = SessionUtil.getUser(); // Authentication.setAuthenticatedUserId(user.getUserId()+"");//批注人的名称 一定要写,不然查看的时候不知道人物信息 // taskService.addComment(taskId, null, comment);//comment为批注内容 historyService.deleteHistoricTaskInstance(task.getId()); } // 恢复方向 for (TransitionImpl transitionImpl : newTransitions) { currActivity.getOutgoingTransitions().remove(transitionImpl); } for (PvmTransition pvmTransition : oriPvmTransitionList) { pvmTransitionList.add(pvmTransition); } log.info("OK"); log.info("流程结束"); // return "SUCCESS"; } catch (Exception e) { log.error("失败"); log.error(e.getMessage()); // return "ERROR"; } ``` 下面是控制台代码 ``` 2016-09-13 11:51:06|http-bio-8080-exec-10|DEBUG|org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:171)|Error while closing command context java.lang.NullPointerException at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:126) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:47) at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.signal(UserTaskActivityBehavior.java:225) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:409) at org.activiti.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:203) at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:52) at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:24) at org.activiti.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:59) at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) at org.activiti.engine.impl.TaskServiceImpl.complete(TaskServiceImpl.java:179) at com.skysoft.irevisit.visit.service.dengji.DengJiService.boHui(DengJiService.java:649) at com.skysoft.irevisit.visit.web.dengji.DengJiController.execute(DengJiController.java:355) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931) ```
activiti启动实例时异常,大神们能看出什么原因吗 ?
12:26:46.846 [main] INFO o.a.engine.impl.db.DbSqlSession 1147 - performing create on identity with resource org/activiti/db/create/activiti.h2.create.identity.sql 12:26:46.862 [main] INFO o.a.engine.impl.ProcessEngineImpl 87 - ProcessEngine default created 12:26:47.596 [main] WARN o.a.e.i.b.d.ProcessDefinitionDiagramHelper 67 - Error while generating process diagram, image will not be stored in repository java.lang.NullPointerException: null at org.activiti.image.impl.DefaultProcessDiagramGenerator.connectionPerfectionizer(DefaultProcessDiagramGenerator.java:697) at org.activiti.image.impl.DefaultProcessDiagramGenerator$22.draw(DefaultProcessDiagramGenerator.java:379) at org.activiti.image.impl.DefaultProcessDiagramGenerator.drawArtifact(DefaultProcessDiagramGenerator.java:785) at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateProcessDiagram(DefaultProcessDiagramGenerator.java:508) at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateDiagram(DefaultProcessDiagramGenerator.java:403) at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateDiagram(DefaultProcessDiagramGenerator.java:427) at org.activiti.engine.impl.bpmn.deployer.ProcessDefinitionDiagramHelper.createDiagramForProcessDefinition(ProcessDefinitionDiagramHelper.java:51) at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.createAndPersistNewDiagramsIfNeeded(BpmnDeployer.java:117) at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:79) at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:60) at org.activiti.engine.impl.cmd.DeployCmd.executeDeploy(DeployCmd.java:110) at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:60) at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:40) at org.activiti.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:37) at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:78) at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:57) at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:42) at org.activiti.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:48) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:63) at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:29) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:39) at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:86) at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:188) at org.activiti.engine.impl.test.TestHelper.annotationDeploymentSetUp(TestHelper.java:101) at org.activiti.engine.test.ActivitiRule.starting(ActivitiRule.java:215) at org.activiti.engine.test.ActivitiRule.startingQuietly(ActivitiRule.java:159) at org.activiti.engine.test.ActivitiRule.access$000(ActivitiRule.java:76) at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:114) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) ProcessEngine [default] Version: [6.0.0.4] Found process definition [Text FlowChart2] with id [TextFlowChart2:1:3]
activiti退回到会签任务节点时,会签人办理任务,能得到任务id但出现空指针异常,为什么?
根据节点id和流程实例id跳转节点方法 managerService.executeCommand(new JumpActivityCmd(activitiID, instanceId)); public class JumpActivityCmd implements Command<Object> { private String activityId; private String processInstanceId; private String jumpOrigin; public JumpActivityCmd(String activityId, String processInstanceId,String jumpOrigin) { this.activityId = activityId; this.processInstanceId = processInstanceId; this.jumpOrigin = jumpOrigin; } public JumpActivityCmd(String activityId, String processInstanceId) { this(activityId,processInstanceId,"jump"); } public Object execute(CommandContext commandContext) { ExecutionEntity executionEntity = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId); executionEntity.destroyScope(jumpOrigin); ProcessDefinitionImpl processDefinition = executionEntity.getProcessDefinition(); ActivityImpl activity = processDefinition.findActivity(activityId); executionEntity.executeActivity(activity); return executionEntity; } } 异常: java.lang.NullPointerException at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:96) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:460) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.takeAll(ExecutionEntity.java:564) at org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior.leave(ParallelMultiInstanceBehavior.java:152) at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:49) at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.signal(UserTaskActivityBehavior.java:228) at org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior.signal(MultiInstanceActivityBehavior.java:109) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:417) at org.activiti.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:203) at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:52) at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:24) at org.activiti.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:59) at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) at org.activiti.engine.impl.TaskServiceImpl.complete(TaskServiceImpl.java:178) at com.tw.process.processInfo.completeTask(processInfo.java:374) at sun.reflect.GeneratedMethodAccessor371.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
Eclipse:Failed to create the part's controls
BPMN文件打不开 显示Failed to create the part's controls。按查到的方法重选workspace,右键open with什么的都打不开图只能打开源码,Eclipse重装了一次都不行,也没有特殊字符还有没有其他方法![![图片说明](https://img-ask.csdn.net/upload/201603/18/1458303010_792263.png)图片说明](https://img-ask.csdn.net/upload/201603/18/1458303004_583545.png)
activiti model部署流程问题
初识activiti,整合了网页设计器,如图: ![图片说明](https://img-ask.csdn.net/upload/201810/14/1539529898_329251.png) 在某个用户任务上配置了监听:![图片说明](https://img-ask.csdn.net/upload/201810/14/1539529982_867533.png) 保存文件后,model数据中是有taskListeners节点的:![图片说明](https://img-ask.csdn.net/upload/201810/14/1539530092_978888.png), 然后使用model部署流程,代码如下 ``` @Override @Transactional /* * 根据模型部署流程 * */ public Boolean deployProcessByModel(String modelId, String deptWithProcessKeyId, LoginInfo loginInfo) { RepositoryService repositoryService = processEngineUtile.getProcessEngine().getRepositoryService(); // DeploymentBuilder deployment = repositoryService.createDeployment(); // BpmnModel bpmnModel = getBpmnModel(); // deployment.addBpmnModel("test", bpmnModel).deploy(); // 部署流程 DepartmentWithProcessEntity entity=departmentWithProcessRepository .get(DepartmentWithProcessEntity.class, deptWithProcessKeyId); String title=departmentWithProcessRepository.getProcessDeplyTitle(deptWithProcessKeyId); String deploymentid=""; try { Model modelData=repositoryService.getModel(modelId); // ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); byte[] bpmnBytes = null; JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelId)); BpmnJsonConverter jsonConverter = new BpmnJsonConverter(); BpmnModel model = jsonConverter.convertToBpmnModel(editorNode); // filename = model.getMainProcess().getId() + ".bpmn20.xml"; // BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode); bpmnBytes = new BpmnXMLConverter().convertToXML(model); String encoded = Base64.getEncoder().encodeToString(bpmnBytes); byte[] decoded = Base64.getDecoder().decode(encoded); String xml=new String(decoded); String processName = modelData.getName() + ".bpmn20.xml"; ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes); Deployment deployment = repositoryService.createDeployment().name(title) .addInputStream(processName, in).deploy(); deploymentid = deployment.getId(); } catch (Exception e) { System.out.println(e); } Assert.isTrue(!StringUtils.isEmpty(deploymentid), "流程部署出错"); ProcessDefinition processDefinition= repositoryService .createProcessDefinitionQuery() .deploymentId(deploymentid) .singleResult(); //更新部门流程关系表 entity.setProcessDefinitionId(deploymentid); departmentWithProcessRepository.update(entity); //部署历史表 List<DeployHistoryEntity> deployHistoryEntities = deployHistoryRepository.getDeployHistoryByDeptWithProcessKeyId(deptWithProcessKeyId); for (DeployHistoryEntity deployHistoryEntity : deployHistoryEntities) { if (deployHistoryEntity.getModelKeyid().equals(modelId)) { deployHistoryEntity.setDeploy(true); }else { deployHistoryEntity.setDeploy(false); } deployHistoryRepository.update(deployHistoryEntity); } return true; } ``` editorNode变量值拷贝出来,还是可以看到taskListeners,转成bpmn后,复制出来监听部分的节点就没有了。![图片说明](https://img-ask.csdn.net/upload/201810/14/1539530353_108410.png),很迷惘,activiti版本号5.22。整合过这个设计器的没有看到谁有这个问题,但是又不知道自己错在哪里,目前只能定位到model转bpmn的时候监听丢失了。希望知道的哥哥姐姐解答一下疑惑,或远程帮助一下,不胜感激!!!
用Ajax请求道action中执行了方法但没有显示结果怎么回事
Ajax中 //导出方法 function exportGo(url,params,grid) { $.messager.confirm('提示','您正要导出此项 !<br />请确定继续?',function(r){ if(r){ doAjax3("", url, grid, params, ""); } }); } function doAjax3(form,url,grid,param,msg){ $.ajax({ url: url, type: 'POST', cache: false, async: false, contentType:"application/json", // dataType : 'json', data: param, success: function(data, textStatus, jqXHR) { alert(data); if (!isNull(grid)) { grid.load({page:1}); } if(!isNull(form)){ form.resetForm(); } }, error:function(msg,textStatus, errorThrown) { alert(errorThrown); alert("网络错误或者处理异常,请重试或者联系管理员处理!错误信息:" + msg.responseText); } }); } action中 /** * 导出model的xml文件 */ @RequestMapping(value = "export/{modelId}") @OperatingLog(function="导出文件") public void export(@PathVariable("modelId") String modelId, HttpServletResponse response) { try { Model modelData = repositoryService.getModel(modelId); BpmnJsonConverter jsonConverter = new BpmnJsonConverter(); JsonNode editorNode = new ObjectMapper().readTree(repositoryService .getModelEditorSource(modelData.getId())); BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode); BpmnXMLConverter xmlConverter = new BpmnXMLConverter(); byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel); ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes); IOUtils.copy(in, response.getOutputStream()); String filename = bpmnModel.getMainProcess().getId() + ".bpmn20.xml"; response.setHeader("Content-Disposition", "attachment; filename=" + filename); response.flushBuffer(); } catch (Exception e) { log.error("导出model的xml文件失败:modelId={}", modelId, e); } }
Struts2+Spring3+Hibernate4+JBPM4.4整合问题
<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>jar包</p> <p><img src="http://dl2.iteye.com/upload/attachment/0087/6822/e8e1a7c1-2a73-3229-8406-20255161b36c.jpg" alt="" width="763" height="216"><br>Spring 配置文件<br><br>//新添加的 整合 JBPM<br> &lt;bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper"&gt;<br>   &lt;property name="jbpmCfg" value="jbpm.cfg.xml" /&gt;<br> &lt;/bean&gt;<br><br> &lt;bean id="processEngine" factory-bean="springHelper"  factory-method="createProcessEngine" /&gt;<br><br>&lt;!-- 配置hibernate session工厂 --&gt;<br> &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;<br>   &lt;property name="dataSource" ref="dataSource" /&gt;<br> // 自动注入 jbpm表<br>   &lt;property name="mappingLocations"&gt;  <br>     &lt;list&gt;  <br>      &lt;value&gt;classpath:jbpm.execution.hbm.xml&lt;/value&gt;<br>      &lt;value&gt;classpath:jbpm.history.hbm.xml&lt;/value&gt;<br>      &lt;value&gt;classpath:jbpm.identity.hbm.xml&lt;/value&gt;<br>      &lt;value&gt;classpath:jbpm.repository.hbm.xml&lt;/value&gt;<br>      &lt;value&gt;classpath:jbpm.task.hbm.xml&lt;/value&gt;<br>        &lt;/list&gt;<br>    &lt;/property&gt;<br><br>jbpm.cfg.xml 配置文件内容<br> &lt;?xml version="1.0" encoding="UTF-8"?&gt;<br> &lt;jbpm-configuration&gt;<br> &lt;process-engine-context&gt;<br>     &lt;string name="spring.cfg" value="spring-jbpm4.xml" /&gt;<br>   &lt;/process-engine-context&gt;<br> &lt;import resource="jbpm.default.cfg.xml" /&gt;<br> &lt;import resource="jbpm.tx.spring.cfg.xml" /&gt;<br> &lt;import resource="jbpm.jpdl.cfg.xml" /&gt;<br> &lt;import resource="jbpm.bpmn.cfg.xml" /&gt;<br> &lt;import resource="jbpm.identity.cfg.xml" /&gt;<br> &lt;import resource="jbpm.businesscalendar.cfg.xml" /&gt;<br> &lt;import resource="jbpm.console.cfg.xml" /&gt;<br> &lt;/jbpm-configuration&gt;<br><br>启动之后的报错信息:<br><br>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [spring-hibernate.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.processengine.SpringHelper.createProcessEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/impl/SessionImpl<br> at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)<br> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)<br> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)<br> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)<br> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)<br> at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)<br> at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)<br> at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)<br> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)<br> at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)<br> at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)<br> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)<br> at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)<br> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)<br> at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)<br> at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)<br> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)<br> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)<br> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)<br> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)<br> at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)<br> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)<br> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)<br> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)<br> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)<br> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)<br> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)<br> at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)<br> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)<br> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)<br> at org.apache.catalina.core.StandardService.start(StandardService.java:516)<br> at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)<br> at org.apache.catalina.startup.Catalina.start(Catalina.java:578)<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br> at java.lang.reflect.Method.invoke(Method.java:597)<br> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)<br> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)<br> Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.processengine.SpringHelper.createProcessEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/impl/SessionImpl<br> at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169)<br> at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)<br> ... 38 more<br> Caused by: java.lang.NoClassDefFoundError: org/hibernate/impl/SessionImpl<br> at org.jbpm.pvm.internal.wire.descriptor.HibernateSessionDescriptor.getType(HibernateSessionDescriptor.java:95)<br> at org.jbpm.pvm.internal.wire.WireDefinition.addDescriptor(WireDefinition.java:88)<br> at org.jbpm.pvm.internal.wire.xml.WireParser.parseDocumentElement(WireParser.java:208)<br> at org.jbpm.pvm.internal.cfg.ConfigurationParser.parseDocument(ConfigurationParser.java:112)<br> at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:432)<br> at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:158)<br> at org.jbpm.pvm.internal.cfg.ConfigurationParser.parseDocument(ConfigurationParser.java:86)<br> at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:432)<br> at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:158)<br> at org.jbpm.pvm.internal.cfg.ConfigurationImpl.parse(ConfigurationImpl.java:137)<br> at org.jbpm.pvm.internal.cfg.ConfigurationImpl.setResource(ConfigurationImpl.java:116)<br> at org.jbpm.pvm.internal.processengine.SpringHelper.createProcessEngine(SpringHelper.java:50)<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br> at java.lang.reflect.Method.invoke(Method.java:597)<br> at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149)<br> ... 39 more<br> Caused by: java.lang.ClassNotFoundException: org.hibernate.impl.SessionImpl<br> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)<br> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)<br> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)<br> ... 56 more<br> 2013-7-31 11:13:06 org.apache.catalina.core.StandardContext listenerStart</p> <p> </p> </div>
activiti 获取部署的图片为什么和我画的流程图有差别?是什么问题呢?
//查询model信息 Model modelData = repositoryService.createModelQuery().modelKey(id).singleResult(); BpmnJsonConverter jsonConverter = new BpmnJsonConverter(); //获取数据表信息 JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode); BpmnXMLConverter xmlConverter = new BpmnXMLConverter(); byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel); //部署流程 String processName = modelData.getId() + ".bpmn20.xml"; Deployment deployment = repositoryService.createDeployment().name(modelData.getId()).addString(processName, new String(bpmnBytes,"utf-8")).deploy(); //查询流程定义图片 if(deployment != null){ List<ProcessDefinition> pList = repositoryService.createProcessDefinitionQuery() .processDefinitionKey("process").list(); ProcessDefinition processDefinition = null; for (ProcessDefinition pd : pList) { if(pd.getDeploymentId().equals(deployment.getId())){ processDefinition = pd; } } String diagramResourceName = processDefinition.getDiagramResourceName(); InputStream in = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), diagramResourceName); //将图片生成到D盘的目录下 File file = new File("D:/"+diagramResourceName+".png"); //将输入流的图片写到D盘下 FileUtils.copyInputStreamToFile(in, file); //删除部署 repositoryService.deleteDeployment(deployment.getId(), true); // return in; } ![图片说明](https://img-ask.csdn.net/upload/201605/31/1464678996_841205.png) ![图片说明](https://img-ask.csdn.net/upload/201605/31/1464679013_71261.png)
activiti定时边界事件
![图片说明](https://img-ask.csdn.net/upload/201704/14/1492155011_881531.png) 流程图如上,在task1上面有一个定时边界事件,我想实现TASK1超时1分钟后走TASK3流程,下面是xml文件, 想问一下大牛们,定时事件是超过某个事件后自动走指定的流程吗,还是需要写监听器啊,如果写的话,是在定时器上写,还是在定时器的连线上写? 现在我这个流程部署启动后,流程走到TASK1后,就算超时了也不往TASK3走,请问怎么解决? ``` <?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="timeprocess" name="持续时间测试" isExecutable="true"> <startEvent id="startEvent"></startEvent> <userTask id="task1" name="TASK1" activiti:assignee="张三" activiti:dueDate="PT60S"></userTask> <userTask id="task2" name="TASK2" activiti:assignee="李四"></userTask> <endEvent id="endevent"></endEvent> <sequenceFlow id="start" sourceRef="startEvent" targetRef="task1"></sequenceFlow> <sequenceFlow id="toend" sourceRef="task2" targetRef="endevent"></sequenceFlow> <userTask id="dingshirenwu" name="TASK3" activiti:assignee="${task}"></userTask> <sequenceFlow id="totask2" sourceRef="task1" targetRef="task2"></sequenceFlow> <boundaryEvent id="dingshiqi" name="定时器" attachedToRef="task1" cancelActivity="true"> <timerEventDefinition> <timeDuration>${startTime}</timeDuration> </timerEventDefinition> </boundaryEvent> <sequenceFlow id="ttoend" sourceRef="dingshirenwu" targetRef="endevent"></sequenceFlow> <sequenceFlow id="flow1" name="超时" sourceRef="dingshiqi" targetRef="dingshirenwu"> </sequenceFlow> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_timeprocess"> <bpmndi:BPMNPlane bpmnElement="timeprocess" id="BPMNPlane_timeprocess"> <bpmndi:BPMNShape bpmnElement="startEvent" id="BPMNShape_startEvent"> <omgdc:Bounds height="30.0" width="30.0" x="401.0" y="25.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="task1" id="BPMNShape_task1"> <omgdc:Bounds height="80.0" width="100.0" x="366.0" y="120.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="task2" id="BPMNShape_task2"> <omgdc:Bounds height="80.0" width="100.0" x="366.0" y="270.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="endevent" id="BPMNShape_endevent"> <omgdc:Bounds height="28.0" width="28.0" x="402.0" y="405.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="dingshiqi" id="BPMNShape_dingshiqi"> <omgdc:Bounds height="31.0" width="31.0" x="349.94541332282375" y="138.62155968870044"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="dingshirenwu" id="BPMNShape_dingshirenwu"> <omgdc:Bounds height="80.0" width="99.99999999999994" x="180.0" y="114.12155968870044"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="toend" id="BPMNEdge_toend"> <omgdi:waypoint x="416.0" y="350.0"></omgdi:waypoint> <omgdi:waypoint x="416.0" y="405.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="ttoend" id="BPMNEdge_ttoend"> <omgdi:waypoint x="258.088356271111" y="194.12155968870044"></omgdi:waypoint> <omgdi:waypoint x="407.95455060981106" y="407.54265545120035"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="totask2" id="BPMNEdge_totask2"> <omgdi:waypoint x="416.0" y="200.0"></omgdi:waypoint> <omgdi:waypoint x="416.0" y="270.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="start" id="BPMNEdge_start"> <omgdi:waypoint x="416.0" y="55.0"></omgdi:waypoint> <omgdi:waypoint x="416.0" y="120.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="to3" id="BPMNEdge_to3"> <omgdi:waypoint x="349.94552154006806" y="154.5627129376712"></omgdi:waypoint> <omgdi:waypoint x="279.99999999999994" y="154.30545702947083"></omgdi:waypoint> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions> ```
spring+activiti 注入servici问题
测试调用空指针异常。断点查看,自己封装的方法ActivitiInter,repositoryService为null 应该是说明这个repositoryService没有注入进来。 具体哪出的问题呢? 以下为配置和代码 application.xml中Activiti配置 <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> <property name="dataSource" ref="dataSource" /> <property name="transactionManager" ref="transactionManager" /> <property name="databaseSchemaUpdate" value="true" /> </bean> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"> <property name="processEngineConfiguration" ref="processEngineConfiguration" /> </bean> <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" /> <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" /> <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" /> <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" /> <bean id="formService" factory-bean="processEngine" factory-method="getFormService" /> <bean id="activitiInter" class="com.ln.web.activiti.ActivitiInter"> <property name="repositoryService" ref="repositoryService" /> <property name="runtimeService" ref="runtimeService" /> <property name="taskService" ref="taskService" /> <property name="formService" ref="formService" /> <property name="historyService" ref="historyService" /> </bean> Activiti服务封装的接口: package com.ln.web.activiti; import java.util.List; import org.activiti.engine.FormService; import org.activiti.engine.HistoryService; import org.activiti.engine.RepositoryService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.repository.Deployment; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.runtime.Execution; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; import org.springframework.beans.factory.annotation.Autowired; /** * Activiti服务接口 * @author linan * */ public class ActivitiInter { @Autowired RepositoryService repositoryService;//获得activiti服务 @Autowired RuntimeService runtimeService;//用于管理运行时流程实例 @Autowired TaskService taskService;//用于管理运行时任务 @Autowired FormService formService; @Autowired HistoryService historyService; /** * activiti服务列表 * @return */ public List<ProcessDefinition> activitiListByprocesskey(String process_key){ List<ProcessDefinition> procDefList = repositoryService.createProcessDefinitionQuery() .processDefinitionKey(process_key) .orderByProcessDefinitionVersion() .desc() .list(); return procDefList; } /** * 流程实例列表 * @return */ public List<ProcessInstance> listProcInstByPdfid(String pdfid){ List<ProcessInstance> procInstList = runtimeService.createProcessInstanceQuery() .processDefinitionId(pdfid) .list(); return procInstList; } /** * 当前任务的执行情况 * @return */ public List<Execution> listExecutionByProId(String processInstanceId) { List<Execution> exectionList = runtimeService.createExecutionQuery() .processInstanceId(processInstanceId) .list(); return exectionList; } /** * 部署流程 * @return */ public Deployment deployProcDefByPath( String xmlPath){ Deployment deploy = repositoryService.createDeployment() .addClasspathResource(xmlPath) .deploy(); return deploy; } /** * 删除部署的流程 * @param process_key */ public void deleteProcDefByprocesskey(String process_key){ List<ProcessDefinition> procDefList = this.activitiListByprocesskey(process_key); for(ProcessDefinition task : procDefList){ List<Task> tasks = taskService.createTaskQuery().processDefinitionId(task.getId()).list(); for(Task t : tasks){ taskService.deleteTask(t.getId()); } repositoryService.deleteDeployment(task.getDeploymentId()); } } /** * 启动流程 * @param key * @return */ public ProcessInstance startProcessInstanceByKey(String key){ ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(key); return processInstance; } public RepositoryService getRepositoryService() { return repositoryService; } public void setRepositoryService(RepositoryService repositoryService) { this.repositoryService = repositoryService; } public RuntimeService getRuntimeService() { return runtimeService; } public void setRuntimeService(RuntimeService runtimeService) { this.runtimeService = runtimeService; } public TaskService getTaskService() { return taskService; } public void setTaskService(TaskService taskService) { this.taskService = taskService; } public FormService getFormService() { return formService; } public void setFormService(FormService formService) { this.formService = formService; } public HistoryService getHistoryService() { return historyService; } public void setHistoryService(HistoryService historyService) { this.historyService = historyService; } } 测试调用: package com.ln.web.controller; import org.activiti.engine.repository.Deployment; import org.junit.Test; import com.ln.web.activiti.ActivitiInter; public class ActivitiTest2 extends TestBase{ @Test public void eployment(){ ActivitiInter act=new ActivitiInter(); act.deployProcDefByPath("bpmn/MyProcess.bpmn"); act.startProcessInstanceByKey("myProcess"); } }
activiti中task监听器
activiti中task监听器activiti:delegateExpression中使用的spring初始化的bean 会报couldn't serializ,然后我将我全部引用的类序列化,但是最后报到spring内部的类没有序列化,这我就没辙了,我猜我做法应该是错的,求大神解救 1、监听器代码 ``` @Component public class SubordinateListener implements JavaDelegate, Serializable { private static final long serialVersionUID = 1L; @Autowired private IAdminUserRelService adminUserRelService; @Override public void execute(DelegateExecution execution) throws Exception { System.out.println(); } ``` 2、bpmn ``` <serviceTask id="servicetask2" activiti:delegateExpression="${subordinateListener}" /> ```
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
漫话:什么是平衡(AVL)树?这应该是把AVL树讲的最好的文章了
这篇文章通过对话的形式,由浅入深带你读懂 AVL 树,看完让你保证理解 AVL 树的各种操作,如果觉得不错,别吝啬你的赞哦。 1、若它的左子树不为空,则左子树上所有的节点值都小于它的根节点值。 2、若它的右子树不为空,则右子树上所有的节点值均大于它的根节点值。 3、它的左右子树也分别可以充当为二叉查找树。 例如: 例如,我现在想要查找数值为14的节点。由于二叉查找树的特性,我们可...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
《C++ Primer》学习笔记(六):C++模块设计——函数
专栏C++学习笔记 《C++ Primer》学习笔记/习题答案 总目录 https://blog.csdn.net/TeFuirnever/article/details/100700212 —————————————————————————————————————————————————————— 《C++ Primer》习题参考答案:第6章 - C++模块设计——函数 文章目录专栏C+...
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
相关热词 基于c#波形控件 c# 十进制转十六进制 对文件aes加密vc# c#读取栈中所有的值 c# rsa256加密 好 学c# 还是c++ c# 和java的差距 c# curl网络框架 c# https证书请求 c# 中崎
立即提问