├── .gitignore ├── README.md ├── pom.xml └── src ├── main ├── java │ ├── com │ │ └── ascendant │ │ │ ├── Application.java │ │ │ ├── common │ │ │ ├── constants │ │ │ │ └── SystemConstants.java │ │ │ ├── gen │ │ │ │ └── plugin │ │ │ │ │ ├── GenMain.java │ │ │ │ │ ├── MapperPlugin.java │ │ │ │ │ └── SerializablePlugin.java │ │ │ ├── util │ │ │ │ └── IdGen.java │ │ │ └── web │ │ │ │ └── Result.java │ │ │ ├── core │ │ │ ├── activiti │ │ │ │ └── ext │ │ │ │ │ ├── ActivitiExtendProperties.java │ │ │ │ │ ├── GroupServiceFactory.java │ │ │ │ │ └── UserServiceFactory.java │ │ │ ├── config │ │ │ │ ├── ActivitiConfiguration.java │ │ │ │ ├── CoreConfiguration.java │ │ │ │ └── WebSecurityConfig.java │ │ │ ├── controller │ │ │ │ └── ActModelController.java │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Page.java │ │ │ ├── mapper │ │ │ │ └── BaseMapper.java │ │ │ └── service │ │ │ │ ├── ActModelService.java │ │ │ │ ├── BaseService.java │ │ │ │ └── BaseServiceImpl.java │ │ │ └── module │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ └── UserService.java │ └── org │ │ └── mybatis │ │ └── generator │ │ ├── api │ │ ├── IntrospectedTable.java │ │ └── dom │ │ │ └── OutputUtilities.java │ │ └── codegen │ │ └── mybatis3 │ │ └── xmlmapper │ │ ├── SimpleXMLMapperGenerator.java │ │ └── XMLMapperGenerator.java └── resources │ ├── application.yml │ ├── gen │ ├── generatorConfig.xml │ └── mysql-connector-java-5.1.30.jar │ ├── mappers │ └── module │ │ └── UserMapper.xml │ ├── static │ └── activiti │ │ ├── diagram-viewer │ │ ├── images │ │ │ ├── bg.png │ │ │ ├── breadcrumbs.png │ │ │ ├── checker-bg.png │ │ │ └── deployer │ │ │ │ ├── blue │ │ │ │ └── message_catch.png │ │ │ │ ├── business_rule.png │ │ │ │ ├── error_catch.png │ │ │ │ ├── error_throw.png │ │ │ │ ├── manual.png │ │ │ │ ├── message_catch.png │ │ │ │ ├── message_throw.png │ │ │ │ ├── receive.png │ │ │ │ ├── script.png │ │ │ │ ├── send.png │ │ │ │ ├── service.png │ │ │ │ ├── signal_catch.png │ │ │ │ ├── signal_throw.png │ │ │ │ ├── timer.png │ │ │ │ └── user.png │ │ ├── index.html │ │ ├── js │ │ │ ├── ActivitiRest.js │ │ │ ├── ActivityImpl.js │ │ │ ├── Color.js │ │ │ ├── LineBreakMeasurer.js │ │ │ ├── Polyline.js │ │ │ ├── ProcessDiagramCanvas.js │ │ │ ├── ProcessDiagramGenerator.js │ │ │ ├── jquery │ │ │ │ ├── jquery.asyncqueue.js │ │ │ │ ├── jquery.js │ │ │ │ └── jquery.progressbar.js │ │ │ ├── jstools.js │ │ │ ├── raphael.2.1.1.js │ │ │ ├── raphael.js │ │ │ ├── raphael_uncompressed.js │ │ │ └── textlayout.js │ │ └── style.css │ │ ├── editor-app │ │ ├── app-cfg.js │ │ ├── app.js │ │ ├── configuration │ │ │ ├── properties-assignment-controller.js │ │ │ ├── properties-condition-expression-controller.js │ │ │ ├── properties-custom-controllers.js │ │ │ ├── properties-default-controllers.js │ │ │ ├── properties-event-listeners-controller.js │ │ │ ├── properties-execution-listeners-controller.js │ │ │ ├── properties-fields-controller.js │ │ │ ├── properties-form-properties-controller.js │ │ │ ├── properties-in-parameters-controller.js │ │ │ ├── properties-message-definitions-controller.js │ │ │ ├── properties-message-scope-controller.js │ │ │ ├── properties-multiinstance-controller.js │ │ │ ├── properties-out-parameters-controller.js │ │ │ ├── properties-sequenceflow-order-controller.js │ │ │ ├── properties-signal-definitions-controller.js │ │ │ ├── properties-signal-scope-controller.js │ │ │ ├── properties-task-listeners-controller.js │ │ │ ├── properties.js │ │ │ ├── properties │ │ │ │ ├── assignment-display-template.html │ │ │ │ ├── assignment-popup.html │ │ │ │ ├── assignment-write-template.html │ │ │ │ ├── boolean-property-template.html │ │ │ │ ├── condition-expression-display-template.html │ │ │ │ ├── condition-expression-popup.html │ │ │ │ ├── condition-expression-write-template.html │ │ │ │ ├── default-value-display-template.html │ │ │ │ ├── event-listeners-display-template.html │ │ │ │ ├── event-listeners-popup.html │ │ │ │ ├── event-listeners-write-template.html │ │ │ │ ├── execution-listeners-display-template.html │ │ │ │ ├── execution-listeners-popup.html │ │ │ │ ├── execution-listeners-write-template.html │ │ │ │ ├── feedback-popup.html │ │ │ │ ├── fields-display-template.html │ │ │ │ ├── fields-popup.html │ │ │ │ ├── fields-write-template.html │ │ │ │ ├── form-properties-display-template.html │ │ │ │ ├── form-properties-popup.html │ │ │ │ ├── form-properties-write-template.html │ │ │ │ ├── in-parameters-display-template.html │ │ │ │ ├── in-parameters-popup.html │ │ │ │ ├── in-parameters-write-template.html │ │ │ │ ├── message-definitions-display-template.html │ │ │ │ ├── message-definitions-popup.html │ │ │ │ ├── message-definitions-write-template.html │ │ │ │ ├── message-property-write-template.html │ │ │ │ ├── multiinstance-property-write-template.html │ │ │ │ ├── out-parameters-display-template.html │ │ │ │ ├── out-parameters-popup.html │ │ │ │ ├── out-parameters-write-template.html │ │ │ │ ├── sequenceflow-order-display-template.html │ │ │ │ ├── sequenceflow-order-popup.html │ │ │ │ ├── sequenceflow-order-write-template.html │ │ │ │ ├── signal-definitions-display-template.html │ │ │ │ ├── signal-definitions-popup.html │ │ │ │ ├── signal-definitions-write-template.html │ │ │ │ ├── signal-property-write-template.html │ │ │ │ ├── string-property-write-mode-template.html │ │ │ │ ├── subprocess-reference-display-template.html │ │ │ │ ├── subprocess-reference-popup.html │ │ │ │ ├── subprocess-reference-write-template.html │ │ │ │ ├── task-listeners-display-template.html │ │ │ │ ├── task-listeners-popup.html │ │ │ │ ├── task-listeners-write-template.html │ │ │ │ ├── text-popup.html │ │ │ │ └── text-property-write-template.html │ │ │ ├── toolbar-custom-actions.js │ │ │ ├── toolbar-default-actions.js │ │ │ ├── toolbar.js │ │ │ └── url-config.js │ │ ├── css │ │ │ ├── style-common.css │ │ │ ├── style-editor.css │ │ │ └── style.css │ │ ├── editor-config.js │ │ ├── editor-controller.js │ │ ├── editor-utils.js │ │ ├── editor.html │ │ ├── editor │ │ │ ├── css │ │ │ │ └── editor.css │ │ │ ├── i18n │ │ │ │ ├── translation_de.js │ │ │ │ ├── translation_en_us.js │ │ │ │ ├── translation_signavio_de.js │ │ │ │ └── translation_signavio_en_us.js │ │ │ ├── oryx.debug.js │ │ │ └── oryx.js │ │ ├── eventbus.js │ │ ├── fonts │ │ │ ├── activiti-admin-webfont.eot │ │ │ ├── activiti-admin-webfont.svg │ │ │ ├── activiti-admin-webfont.ttf │ │ │ ├── activiti-admin-webfont.woff │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── header-controller.js │ │ ├── i18n │ │ │ ├── en.json │ │ │ └── zh-CN.json │ │ ├── images │ │ │ ├── bpmn-error.png │ │ │ ├── bpmn-warning.png │ │ │ ├── datadefinition.png │ │ │ ├── delete.png │ │ │ ├── loading.gif │ │ │ ├── logo-2x.png │ │ │ ├── logo.png │ │ │ ├── nw-handle-dark.gif │ │ │ ├── se-handle-dark.gif │ │ │ ├── shapemenu_highlight.png │ │ │ └── wrench.png │ │ ├── libs │ │ │ ├── angular-cookies_1.2.13 │ │ │ │ ├── angular-cookies.min.js │ │ │ │ └── angular-cookies.min.js.map │ │ │ ├── angular-dragdrop.min-1.0.3.js │ │ │ ├── angular-dragdrop_1.0.7 │ │ │ │ └── angular-dragdrop.min.js │ │ │ ├── angular-mocks_1.2.13 │ │ │ │ └── angular-mocks.js │ │ │ ├── angular-resource_1.2.13 │ │ │ │ ├── angular-resource.js │ │ │ │ ├── angular-resource.min.js │ │ │ │ └── angular-resource.min.js.map │ │ │ ├── angular-route_1.2.13 │ │ │ │ ├── angular-route.js │ │ │ │ ├── angular-route.min.js │ │ │ │ └── angular-route.min.js.map │ │ │ ├── angular-sanitize_1.2.13 │ │ │ │ ├── angular-sanitize.js │ │ │ │ ├── angular-sanitize.min.js │ │ │ │ └── angular-sanitize.min.js.map │ │ │ ├── angular-scroll_0.5.7 │ │ │ │ └── angular-scroll.min.js │ │ │ ├── angular-strap_2.0.5 │ │ │ │ ├── angular-strap.min.js │ │ │ │ └── angular-strap.tpl.min.js │ │ │ ├── angular-translate-loader-static-files │ │ │ │ ├── .bower.json │ │ │ │ ├── angular-translate-loader-static-files.js │ │ │ │ └── angular-translate-loader-static-files.min.js │ │ │ ├── angular-translate-storage-cookie │ │ │ │ ├── .bower.json │ │ │ │ ├── angular-translate-storage-cookie.js │ │ │ │ └── angular-translate-storage-cookie.min.js │ │ │ ├── angular-translate_2.4.2 │ │ │ │ ├── angular-translate.js │ │ │ │ └── angular-translate.min.js │ │ │ ├── angular_1.2.13 │ │ │ │ ├── angular-animate.min.js │ │ │ │ └── angular.min.js │ │ │ ├── bootstrap-daterangepicker_1.3.7 │ │ │ │ ├── daterangepicker-bs3.css │ │ │ │ └── daterangepicker.js │ │ │ ├── bootstrap_3.1.1 │ │ │ │ ├── css │ │ │ │ │ ├── bootstrap-theme.css │ │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ │ ├── bootstrap.css │ │ │ │ │ ├── bootstrap.css.map │ │ │ │ │ └── bootstrap.min.css │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ │ └── js │ │ │ │ │ ├── bootstrap.js │ │ │ │ │ └── bootstrap.min.js │ │ │ ├── es5-shim-15.3.4.5 │ │ │ │ ├── .bower.json │ │ │ │ ├── .gitignore │ │ │ │ ├── CHANGES │ │ │ │ ├── CONTRIBUTORS.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── es5-sham.js │ │ │ │ ├── es5-sham.map │ │ │ │ ├── es5-sham.min.js │ │ │ │ ├── es5-shim.js │ │ │ │ ├── es5-shim.map │ │ │ │ ├── es5-shim.min.js │ │ │ │ ├── package.json │ │ │ │ └── tests │ │ │ │ │ ├── helpers │ │ │ │ │ ├── h-kill.js │ │ │ │ │ ├── h-matchers.js │ │ │ │ │ └── h.js │ │ │ │ │ ├── index.html │ │ │ │ │ ├── index.min.html │ │ │ │ │ ├── lib │ │ │ │ │ ├── jasmine-html.js │ │ │ │ │ ├── jasmine.css │ │ │ │ │ ├── jasmine.js │ │ │ │ │ ├── jasmine_favicon.png │ │ │ │ │ └── json2.js │ │ │ │ │ └── spec │ │ │ │ │ ├── s-array.js │ │ │ │ │ ├── s-date.js │ │ │ │ │ ├── s-function.js │ │ │ │ │ ├── s-number.js │ │ │ │ │ ├── s-object.js │ │ │ │ │ └── s-string.js │ │ │ ├── jquery-ui-1.10.3.custom.min.js │ │ │ ├── jquery.autogrow-textarea.js │ │ │ ├── jquery_1.11.0 │ │ │ │ ├── jquery.js │ │ │ │ ├── jquery.min.js │ │ │ │ └── jquery.min.map │ │ │ ├── json3_3.2.6 │ │ │ │ ├── LICENSE │ │ │ │ └── lib │ │ │ │ │ ├── json3.js │ │ │ │ │ └── json3.min.js │ │ │ ├── momentjs_2.5.1 │ │ │ │ └── momentjs.min.js │ │ │ ├── mousetrap-1.4.5.min.js │ │ │ ├── ng-grid-2.0.7-min.js │ │ │ ├── ng-grid-2.0.7.min.css │ │ │ ├── path_parser.js │ │ │ ├── prototype-1.5.1.js │ │ │ └── ui-utils.min-0.0.4.js │ │ ├── partials │ │ │ ├── root-stencil-item-template.html │ │ │ └── stencil-item-template.html │ │ ├── plugins.xml │ │ ├── popups │ │ │ ├── icon-template.html │ │ │ ├── save-model.html │ │ │ ├── select-shape.html │ │ │ └── unsaved-changes.html │ │ ├── select-shape-controller.js │ │ ├── stencil-controller.js │ │ ├── stencilsets │ │ │ └── bpmn2.0 │ │ │ │ └── icons │ │ │ │ ├── activity │ │ │ │ ├── event.subprocess.collapsed.png │ │ │ │ ├── event.subprocess.png │ │ │ │ ├── expanded.subprocess.png │ │ │ │ ├── list │ │ │ │ │ ├── type.business.rule.png │ │ │ │ │ ├── type.camel.png │ │ │ │ │ ├── type.manual.png │ │ │ │ │ ├── type.mule.png │ │ │ │ │ ├── type.receive.png │ │ │ │ │ ├── type.script.png │ │ │ │ │ ├── type.send.png │ │ │ │ │ ├── type.service.png │ │ │ │ │ ├── type.shell.png │ │ │ │ │ └── type.user.png │ │ │ │ ├── subprocess.png │ │ │ │ └── task.png │ │ │ │ ├── artifact │ │ │ │ └── text.annotation.png │ │ │ │ ├── catching │ │ │ │ ├── cancel.png │ │ │ │ ├── compensation.png │ │ │ │ ├── error.png │ │ │ │ ├── message.png │ │ │ │ ├── signal.png │ │ │ │ └── timer.png │ │ │ │ ├── connector │ │ │ │ ├── association.undirected.png │ │ │ │ ├── association.unidirectional.png │ │ │ │ ├── messageflow.png │ │ │ │ └── sequenceflow.png │ │ │ │ ├── dataobject │ │ │ │ └── data.store.png │ │ │ │ ├── diagram.png │ │ │ │ ├── endevent │ │ │ │ ├── cancel.png │ │ │ │ ├── error.png │ │ │ │ ├── none.png │ │ │ │ └── terminate.png │ │ │ │ ├── gateway │ │ │ │ ├── eventbased.png │ │ │ │ ├── exclusive.databased.png │ │ │ │ ├── inclusive.png │ │ │ │ └── parallel.png │ │ │ │ ├── startevent │ │ │ │ ├── error.png │ │ │ │ ├── message.png │ │ │ │ ├── none.png │ │ │ │ ├── signal.png │ │ │ │ └── timer.png │ │ │ │ ├── swimlane │ │ │ │ ├── lane.png │ │ │ │ └── pool.png │ │ │ │ └── throwing │ │ │ │ ├── none.png │ │ │ │ └── signal.png │ │ └── toolbar-controller.js │ │ └── modeler.html │ └── stencilset.json └── test ├── java └── com │ └── ascendant │ ├── ApplicationTests.java │ ├── activiti │ └── ActivitTest.java │ └── module │ └── mapper │ └── test │ └── UserMapperTest.java └── resources └── bpmn └── Leave.bpmn /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /target/ 3 | *.class 4 | *.bak 5 | forward.iml 6 | /.settings/ 7 | .classpath 8 | .factorypath 9 | .project 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/README.md -------------------------------------------------------------------------------- /src/main/java/com/ascendant/Application.java: -------------------------------------------------------------------------------- 1 | package com.ascendant; 2 | 3 | import org.activiti.spring.boot.SecurityAutoConfiguration; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | @MapperScan("com.ascendant.**.mapper") 9 | @SpringBootApplication(exclude = SecurityAutoConfiguration.class) 10 | public class Application { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(Application.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/common/constants/SystemConstants.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.common.constants; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 计算机系统信息常量 7 | * @author qiaolin 8 | * @date 2018年10月23日 9 | * 10 | */ 11 | 12 | public interface SystemConstants { 13 | 14 | /** 计算机基本信息 */ 15 | public static final Map map = System.getenv(); 16 | 17 | /** 计算机当前登录的 用户名 */ 18 | public static final String USERNAME = map.get("USERNAME"); 19 | 20 | /** 计算机名 */ 21 | public static final String COMPUTERNAME = map.get("COMPUTERNAME"); 22 | 23 | /** JavaHome*/ 24 | public static final String JAVA_HOME = map.get("JAVA_HOME"); 25 | 26 | /** 系统零时路径 */ 27 | public static final String TEMP = map.get("TEMP"); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/common/gen/plugin/GenMain.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.common.gen.plugin; 2 | 3 | import java.io.File; 4 | import java.io.InputStream; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.mybatis.generator.api.MyBatisGenerator; 9 | import org.mybatis.generator.config.Configuration; 10 | import org.mybatis.generator.config.xml.ConfigurationParser; 11 | import org.mybatis.generator.internal.DefaultShellCallback; 12 | import sun.nio.cs.Surrogate; 13 | 14 | public class GenMain { 15 | public static void main(String[] args) throws Exception { 16 | List warnings = new ArrayList(); 17 | boolean overwrite = true; 18 | ConfigurationParser cp = new ConfigurationParser(warnings); 19 | InputStream resourceAsStream = GenMain.class.getResourceAsStream("/gen/generatorConfig.xml"); 20 | 21 | Configuration config = cp.parseConfiguration(resourceAsStream 22 | ); 23 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 24 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); 25 | myBatisGenerator.generate(null); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/common/util/IdGen.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.common.util; 2 | 3 | import org.activiti.engine.impl.cfg.IdGenerator; 4 | import org.springframework.context.annotation.Lazy; 5 | import org.springframework.stereotype.Component; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.UUID; 9 | 10 | /** 11 | * 12 | * uuid生成工具类 13 | * @author qiaolin 14 | * @version 2018/10/22 15 | **/ 16 | 17 | @Component 18 | @Lazy(false) 19 | public class IdGen implements IdGenerator{ 20 | 21 | 22 | public static String uuid(){ 23 | return UUID.randomUUID().toString().replaceAll("-", ""); 24 | } 25 | 26 | 27 | @Override 28 | public String getNextId() { 29 | return uuid(); 30 | } 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/common/web/Result.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.common.web; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * 11 | * 请求响应类 12 | * @author qiaolin 13 | * @version 2018/10/24 14 | **/ 15 | 16 | 17 | @Getter 18 | @Setter 19 | public class Result { 20 | 21 | private boolean success = true; 22 | private String msg = "操作成功!"; 23 | private Map data = new HashMap<>(); 24 | 25 | /** 26 | * 添加其他数据 27 | * @param key 28 | * @param value 29 | */ 30 | public void put(String key, String value){ 31 | data.put(key, value); 32 | } 33 | 34 | /** 35 | * 删除已经添加得数据 36 | * @param key 37 | */ 38 | public void remove(String key){ 39 | data.remove(key); 40 | } 41 | 42 | /** 43 | * 返回一个成功的响应对象 44 | * @return 45 | */ 46 | public static Result ok(){ 47 | return new Result(); 48 | } 49 | 50 | /** 51 | * 返回一个成功的响应对象并指定消息 52 | * @param msg 消息 53 | * @return 54 | */ 55 | public static Result ok(String msg){ 56 | Result result = new Result(); 57 | result.setMsg(msg); 58 | return result; 59 | } 60 | 61 | /** 62 | * 返回一个失败的响应消息,消息默认为操作失败 63 | * @return 64 | */ 65 | public static Result error(){ 66 | Result result = new Result(); 67 | result.setSuccess(false); 68 | result.setMsg("操作失败!"); 69 | return result; 70 | } 71 | 72 | /** 73 | * 返回一个失败的响应消息,并指定消息 74 | * @return 75 | */ 76 | public static Result error(String msg){ 77 | Result result = new Result(); 78 | result.setSuccess(false); 79 | result.setMsg(msg); 80 | return result; 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/activiti/ext/ActivitiExtendProperties.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.activiti.ext; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.activiti.engine.impl.interceptor.SessionFactory; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 12 | * 因为Activiti 的配置类所配置的内容十分有限,所以我自己写了一个扩展类,来扩展 13 | * 其他可能会用道德配置 14 | * @author qiaolin 15 | * @version 2018/10/22 16 | **/ 17 | 18 | @Getter 19 | @Setter 20 | @ConfigurationProperties(prefix = "spring.activiti.ext") 21 | public class ActivitiExtendProperties { 22 | 23 | 24 | // 流程定义缓存数量 25 | private int processDefinitionCacheLimit; 26 | 27 | // 是否自动创建数据库 28 | private String databaseSchemaUpdate = "false"; 29 | 30 | // 流程图字体配置 31 | private String activityFontName = "宋体"; 32 | private String labelFontName = "宋体"; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/activiti/ext/GroupServiceFactory.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.activiti.ext; 2 | 3 | import org.activiti.engine.identity.Group; 4 | import org.activiti.engine.impl.interceptor.Session; 5 | import org.activiti.engine.impl.interceptor.SessionFactory; 6 | import org.activiti.engine.impl.persistence.entity.GroupEntityManager; 7 | import org.activiti.engine.impl.persistence.entity.GroupIdentityManager; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 自定义组服务对象工厂 13 | * @author qiaolin 14 | * @version 2018/10/22 15 | **/ 16 | public class GroupServiceFactory extends GroupEntityManager implements SessionFactory{ 17 | 18 | // 返回原始的组管理类型 19 | @Override 20 | public Class getSessionType() { 21 | return GroupIdentityManager.class; 22 | } 23 | 24 | // 返回自定义的组管理对象 25 | @Override 26 | public Session openSession() { 27 | return this; 28 | } 29 | 30 | /** 31 | * 根据用户Id查询用户得角色并转换成 Activiti的 Group对象 32 | * @param userId 33 | * @return 34 | */ 35 | @Override 36 | public List findGroupsByUser(String userId) { 37 | // TODO 这里需要返回用户的角色 38 | return super.findGroupsByUser(userId); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/activiti/ext/UserServiceFactory.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.activiti.ext; 2 | 3 | import org.activiti.engine.identity.Group; 4 | import org.activiti.engine.identity.User; 5 | import org.activiti.engine.identity.UserQuery; 6 | import org.activiti.engine.impl.Page; 7 | import org.activiti.engine.impl.UserQueryImpl; 8 | import org.activiti.engine.impl.interceptor.Session; 9 | import org.activiti.engine.impl.interceptor.SessionFactory; 10 | import org.activiti.engine.impl.persistence.entity.IdentityInfoEntity; 11 | import org.activiti.engine.impl.persistence.entity.UserEntity; 12 | import org.activiti.engine.impl.persistence.entity.UserEntityManager; 13 | import org.activiti.engine.impl.persistence.entity.UserIdentityManager; 14 | 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | /** 19 | * 自定义用户服务对象工厂 20 | * @author qiaolin 21 | * @version 2018/10/22 22 | **/ 23 | public class UserServiceFactory extends UserEntityManager implements SessionFactory{ 24 | 25 | @Override 26 | public Class getSessionType() { 27 | return UserIdentityManager.class; 28 | } 29 | 30 | @Override 31 | public Session openSession() { 32 | return this; 33 | } 34 | 35 | 36 | @Override 37 | public User findUserById(String userId) { 38 | // TODO 这里需要去用户表查询数据并转换成Activiti 的 User对象 39 | 40 | return super.findUserById(userId); 41 | } 42 | 43 | 44 | @Override 45 | public List findGroupsByUser(String userId) { 46 | // TODO 这里需要查询该用户Id的角色有哪些 ,并转换 47 | 48 | return super.findGroupsByUser(userId); 49 | } 50 | 51 | 52 | 53 | 54 | @Override 55 | public void deleteUser(String userId) { 56 | throw new RuntimeException("not implement method."); 57 | } 58 | 59 | public void insertUser(User user) { 60 | throw new RuntimeException("not implement method."); 61 | } 62 | 63 | public void updateUser(UserEntity updatedUser) { 64 | throw new RuntimeException("not implement method."); 65 | } 66 | 67 | public List findUserByQueryCriteria(UserQueryImpl query, Page page) { 68 | throw new RuntimeException("not implement method."); 69 | } 70 | 71 | public long findUserCountByQueryCriteria(UserQueryImpl query) { 72 | throw new RuntimeException("not implement method."); 73 | } 74 | 75 | public UserQuery createNewUserQuery() { 76 | throw new RuntimeException("not implement method."); 77 | } 78 | 79 | public IdentityInfoEntity findUserInfoByUserIdAndKey(String userId, String key) { 80 | throw new RuntimeException("not implement method."); 81 | } 82 | 83 | public List findUserInfoKeysByUserIdAndType(String userId, String type) { 84 | throw new RuntimeException("not implement method."); 85 | } 86 | 87 | public Boolean checkPassword(String userId, String password) { 88 | throw new RuntimeException("not implement method."); 89 | } 90 | 91 | public List findPotentialStarterUsers(String proceDefId) { 92 | throw new RuntimeException("not implement method."); 93 | } 94 | 95 | public List findUsersByNativeQuery(Map parameterMap, int firstResult, int maxResults) { 96 | throw new RuntimeException("not implement method."); 97 | } 98 | 99 | public long findUserCountByNativeQuery(Map parameterMap) { 100 | throw new RuntimeException("not implement method."); 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/config/ActivitiConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.config; 2 | 3 | import com.ascendant.common.util.IdGen; 4 | import com.ascendant.core.activiti.ext.ActivitiExtendProperties; 5 | import com.ascendant.core.activiti.ext.GroupServiceFactory; 6 | import com.ascendant.core.activiti.ext.UserServiceFactory; 7 | import org.activiti.engine.impl.interceptor.SessionFactory; 8 | import org.activiti.spring.SpringProcessEngineConfiguration; 9 | import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 12 | import org.springframework.context.ApplicationContext; 13 | import org.springframework.context.annotation.Bean; 14 | import org.springframework.context.annotation.ComponentScan; 15 | import org.springframework.context.annotation.Configuration; 16 | 17 | import java.util.ArrayList; 18 | import java.util.HashMap; 19 | import java.util.List; 20 | import java.util.Map; 21 | 22 | /** 23 | * Activiti 扩展配置 24 | * @author qiaolin 25 | * @version 2018/10/22 26 | **/ 27 | 28 | @Configuration 29 | @ComponentScan({"org.activiti.rest.diagram","org.activiti.rest.editor"}) 30 | @EnableConfigurationProperties(ActivitiExtendProperties.class) 31 | public class ActivitiConfiguration { 32 | 33 | @Autowired 34 | private ApplicationContext applicationContext; 35 | 36 | @Autowired 37 | private ActivitiExtendProperties properties; 38 | 39 | @Bean 40 | public ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer(IdGen idGen){ 41 | ProcessEngineConfigurationConfigurer configurer = new ProcessEngineConfigurationConfigurer() { 42 | 43 | @Override 44 | public void configure(SpringProcessEngineConfiguration processEngineConfiguration) { 45 | processEngineConfiguration.setActivityFontName(properties.getActivityFontName()); 46 | processEngineConfiguration.setLabelFontName(properties.getLabelFontName()); 47 | processEngineConfiguration.setCustomSessionFactories(getCustomSessionFactories()); 48 | processEngineConfiguration.setBeans(getBeans()); 49 | processEngineConfiguration.setIdGenerator(idGen); 50 | processEngineConfiguration.setDatabaseSchemaUpdate(properties.getDatabaseSchemaUpdate()); 51 | 52 | } 53 | 54 | }; 55 | 56 | return configurer; 57 | } 58 | 59 | /** 60 | * 用户自定义权限工厂 61 | * @return 62 | */ 63 | private List getCustomSessionFactories(){ 64 | List sessionFactoryList = new ArrayList<>(); 65 | // TODO 等用户权限做好了再开启这两个 66 | //sessionFactoryList.add(new GroupServiceFactory()); 67 | //sessionFactoryList.add(new UserServiceFactory()); 68 | return sessionFactoryList; 69 | } 70 | 71 | /** 72 | * 需要spring 代理的bean 请在该方法中加入 73 | * @return 74 | */ 75 | private Map getBeans(){ 76 | Map beans = new HashMap<>(); 77 | 78 | return beans; 79 | } 80 | 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/config/CoreConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.config; 2 | 3 | import com.alibaba.druid.pool.DruidDataSource; 4 | import com.alibaba.druid.support.http.StatViewServlet; 5 | import com.alibaba.druid.support.http.WebStatFilter; 6 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; 7 | import org.springframework.boot.context.properties.ConfigurationProperties; 8 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 9 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | import org.springframework.jdbc.datasource.DataSourceTransactionManager; 13 | import org.springframework.transaction.PlatformTransactionManager; 14 | 15 | import javax.sql.DataSource; 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | /** 20 | * 21 | * 核心配置 22 | * @author qiaolin 23 | * @version 2018/10/22 24 | **/ 25 | 26 | @Configuration 27 | public class CoreConfiguration { 28 | 29 | 30 | 31 | /** 32 | * 阿里巴巴 Druid 数据源 33 | * @return 34 | */ 35 | @Bean 36 | @ConfigurationProperties("spring.datasource") 37 | public DataSource dataSource(){ 38 | return new DruidDataSource(); 39 | } 40 | 41 | 42 | /** 43 | * 事务管理器 44 | * @return 45 | */ 46 | @Bean 47 | public PlatformTransactionManager transactionManager(){ 48 | return new DataSourceTransactionManager(dataSource()); 49 | } 50 | 51 | 52 | 53 | /** 54 | * druidServlet 管理页 55 | * @return 56 | */ 57 | @Bean 58 | public ServletRegistrationBean druidServlet(){ 59 | StatViewServlet statViewServlet = new StatViewServlet(); 60 | ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(statViewServlet, "/druid/*"); 61 | 62 | Map params = new HashMap<>(); 63 | params.put("loginUsername", "admin"); 64 | params.put("loginPassword", "123456"); 65 | servletRegistrationBean.setInitParameters(params); 66 | return servletRegistrationBean; 67 | } 68 | 69 | /** 70 | * druidServlet 拦截器 71 | * @return 72 | */ 73 | @Bean 74 | public FilterRegistrationBean druidFilter(){ 75 | WebStatFilter webStatFilter = new WebStatFilter(); 76 | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); 77 | filterRegistrationBean.setFilter(webStatFilter); 78 | filterRegistrationBean.addUrlPatterns("/*"); 79 | Map params = new HashMap<>(); 80 | params.put("exclusions", "*.js,*.css,/druid/"); 81 | filterRegistrationBean.setInitParameters(params); 82 | return filterRegistrationBean; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/config/WebSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 5 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 6 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 7 | 8 | /** 9 | * 10 | * 由于发送Put请求啥的好像要权限认证, 11 | * 先设置某些url不认证 12 | * @author qiaolin 13 | * @version 2018/10/23 14 | **/ 15 | 16 | @Configuration 17 | @EnableWebSecurity 18 | public class WebSecurityConfig extends WebSecurityConfigurerAdapter { 19 | 20 | @Override 21 | protected void configure(HttpSecurity http) throws Exception { 22 | // 关闭csrf保护功能(跨域访问) 23 | http.csrf().disable() 24 | .authorizeRequests() 25 | .antMatchers("/model/**").permitAll();//访问API下无需登录认证权限 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/entity/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.fasterxml.jackson.annotation.JsonIgnore; 7 | import lombok.Data; 8 | 9 | /** 10 | * @author qiaolin 11 | * @version 2018/10/23 12 | **/ 13 | 14 | @Data 15 | public class BaseEntity implements Serializable{ 16 | 17 | /** 18 | * 19 | */ 20 | private static final long serialVersionUID = 1133831723343809504L; 21 | 22 | /** 23 | * 主键 24 | */ 25 | private String id; 26 | 27 | /** 28 | * 创建者 29 | */ 30 | private String createBy; 31 | 32 | /** 33 | * 创建时间 34 | */ 35 | private Date createTime; 36 | 37 | 38 | /** 39 | * 修改者 40 | */ 41 | private String updateBy; 42 | 43 | /** 44 | * 修改时间 45 | */ 46 | private Date updateTime; 47 | 48 | /** 49 | * 分页对象 50 | */ 51 | @JsonIgnore 52 | private Page page; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/entity/Page.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.entity; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.stereotype.Service; 6 | 7 | /** 8 | * 分页对象 9 | * @author qiaolin 10 | * @version 2018/10/23 11 | **/ 12 | 13 | @Getter 14 | @Setter 15 | public class Page { 16 | 17 | private Integer pageNum = 1; 18 | private Integer pageSize = 10; 19 | private String orderBy; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/mapper/BaseMapper.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.mapper; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author qiaolin 7 | * @version 2018/10/23 8 | **/ 9 | public interface BaseMapper { 10 | 11 | /** 12 | * 新增一条数据 13 | * @param e 待新增的数据 14 | * @return 15 | */ 16 | int insert(E e); 17 | 18 | /** 19 | * 修改一条数据 20 | * @param e 待修改的数据 21 | * @return 22 | */ 23 | int update(E e); 24 | 25 | /** 26 | * 根据id 删除一条数据 27 | * @param id 28 | * @return 29 | */ 30 | int delete(String id); 31 | 32 | 33 | /** 34 | * 默认根据对象内的id删除一条数据,可以扩展 35 | * @param e 36 | * @return 37 | */ 38 | int delete(E e); 39 | 40 | 41 | /** 42 | * 根据对象查询数据 43 | * @param e 查询条件 44 | * @return 45 | */ 46 | List findList(E e); 47 | 48 | 49 | /** 50 | * 根据Id查询数据 51 | * @param id 52 | * @return 53 | */ 54 | E findById(String id); 55 | 56 | /** 57 | * 根据对象中Id查询数据 58 | * @param e 59 | * @return 60 | */ 61 | E findById(E e); 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/service/BaseService.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.service; 2 | 3 | import com.ascendant.core.entity.BaseEntity; 4 | import com.github.pagehelper.PageInfo; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * service 基础接口 10 | * @author qiaolin 11 | * @version 2018/10/24 12 | **/ 13 | public interface BaseService { 14 | 15 | /** 16 | * 新增或修改一条数据 17 | * @param e 18 | * @return 19 | */ 20 | int save(E e); 21 | 22 | /** 23 | * 根据id 删除一条数据 24 | * @param id 25 | * @return 26 | */ 27 | int delete(String id); 28 | 29 | 30 | /** 31 | * 默认根据对象内的id删除一条数据,可以扩展 32 | * @param e 33 | * @return 34 | */ 35 | int delete(E e); 36 | 37 | 38 | /** 39 | * 根据对象查询数据 40 | * @param e 查询条件 41 | * @return 42 | */ 43 | PageInfo findPage(E e); 44 | 45 | 46 | /** 47 | * 根据Id查询数据 48 | * @param id 49 | * @return 50 | */ 51 | E findById(String id); 52 | 53 | /** 54 | * 根据对象中Id查询数据 55 | * @param e 56 | * @return 57 | */ 58 | E findById(E e); 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/core/service/BaseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.core.service; 2 | 3 | import com.ascendant.common.util.IdGen; 4 | import com.ascendant.core.entity.BaseEntity; 5 | import com.ascendant.core.entity.Page; 6 | import com.ascendant.core.mapper.BaseMapper; 7 | import com.github.pagehelper.PageHelper; 8 | import com.github.pagehelper.PageInfo; 9 | import org.apache.commons.lang3.StringUtils; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.util.Date; 14 | import java.util.List; 15 | import java.util.Objects; 16 | 17 | /** 18 | * @author qiaolin 19 | * @version 2018/10/24 20 | **/ 21 | public class BaseServiceImpl> implements BaseService { 22 | 23 | @Autowired 24 | protected M mapper; 25 | 26 | @Transactional 27 | public int save(E e){ 28 | Date now = new Date(); 29 | e.setUpdateTime(now); 30 | // TODO 这里得新增和修改人暂时为1 后面再修改 31 | e.setUpdateBy("1"); 32 | if(StringUtils.isBlank(e.getId())) { 33 | e.setId(IdGen.uuid()); 34 | e.setCreateBy("1"); 35 | e.setCreateTime(now); 36 | return mapper.insert(e); 37 | } 38 | return mapper.update(e); 39 | } 40 | 41 | @Override 42 | public int delete(String id) { 43 | return mapper.delete(id); 44 | } 45 | 46 | @Override 47 | public int delete(E e) { 48 | return mapper.delete(e); 49 | } 50 | 51 | @Override 52 | public PageInfo findPage(E e) { 53 | Page page = e.getPage(); 54 | if(Objects.nonNull(page)){ 55 | if(StringUtils.isNotBlank(page.getOrderBy())){ 56 | PageHelper.startPage(page.getPageNum(), page.getPageSize(), page.getOrderBy()); 57 | }else{ 58 | PageHelper.startPage(page.getPageNum(), page.getPageSize()); 59 | } 60 | } 61 | 62 | return new PageInfo(mapper.findList(e)); 63 | } 64 | 65 | @Override 66 | public E findById(String id) { 67 | return mapper.findById(id); 68 | } 69 | 70 | @Override 71 | public E findById(E e) { 72 | return mapper.findById(e); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/module/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.module.controller; 2 | 3 | import com.ascendant.common.web.Result; 4 | import com.ascendant.module.entity.User; 5 | import com.ascendant.module.service.UserService; 6 | import com.github.pagehelper.PageInfo; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | /** 11 | * @author qiaolin 12 | * @version 2018/10/24 13 | **/ 14 | 15 | @RestController 16 | @RequestMapping("user") 17 | public class UserController { 18 | 19 | @Autowired 20 | private UserService userService; 21 | 22 | 23 | 24 | @GetMapping("data") 25 | public PageInfo data(User user){ 26 | return userService.findPage(user); 27 | } 28 | 29 | @GetMapping("{id}") 30 | public User get(@PathVariable String id){ 31 | return userService.findById(id); 32 | } 33 | 34 | @PutMapping("save") 35 | public Result save(User user){ 36 | userService.save(user); 37 | return Result.ok(); 38 | } 39 | 40 | @DeleteMapping("{id}") 41 | public Result delete(@PathVariable String id){ 42 | userService.delete(id); 43 | return Result.ok("删除成功"); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/ascendant/module/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.module.entity; 2 | 3 | import com.ascendant.core.entity.BaseEntity; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * @author qiaolin 10 | * @date 2018-10-24 15:53:59 11 | */ 12 | 13 | @Data 14 | @NoArgsConstructor 15 | @EqualsAndHashCode(callSuper = false) 16 | public class User extends BaseEntity { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 姓名 */ 20 | private String name; 21 | 22 | /** 年龄 */ 23 | private Integer age; 24 | 25 | /** 邮箱 */ 26 | private String email; 27 | } -------------------------------------------------------------------------------- /src/main/java/com/ascendant/module/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.module.mapper; 2 | 3 | import com.ascendant.core.mapper.BaseMapper; 4 | import com.ascendant.module.entity.User; 5 | 6 | /** 7 | * @author qiaolin 8 | * @date 2018-10-24 15:53:59 9 | */ 10 | 11 | public interface UserMapper extends BaseMapper { 12 | } -------------------------------------------------------------------------------- /src/main/java/com/ascendant/module/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.module.service; 2 | 3 | import com.ascendant.core.service.BaseServiceImpl; 4 | import com.ascendant.module.entity.User; 5 | import com.ascendant.module.mapper.UserMapper; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | * 用户service 10 | * @author qiaolin 11 | * @version 2018/10/24 12 | **/ 13 | 14 | @Service 15 | public class UserService extends BaseServiceImpl { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006 The Apache Software Foundation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mybatis.generator.api.dom; 17 | 18 | import java.util.Set; 19 | import java.util.TreeSet; 20 | 21 | import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; 22 | 23 | /** 24 | * @author Jeff Butler 25 | */ 26 | public class OutputUtilities { 27 | private static final String lineSeparator; 28 | 29 | static { 30 | String ls = System.getProperty("line.separator"); //$NON-NLS-1$ 31 | if (ls == null) { 32 | ls = "\n"; //$NON-NLS-1$ 33 | } 34 | lineSeparator = ls; 35 | } 36 | 37 | /** 38 | * Utility class - no instances allowed 39 | */ 40 | private OutputUtilities() { 41 | super(); 42 | } 43 | 44 | /** 45 | * Utility method that indents the buffer by the default amount for Java 46 | * (four spaces per indent level). 47 | * 48 | * @param sb 49 | * a StringBuilder to append to 50 | * @param indentLevel 51 | * the required indent level 52 | */ 53 | public static void javaIndent(StringBuilder sb, int indentLevel) { 54 | for (int i = 0; i < indentLevel; i++) { 55 | sb.append(" "); //$NON-NLS-1$ 56 | } 57 | } 58 | 59 | /** 60 | * Utility method that indents the buffer by the default amount for XML (two 61 | * spaces per indent level). 62 | * 63 | * @param sb 64 | * a StringBuilder to append to 65 | * @param indentLevel 66 | * the required indent level 67 | */ 68 | public static void xmlIndent(StringBuilder sb, int indentLevel) { 69 | for (int i = 0; i < indentLevel; i++) { 70 | sb.append(" "); //$NON-NLS-1$ 71 | } 72 | } 73 | 74 | /** 75 | * Utility method. Adds a newline character to a StringBuilder. 76 | * 77 | * @param sb 78 | * the StringBuilder to be appended to 79 | */ 80 | public static void newLine(StringBuilder sb) { 81 | sb.append(lineSeparator); 82 | } 83 | 84 | /** 85 | * returns a unique set of "import xxx;" Strings for the set of types 86 | * 87 | * @param importedTypes 88 | * @return 89 | */ 90 | public static Set calculateImports( 91 | Set importedTypes) { 92 | StringBuilder sb = new StringBuilder(); 93 | Set importStrings = new TreeSet(); 94 | for (FullyQualifiedJavaType fqjt : importedTypes) { 95 | for (String importString : fqjt.getImportList()) { 96 | sb.setLength(0); 97 | sb.append("import "); //$NON-NLS-1$ 98 | sb.append(importString); 99 | sb.append(';'); 100 | importStrings.add(sb.toString()); 101 | } 102 | } 103 | 104 | return importStrings; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | 3 | spring: 4 | #Activiti property configuration 5 | activiti: 6 | database-schema-update: false 7 | job-executor-activate: true 8 | history-level: full 9 | check-process-definitions: false 10 | ext: 11 | database-schema-update: false 12 | 13 | #不生成identity 相关表 14 | #db-identity-used: false 15 | 16 | #数据源配置,这里使用 阿里的 druid 17 | datasource: 18 | url: jdbc:mysql://47.98.193.222:13306/forward?useUnicode=true&characterEncoding=utf-8 19 | username: root 20 | password: 123456 21 | driver-class-name: com.mysql.jdbc.Driver 22 | type: com.alibaba.druid.pool.DruidDataSource 23 | 24 | #2.0以后开启这个 initialization-mode 才会自动执行sql脚本 25 | initialization-mode: always 26 | 27 | #初始化连接数 28 | initialSize: 5 29 | minIdle: 5 30 | maxActive: 20 31 | maxWait: 60000 32 | timeBetweenEvictionRunsMillis: 60000 33 | minEvictableIdleTimeMillis: 300000 34 | validationQuery: SELECT 1 FROM DUAL 35 | testWhileIdle: true 36 | testOnBorrow: false 37 | testOnReturn: false 38 | poolPreparedStatements: true 39 | #配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 40 | filters: stat,wall,log4j 41 | maxPoolPreparedStatementPerConnectionSize: 20 42 | useGlobalDataSourceStat: true 43 | connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500 44 | 45 | 46 | #日志 47 | logging: 48 | level: 49 | # org.apache.ibatis: DEBUG 50 | com.ascendant: debug 51 | pattern: 52 | console: "%d{yyyy-MM-dd HH:mm:ss.SSS} %clr(-%5p) %clr(${PID:- }){magenta} --- %clr([%15.15t]){faint} %highlight(%-80.80logger{300}){cyan} %clr(:) %m %n%wEx" 53 | 54 | 55 | #MyBatis 配置 56 | mybatis: 57 | mapper-locations: classpath:mappers/**/*Mapper.xml 58 | type-aliases-package: com.ascendant.core.entity,com.ascendant.module.entity 59 | configuration: 60 | map-underscore-to-camel-case: true 61 | 62 | 63 | # pagehelper 64 | pagehelper: 65 | helperDialect: mysql 66 | reasonable: true 67 | supportMethodsArguments: true 68 | params: count=countSql 69 | 70 | #debug: true 71 | -------------------------------------------------------------------------------- /src/main/resources/gen/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
69 | 70 |
71 |
-------------------------------------------------------------------------------- /src/main/resources/gen/mysql-connector-java-5.1.30.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/gen/mysql-connector-java-5.1.30.jar -------------------------------------------------------------------------------- /src/main/resources/mappers/module/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | insert into user (id, name, age, 14 | email) 15 | values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, 16 | #{email,jdbcType=VARCHAR}) 17 | 18 | 19 | 20 | update user 21 | set name = #{name,jdbcType=VARCHAR}, 22 | age = #{age,jdbcType=INTEGER}, 23 | email = #{email,jdbcType=VARCHAR} 24 | where id = #{id,jdbcType=VARCHAR} 25 | 26 | 27 | 28 | delete from user 29 | where id = #{id,jdbcType=VARCHAR} 30 | 31 | 32 | 35 | 36 | 48 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/bg.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/breadcrumbs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/breadcrumbs.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/checker-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/checker-bg.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/blue/message_catch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/blue/message_catch.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/business_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/business_rule.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/error_catch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/error_catch.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/error_throw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/error_throw.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/manual.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/message_catch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/message_catch.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/message_throw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/message_throw.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/receive.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/script.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/send.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/service.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/signal_catch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/signal_catch.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/signal_throw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/signal_throw.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/timer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/timer.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/images/deployer/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/images/deployer/user.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/js/ActivitiRest.js: -------------------------------------------------------------------------------- 1 | var ActivitiRest = { 2 | options: {}, 3 | getProcessDefinitionByKey: function(processDefinitionKey, callback) { 4 | var url = Lang.sub(this.options.processDefinitionByKeyUrl, {processDefinitionKey: processDefinitionKey}); 5 | 6 | $.ajax({ 7 | url: url, 8 | dataType: 'json', 9 | cache: false, 10 | async: true, 11 | success: function(data, textStatus) { 12 | var processDefinition = data; 13 | if (!processDefinition) { 14 | console.error("Process definition '" + processDefinitionKey + "' not found"); 15 | } else { 16 | callback.apply({processDefinitionId: processDefinition.id}); 17 | } 18 | } 19 | }).done(function(data, textStatus) { 20 | console.log("ajax done"); 21 | }).fail(function(jqXHR, textStatus, error){ 22 | console.error('Get diagram layout['+processDefinitionKey+'] failure: ', textStatus, 'error: ', error, jqXHR); 23 | }); 24 | }, 25 | 26 | getProcessDefinition: function(processDefinitionId, callback) { 27 | var url = Lang.sub(this.options.processDefinitionUrl, {processDefinitionId: processDefinitionId}); 28 | 29 | $.ajax({ 30 | url: url, 31 | dataType: 'json', 32 | cache: false, 33 | async: true, 34 | success: function(data, textStatus) { 35 | var processDefinitionDiagramLayout = data; 36 | if (!processDefinitionDiagramLayout) { 37 | console.error("Process definition diagram layout '" + processDefinitionId + "' not found"); 38 | return; 39 | } else { 40 | callback.apply({processDefinitionDiagramLayout: processDefinitionDiagramLayout}); 41 | } 42 | } 43 | }).done(function(data, textStatus) { 44 | console.log("ajax done"); 45 | }).fail(function(jqXHR, textStatus, error){ 46 | console.log('Get diagram layout['+processDefinitionId+'] failure: ', textStatus, jqXHR); 47 | }); 48 | }, 49 | 50 | getHighLights: function(processInstanceId, callback) { 51 | var url = Lang.sub(this.options.processInstanceHighLightsUrl, {processInstanceId: processInstanceId}); 52 | 53 | $.ajax({ 54 | url: url, 55 | dataType: 'json', 56 | cache: false, 57 | async: true, 58 | success: function(data, textStatus) { 59 | console.log("ajax returned data"); 60 | var highLights = data; 61 | if (!highLights) { 62 | console.log("highLights not found"); 63 | return; 64 | } else { 65 | callback.apply({highLights: highLights}); 66 | } 67 | } 68 | }).done(function(data, textStatus) { 69 | console.log("ajax done"); 70 | }).fail(function(jqXHR, textStatus, error){ 71 | console.log('Get HighLights['+processInstanceId+'] failure: ', textStatus, jqXHR); 72 | }); 73 | } 74 | }; -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/js/ActivityImpl.js: -------------------------------------------------------------------------------- 1 | /** * * @author Tom Baeyens * @author (Javascript) Dmitry Farafonov */ var ActivityImpl = function(activityJson){ this.outgoingTransitions = []; this.outgoingTransitions = []; this.incomingTransitions = []; this.activityBehavior = null; this.parent = null; this.isScope = false; this.isAsync = false; this.isExclusive = false; this.x = -1; this.y = -1; this.width = -1; this.height = -1; this.properties = {}; //console.log("activityJson: ", activityJson); if (activityJson != undefined) { this.setId(activityJson.activityId); for (var propertyName in activityJson.properties) { this.setProperty(propertyName, activityJson.properties[propertyName]); } //this.setProperty("name", activityJson.activityName); //this.setProperty("type", activityJson.activityType); this.setX(activityJson.x); this.setY(activityJson.y); this.setWidth(activityJson.width); this.setHeight(activityJson.height); if (activityJson.multiInstance) this.setProperty("multiInstance", activityJson.multiInstance); if (activityJson.collapsed) { this.setProperty("collapsed", activityJson.collapsed); } if (activityJson.isInterrupting != undefined) this.setProperty("isInterrupting", activityJson.isInterrupting); } }; ActivityImpl.prototype = { outgoingTransitions: [], outgoingTransitions: [], incomingTransitions: [], activityBehavior: null, parent: null, isScope: false, isAsync: false, isExclusive: false, id: null, properties: {}, // Graphical information x: -1, y: -1, width: -1, height: -1, setId: function(id){ this.id = id; }, getId: function(){ return this.id; }, setProperty: function(name, value){ this.properties[name] = value; }, getProperty: function(name){ return this.properties[name]; }, createOutgoingTransition: function(transitionId){ }, toString: function(id) { return "Activity("+id+")"; }, getParentActivity: function(){ /* if (parent instanceof ActivityImpl) { 79 return (ActivityImpl) parent; 80 } 81 return null; */ return this.parent; }, // restricted setters /////////////////////////////////////////////////////// setOutgoingTransitions: function(outgoingTransitions){ this.outgoingTransitions = outgoingTransitions; }, setParent: function(parent){ this.parent = parent; }, setIncomingTransitions: function(incomingTransitions){ this.incomingTransitions = incomingTransitions; }, // getters and setters ////////////////////////////////////////////////////// getOutgoingTransitions: function(){ return this.outgoingTransitions; }, getActivityBehavior: function(){ return this.activityBehavior; }, setActivityBehavior: function(activityBehavior){ this.activityBehavior = activityBehavior; }, getParent: function(){ return this.parent; }, getIncomingTransitions: function(){ return this.incomingTransitions; }, isScope: function(){ return this.isScope; }, setScope: function(isScope){ this.isScope = isScope; }, getX: function(){ return this.x; }, setX: function(x){ this.x = x; }, getY: function(){ return this.y; }, setY: function(y){ this.y = y; }, getWidth: function(){ return this.width; }, setWidth: function(width){ this.width = width; }, getHeight: function(){ return this.height; }, setHeight: function(height){ this.height = height; }, isAsync: function() { return this.isAsync; }, setAsync: function(isAsync) { this.isAsync = isAsync; }, isExclusive: function() { return this.isExclusive; }, setExclusive: function(isExclusive) { this.isExclusive = isExclusive; }, vvoid: function(){} }; -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/js/Polyline.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/diagram-viewer/js/Polyline.js -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/js/jquery/jquery.asyncqueue.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the jquery plugin "asyncQueue". 3 | * 4 | * (c) Sebastien Roch 5 | * @author (parallel) Dmitry Farafonov 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | (function($){ 11 | $.AsyncQueue = function() { 12 | var that = this, 13 | queue = [], 14 | completeFunc, 15 | failureFunc, 16 | paused = false, 17 | lastCallbackData, 18 | _run, 19 | _complete, 20 | inQueue = 0, 21 | defaultTimeOut = 10; 22 | 23 | _run = function() { 24 | var f = queue.shift(); 25 | 26 | if (f) { 27 | inQueue++; 28 | setTimeout(function(){ 29 | f.fn.apply(that, [that]); 30 | 31 | if (!f.isParallel) 32 | if (paused === false) { 33 | _run(); 34 | } 35 | inQueue --; 36 | if (inQueue == 0 && queue.length == 0) 37 | _complete(); 38 | }, f.timeOut); 39 | 40 | if (f.isParallel) 41 | if (paused === false) { 42 | _run(); 43 | } 44 | } 45 | }; 46 | 47 | _complete = function(){ 48 | if (completeFunc) 49 | completeFunc.apply(that, [that]); 50 | }; 51 | 52 | this.onComplete = function(func) { 53 | completeFunc = func; 54 | }; 55 | 56 | this.onFailure = function(func) { 57 | failureFunc = func; 58 | }; 59 | 60 | this.add = function(func) { 61 | // TODO: add callback for queue[i] complete 62 | 63 | var obj = arguments[0]; 64 | if (obj && Object.prototype.toString.call(obj) === "[object Array]") { 65 | var fn = arguments[1]; 66 | var timeOut = (typeof(arguments[2]) != "undefined")? arguments[2] : defaultTimeOut; 67 | if (typeof(fn) == "function") { 68 | for(var i = 0; i < obj.length; i++) { 69 | var f = function(objx){ 70 | queue.push({isParallel: true, fn: function(){fn.apply(that, [that, objx]);}, timeOut: timeOut}); 71 | }(obj[i]) 72 | } 73 | } 74 | } else { 75 | var fn = arguments[0]; 76 | var timeOut = (typeof(arguments[1]) != "undefined")? arguments[2] : defaultTimeOut; 77 | queue.push({isParallel: false, fn: func, timeOut: timeOut}); 78 | } 79 | return this; 80 | }; 81 | 82 | this.addParallel = function(func, timeOut) { 83 | // TODO: add callback for queue[i] complete 84 | 85 | queue.push({isParallel: true, fn: func, timeOut: timeOut}); 86 | return this; 87 | }; 88 | 89 | this.storeData = function(dataObject) { 90 | lastCallbackData = dataObject; 91 | return this; 92 | }; 93 | 94 | this.lastCallbackData = function () { 95 | return lastCallbackData; 96 | }; 97 | 98 | this.run = function() { 99 | paused = false; 100 | _run(); 101 | }; 102 | 103 | this.pause = function () { 104 | paused = true; 105 | return this; 106 | }; 107 | 108 | this.failure = function() { 109 | paused = true; 110 | if (failureFunc) { 111 | var args = [that]; 112 | for(i = 0; i < arguments.length; i++) { 113 | args.push(arguments[i]); 114 | } 115 | failureFunc.apply(that, args); 116 | } 117 | }; 118 | 119 | this.size = function(){ 120 | return queue.length; 121 | }; 122 | 123 | return this; 124 | } 125 | })(jQuery); 126 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/js/jquery/jquery.progressbar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @ Dmitry Farafonov 3 | */ 4 | 5 | (function($){ 6 | $.ProgressBar = function(options) { 7 | this.element = $(options.boundingBox); 8 | if (options.on && options.on.complete){ 9 | this.onComplete = options.on.complete; 10 | } 11 | if (options.on && options.on.valueChange){ 12 | this.onValueChange = options.on.valueChange; 13 | } 14 | 15 | this._create(); 16 | 17 | if (options.label) 18 | this.set("label", options.label); 19 | if (options.value) 20 | this.value(options.value); 21 | if (options.max) 22 | this.set("max", options.max); 23 | }; 24 | $.ProgressBar.prototype = { 25 | options: { 26 | value: 0, 27 | max: 100 28 | }, 29 | 30 | min: 0, 31 | 32 | _create: function() { 33 | this.element 34 | .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) 35 | .attr({ 36 | role: "progressbar", 37 | "aria-valuemin": this.min, 38 | "aria-valuemax": this.options.max, 39 | "aria-valuenow": this._value() 40 | }); 41 | 42 | this.valueDiv = $( "
" ) 43 | .appendTo( this.element ); 44 | 45 | this.valueDiv = $( "
" ) 46 | .appendTo( this.element ); 47 | 48 | this.oldValue = this._value(); 49 | this._refreshValue(); 50 | }, 51 | 52 | _destroy: function() { 53 | this.element 54 | .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) 55 | .removeAttr( "role" ) 56 | .removeAttr( "aria-valuemin" ) 57 | .removeAttr( "aria-valuemax" ) 58 | .removeAttr( "aria-valuenow" ); 59 | 60 | this.valueDiv.remove(); 61 | }, 62 | 63 | value: function( newValue ) { 64 | if ( newValue === undefined ) { 65 | return this._value(); 66 | } 67 | 68 | this._setOption( "value", newValue ); 69 | return this; 70 | }, 71 | 72 | _setOption: function( key, value ) { 73 | if ( key === "value" ) { 74 | //var oldVal = this.options.value; 75 | this.options.value = value; 76 | this._refreshValue(); 77 | 78 | if (this.onValueChange) 79 | this.onValueChange.apply(this, [{oldVal: this.oldValue, newVal: value}]); 80 | 81 | if ( this._value() === this.options.max ) { 82 | //this._trigger( "complete" ); 83 | if (this.onComplete) 84 | this.onComplete.apply(this); 85 | } 86 | } else if (key === "label") { 87 | $(this.element).find(".ui-progressbar-label").html(value); 88 | } else if (key === "max") { 89 | this.options.max = value; 90 | } 91 | 92 | //this._super( key, value ); 93 | }, 94 | 95 | _value: function() { 96 | var val = this.options.value; 97 | // normalize invalid value 98 | if ( typeof val !== "number" ) { 99 | val = 0; 100 | } 101 | return Math.min( this.options.max, Math.max( this.min, val ) ); 102 | }, 103 | 104 | _percentage: function() { 105 | return 100 * this._value() / this.options.max; 106 | }, 107 | 108 | _refreshValue: function() { 109 | var value = this.value(), 110 | percentage = this._percentage(); 111 | 112 | if ( this.oldValue !== value ) { 113 | this.oldValue = value; 114 | //this._trigger( "change" ); 115 | } 116 | 117 | this.valueDiv 118 | .toggle( value > this.min ) 119 | .toggleClass( "ui-corner-right", value === this.options.max ) 120 | .width( percentage.toFixed(0) + "%" ); 121 | this.element.attr( "aria-valuenow", value ); 122 | 123 | //$(this.element).find(".ui-progressbar-label").html(value + "%"); 124 | }, 125 | 126 | set: function(key, value){ 127 | this._setOption(key, value); 128 | } 129 | }; 130 | 131 | })( jQuery ); -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/js/jstools.js: -------------------------------------------------------------------------------- 1 | if (typeof(console) == "undefined") { 2 | var console = { 3 | info: function(){}, 4 | warn: function(){}, 5 | error: function(){}, 6 | log: function(){}, 7 | time: function(){}, 8 | timeEnd: function(){} 9 | }; 10 | } 11 | 12 | if(!Array.isArray) { 13 | Array.isArray = function (vArg) { 14 | return Object.prototype.toString.call(vArg) === "[object Array]"; 15 | }; 16 | } 17 | 18 | if (!Object.isSVGElement) { 19 | Object.isSVGElement = function(vArg) { 20 | var str = Object.prototype.toString.call(vArg); 21 | return (str.indexOf("[object SVG") == 0); 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/diagram-viewer/style.css: -------------------------------------------------------------------------------- 1 | body { background: #fafafa; color: #708090; /* font: 300 100.1% "Helvetica Neue", Helvetica, "Arial Unicode MS", Arial, sans-serif; */ font-family: Verdana, sans-serif, Arial; font-size: 10px; } .wrapper{ height: 100%; position: relative; width: 100%; } /* #holder { height: 480px; width: 640px; b_ackground: #F8F8FF; -moz-border-radius: 10px; -webkit-border-radius: 10px; -webkit-box-shadow: 0 1px 3px #666; background: #DDD url(./images/bg.png); /* background: #DDD url(./images/checker-bg.png); * / b_order:0px solid #dedede; } */ div.diagramHolder { float:left; } div.diagram{ border:1px solid #dedede; margin: 5px; padding: 5px; background: #FFF; } div.diagram.hidden{ display:none; } svg { background: #DDD url(./images/bg.png); } div.diagram-info { float:left; position: relative; padding: 5px; } /* Breadcrumbs */ #diagramBreadCrumbs { margin-left: 2px; margin-right: 2px; margin-top: 10px; } #diagramBreadCrumbs ul { list-style: none; background-color: white; border: 1px solid #DEDEDE; border-color: #C0C2C5; margin: 0; margin-bottom: 10px; margin-left: 0; -webkit-padding-start: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } #diagramBreadCrumbs li { /*text-decoration: underline;*/ display: inline-block; vertical-align: middle; padding-left: .75em; padding-right: 0; cursor: pointer; } #diagramBreadCrumbs li.selected { color: #9370DB; color: #4876FF; color: #4F94CD; font-weight: bold; } #diagramBreadCrumbs li span { background: url(images/breadcrumbs.png) no-repeat 100% 50%; display: block; padding: .5em 15px .5em 0; } /* Progress bar */ .ui-progressbar { height: 25px; /*height:2em; text-align: left; overflow: hidden; */ background: white; border: 1px solid #949DAD; margin: 2px; overflow: hidden; padding: 1px; position: relative; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } .ui-progressbar .ui-progressbar-value { m_argin: -1px; height:100%; background: #D4E4FF; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } .ui-widget-header a { color: #222222/*{fcHeader}*/; } .ui-progressbar .ui-progressbar-label{ position: absolute; margin-top: 7px; border:0px solid red; width: 100%; text-align: center; } -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/app-cfg.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 'use strict'; 20 | 21 | var ACTIVITI = ACTIVITI || {}; 22 | var pathName = window.document.location.pathname; 23 | var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1); 24 | // ACTIVITI.CONFIG = { 25 | // 'contextRoot' : projectName + '/service' 26 | // }; 27 | ACTIVITI.CONFIG = { 28 | 'contextRoot' : "" 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties-condition-expression-controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | /* 21 | * Condition expression 22 | */ 23 | 24 | var KisBpmConditionExpressionCtrl = [ '$scope', '$modal', function($scope, $modal) { 25 | 26 | // Config for the modal window 27 | var opts = { 28 | template: 'editor-app/configuration/properties/condition-expression-popup.html?version=' + Date.now(), 29 | scope: $scope 30 | }; 31 | 32 | // Open the dialog 33 | $modal(opts); 34 | }]; 35 | 36 | var KisBpmConditionExpressionPopupCtrl = [ '$scope', '$translate', '$http', function($scope, $translate, $http) { 37 | 38 | // Put json representing condition on scope 39 | if ($scope.property.value !== undefined && $scope.property.value !== null) { 40 | 41 | $scope.conditionExpression = {value: $scope.property.value}; 42 | 43 | } else { 44 | $scope.conditionExpression = {value: ''}; 45 | } 46 | 47 | $scope.save = function() { 48 | $scope.property.value = $scope.conditionExpression.value; 49 | $scope.updatePropertyInModel($scope.property); 50 | $scope.close(); 51 | }; 52 | 53 | // Close button handler 54 | $scope.close = function() { 55 | $scope.property.mode = 'read'; 56 | $scope.$hide(); 57 | }; 58 | }]; -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties-custom-controllers.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties-message-scope-controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | angular.module('activitiModeler').controller('ActivitiMessageRefCtrl', [ '$scope', function($scope) { 21 | 22 | // Find the parent shape on which the message definitions are defined 23 | var messageDefinitionsProperty = undefined; 24 | var parent = $scope.selectedShape; 25 | while (parent !== null && parent !== undefined && messageDefinitionsProperty === undefined) { 26 | if (parent.properties && parent.properties['oryx-messagedefinitions']) { 27 | messageDefinitionsProperty = parent.properties['oryx-messagedefinitions']; 28 | } else { 29 | parent = parent.parent; 30 | } 31 | } 32 | 33 | try { 34 | messageDefinitionsProperty = JSON.parse(messageDefinitionsProperty); 35 | if (typeof messageDefinitionsProperty == 'string') { 36 | messageDefinitionsProperty = JSON.parse(messageDefinitionsProperty); 37 | } 38 | } catch (err) { 39 | // Do nothing here, just to be sure we try-catch it 40 | } 41 | 42 | $scope.messageDefinitions = messageDefinitionsProperty; 43 | 44 | 45 | $scope.messageChanged = function() { 46 | $scope.updatePropertyInModel($scope.property); 47 | }; 48 | }]); -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties-multiinstance-controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | /* 21 | * Execution listeners 22 | */ 23 | 24 | var KisBpmMultiInstanceCtrl = [ '$scope', function($scope) { 25 | 26 | if ($scope.property.value == undefined && $scope.property.value == null) 27 | { 28 | $scope.property.value = 'None'; 29 | } 30 | 31 | $scope.multiInstanceChanged = function() { 32 | $scope.updatePropertyInModel($scope.property); 33 | }; 34 | }]; -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties-signal-scope-controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | angular.module('activitiModeler').controller('ActivitiSignalRefCtrl', [ '$scope', function($scope) { 20 | 21 | // Find the parent shape on which the signal definitions are defined 22 | var signalDefinitionsProperty = undefined; 23 | var parent = $scope.selectedShape; 24 | while (parent !== null && parent !== undefined && signalDefinitionsProperty === undefined) { 25 | if (parent.properties && parent.properties['oryx-signaldefinitions']) { 26 | signalDefinitionsProperty = parent.properties['oryx-signaldefinitions']; 27 | } else { 28 | parent = parent.parent; 29 | } 30 | } 31 | 32 | try { 33 | signalDefinitionsProperty = JSON.parse(signalDefinitionsProperty); 34 | if (typeof signalDefinitionsProperty == 'string') { 35 | signalDefinitionsProperty = JSON.parse(signalDefinitionsProperty); 36 | } 37 | } catch (err) { 38 | // Do nothing here, just to be sure we try-catch it 39 | } 40 | 41 | $scope.signalDefinitions = signalDefinitionsProperty; 42 | 43 | 44 | $scope.signalChanged = function() { 45 | $scope.updatePropertyInModel($scope.property); 46 | }; 47 | }]); -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/assignment-display-template.html: -------------------------------------------------------------------------------- 1 | {{'PROPERTY.ASSIGNMENT.ASSIGNEE_DISPLAY' | translate:property.value.assignment }} 2 | {{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.candidateUsers}} 3 | {{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.candidateGroups}} 4 | PROPERTY.ASSIGNMENT.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/assignment-popup.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/assignment-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/boolean-property-template.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
-------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/condition-expression-display-template.html: -------------------------------------------------------------------------------- 1 | {{property.value|limitTo:20}} 2 | {{'PROPERTY.SEQUENCEFLOW.CONDITION.NO-CONDITION-DISPLAY' | translate}} -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/condition-expression-popup.html: -------------------------------------------------------------------------------- 1 | 2 | 62 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/fields-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/form-properties-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | {{'PROPERTY.FORMPROPERTIES.VALUE' | translate:property.value.formProperties}} 3 | PROPERTY.FORMPROPERTIES.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/form-properties-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/in-parameters-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | {{'PROPERTY.INPARAMETERS.VALUE' | translate:property.value.inParameters}} 3 | PROPERTY.INPARAMETERS.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/in-parameters-popup.html: -------------------------------------------------------------------------------- 1 | 2 | 54 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/in-parameters-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/message-definitions-display-template.html: -------------------------------------------------------------------------------- 1 | {{'PROPERTY.MESSAGEDEFINITIONS.DISPLAY' | translate:property.value}} 2 | PROPERTY.MESSAGEDEFINITIONS.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/message-definitions-popup.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/message-definitions-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/message-property-write-template.html: -------------------------------------------------------------------------------- 1 |
2 | 4 |
-------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/multiinstance-property-write-template.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 8 |
-------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/out-parameters-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | {{'PROPERTY.OUTPARAMETERS.VALUE' | translate:property.value.outParameters}} 3 | PROPERTY.OUTPARAMETERS.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/out-parameters-popup.html: -------------------------------------------------------------------------------- 1 | 2 | 54 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/out-parameters-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/sequenceflow-order-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | PROPERTY.SEQUENCEFLOW.ORDER.NOT.EMPTY 3 | PROPERTY.SEQUENCEFLOW.ORDER.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/sequenceflow-order-popup.html: -------------------------------------------------------------------------------- 1 | 2 | 48 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/sequenceflow-order-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/signal-definitions-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | {{'PROPERTY.SIGNALDEFINITIONS.DISPLAY' | translate:property.value}} 3 | PROPERTY.SIGNALDEFINITIONS.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/signal-definitions-popup.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/signal-definitions-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/signal-property-write-template.html: -------------------------------------------------------------------------------- 1 |
2 | 4 |
-------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/string-property-write-mode-template.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 8 |
-------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/subprocess-reference-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | {{property.value.name}} 3 | PROPERTY.SUBPROCESSREFERENCE.EMPTY 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/subprocess-reference-popup.html: -------------------------------------------------------------------------------- 1 | 2 | 44 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/subprocess-reference-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/task-listeners-display-template.html: -------------------------------------------------------------------------------- 1 | 2 | {{'PROPERTY.TASKLISTENERS.VALUE' | translate:property.value.taskListeners}} 3 | PROPERTY.TASKLISTENERS.EMPTY -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/task-listeners-write-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/configuration/properties/text-popup.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/popups/select-shape.html: -------------------------------------------------------------------------------- 1 | 2 | 21 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/popups/unsaved-changes.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.collapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.collapsed.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/expanded.subprocess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/expanded.subprocess.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.business.rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.business.rule.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.camel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.camel.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.manual.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.mule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.mule.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.receive.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.script.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.send.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.service.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.shell.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.user.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/subprocess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/subprocess.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/activity/task.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/artifact/text.annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/artifact/text.annotation.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/cancel.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/compensation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/compensation.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/error.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/message.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/signal.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/timer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/catching/timer.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/association.undirected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/association.undirected.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/association.unidirectional.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/association.unidirectional.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/messageflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/messageflow.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/sequenceflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/connector/sequenceflow.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/dataobject/data.store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/dataobject/data.store.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/diagram.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/cancel.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/error.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/none.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/terminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/endevent/terminate.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/eventbased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/eventbased.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/exclusive.databased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/exclusive.databased.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/inclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/inclusive.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/parallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/gateway/parallel.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/error.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/message.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/none.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/signal.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/timer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/startevent/timer.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/swimlane/lane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/swimlane/lane.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/swimlane/pool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/swimlane/pool.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/throwing/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/throwing/none.png -------------------------------------------------------------------------------- /src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/throwing/signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiaolin-li/activiti-case/4694db4edb7f00b93e7dd51e649e3786ee17012a/src/main/resources/static/activiti/editor-app/stencilsets/bpmn2.0/icons/throwing/signal.png -------------------------------------------------------------------------------- /src/test/java/com/ascendant/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.ascendant; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ApplicationTests { 11 | 12 | // @Autowired 13 | // private UserMapper userMapper; 14 | 15 | @Test 16 | public void contextLoads() { 17 | //QueryWrapper wrapper = new QueryWrapper<>(); 18 | //wrapper.eq() 19 | // List userEntities = userMapper.selectList(null); 20 | 21 | // System.out.println(userEntities.size()); 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/ascendant/activiti/ActivitTest.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.activiti; 2 | 3 | import org.activiti.engine.IdentityService; 4 | import org.activiti.engine.RepositoryService; 5 | import org.activiti.engine.RuntimeService; 6 | import org.activiti.engine.TaskService; 7 | import org.activiti.engine.repository.Deployment; 8 | import org.activiti.engine.runtime.ProcessInstance; 9 | import org.activiti.engine.task.Task; 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | import org.junit.runner.RunWith; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.boot.test.context.SpringBootTest; 15 | import org.springframework.test.context.junit4.SpringRunner; 16 | 17 | import java.util.HashMap; 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | /** 22 | * @author qiaolin 23 | * @version 2018/10/22 24 | **/ 25 | 26 | 27 | @RunWith(SpringRunner.class) 28 | @SpringBootTest 29 | public class ActivitTest { 30 | 31 | 32 | @Autowired 33 | private RuntimeService runtimeService; 34 | 35 | @Autowired 36 | private RepositoryService repositoryService; 37 | 38 | @Autowired 39 | private TaskService taskService; 40 | 41 | @Autowired 42 | private IdentityService identityService; 43 | 44 | 45 | @Test 46 | public void testService() { 47 | System.out.println(runtimeService); 48 | System.out.println(repositoryService); 49 | System.out.println(taskService); 50 | } 51 | 52 | /** 53 | * 测试部署流程 54 | */ 55 | @Test 56 | public void testDeploymentProcess(){ 57 | Deployment deploy = repositoryService.createDeployment() 58 | .addClasspathResource("bpmn/Leave.bpmn") 59 | .name("请假测试").deploy(); 60 | Assert.assertNotNull("部署失败!", deploy); 61 | System.out.println("部署成功! 部署Id ==> " + deploy.getId()); 62 | } 63 | 64 | @Test 65 | public void testStartProcess(){ 66 | Map var = new HashMap<>(); 67 | var.put("startMark", "启动动了!"); 68 | ProcessInstance leave = runtimeService.startProcessInstanceByKey("leave", var); 69 | Assert.assertNotNull(leave); 70 | System.out.println("启动完成!"); 71 | } 72 | 73 | 74 | @Test 75 | public void testComplete(){ 76 | Task task = taskService.createTaskQuery().taskCandidateOrAssigned("dipeng").singleResult(); 77 | Assert.assertNotNull("任务不能为空!", task); 78 | Map var = new HashMap<>(); 79 | var.put("myMark", "qiaolinLi"); 80 | taskService.complete(task.getId(), var); 81 | System.out.println("任务完成!"); 82 | } 83 | 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/test/java/com/ascendant/module/mapper/test/UserMapperTest.java: -------------------------------------------------------------------------------- 1 | package com.ascendant.module.mapper.test; 2 | 3 | import com.ascendant.common.util.IdGen; 4 | import com.ascendant.module.entity.User; 5 | import com.ascendant.module.mapper.UserMapper; 6 | import com.github.pagehelper.PageHelper; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.test.context.SpringBootTest; 12 | import org.springframework.test.context.junit4.SpringRunner; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author qiaolin 18 | * @version 2018/10/24 19 | **/ 20 | 21 | 22 | @Slf4j 23 | @RunWith(SpringRunner.class) 24 | @SpringBootTest 25 | public class UserMapperTest { 26 | 27 | @Autowired 28 | private UserMapper userMapper; 29 | 30 | @Test 31 | public void insert(){ 32 | User user = new User(); 33 | user.setId(IdGen.uuid()); 34 | user.setAge(18); 35 | user.setEmail("992004863@qq.com"); 36 | user.setName("巧林"); 37 | userMapper.insert(user); 38 | } 39 | 40 | @Test 41 | public void update(){ 42 | User user = new User(); 43 | user.setId("2"); 44 | user.setAge(19); 45 | user.setEmail("110@qq.com"); 46 | user.setName("肉丝"); 47 | userMapper.update(user); 48 | } 49 | 50 | @Test 51 | public void delete(){ 52 | userMapper.delete("1"); 53 | } 54 | 55 | @Test 56 | public void deleteById(){ 57 | User user = new User(); 58 | user.setId("3"); 59 | userMapper.delete(user); 60 | 61 | } 62 | 63 | @Test 64 | public void findList(){ 65 | PageHelper.startPage(1, 3); 66 | List list = userMapper.findList(null); 67 | log.info("无条件 ------ start"); 68 | list.forEach(l ->{ 69 | log.info(l.toString()); 70 | }); 71 | log.info("无条件 ------ end"); 72 | 73 | User user = new User(); 74 | user.setAge(19); 75 | list = userMapper.findList(user); 76 | log.info("age=19 条件 ------ start"); 77 | list.forEach(l ->{ 78 | log.info(l.toString()); 79 | }); 80 | log.info("age=19 条件 ------ end"); 81 | 82 | user.setName("巧林"); 83 | 84 | list = userMapper.findList(user); 85 | log.info("age=19 and name=巧林 条件 ------ start"); 86 | list.forEach(l ->{ 87 | log.info(l.toString()); 88 | }); 89 | log.info("age=19 and name=巧林 条件 ------ end"); 90 | 91 | } 92 | 93 | @Test 94 | public void findById(){ 95 | User byId = userMapper.findById("2"); 96 | System.out.println(byId); 97 | } 98 | 99 | 100 | @Test 101 | public void findById2(){ 102 | User user = new User(); 103 | user.setId("2"); 104 | userMapper.findById(user); 105 | } 106 | 107 | 108 | } -------------------------------------------------------------------------------- /src/test/resources/bpmn/Leave.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | --------------------------------------------------------------------------------