commit
e89a34a348
30 changed files with 1022 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||||
|
# Default ignored files |
||||||
|
/shelf/ |
||||||
|
/workspace.xml |
||||||
|
# Editor-based HTTP Client requests |
||||||
|
/httpRequests/ |
||||||
|
# Datasource local storage ignored files |
||||||
|
/dataSources/ |
||||||
|
/dataSources.local.xml |
@ -0,0 +1,7 @@ |
|||||||
|
<component name="ProjectCodeStyleConfiguration"> |
||||||
|
<code_scheme name="Project" version="173"> |
||||||
|
<ScalaCodeStyleSettings> |
||||||
|
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" /> |
||||||
|
</ScalaCodeStyleSettings> |
||||||
|
</code_scheme> |
||||||
|
</component> |
@ -0,0 +1,5 @@ |
|||||||
|
<component name="ProjectCodeStyleConfiguration"> |
||||||
|
<state> |
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> |
||||||
|
</state> |
||||||
|
</component> |
@ -0,0 +1,13 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="CompilerConfiguration"> |
||||||
|
<annotationProcessing> |
||||||
|
<profile name="Maven default annotation processors profile" enabled="true"> |
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" /> |
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
||||||
|
<outputRelativeToContentRoot value="true" /> |
||||||
|
<module name="camunda" /> |
||||||
|
</profile> |
||||||
|
</annotationProcessing> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,8 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8"> |
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="PROJECT" charset="UTF-8" /> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="RemoteRepositoriesConfiguration"> |
||||||
|
<remote-repository> |
||||||
|
<option name="id" value="central" /> |
||||||
|
<option name="name" value="Central Repository" /> |
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2" /> |
||||||
|
</remote-repository> |
||||||
|
<remote-repository> |
||||||
|
<option name="id" value="central" /> |
||||||
|
<option name="name" value="Maven Central repository" /> |
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" /> |
||||||
|
</remote-repository> |
||||||
|
<remote-repository> |
||||||
|
<option name="id" value="jboss.community" /> |
||||||
|
<option name="name" value="JBoss Community repository" /> |
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> |
||||||
|
</remote-repository> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,12 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||||
|
<component name="MavenProjectsManager"> |
||||||
|
<option name="originalFiles"> |
||||||
|
<list> |
||||||
|
<option value="$PROJECT_DIR$/pom.xml" /> |
||||||
|
</list> |
||||||
|
</option> |
||||||
|
</component> |
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> |
||||||
|
</project> |
@ -0,0 +1,13 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="SaveActionSettings"> |
||||||
|
<option name="actions"> |
||||||
|
<set> |
||||||
|
<option value="activateOnShortcut" /> |
||||||
|
<option value="organizeImports" /> |
||||||
|
<option value="reformat" /> |
||||||
|
</set> |
||||||
|
</option> |
||||||
|
<option name="configurationPath" value="" /> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,124 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="Palette2"> |
||||||
|
<group name="Swing"> |
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="Button" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="RadioButton" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="CheckBox" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="Label" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||||
|
<preferred-size width="200" height="200" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||||
|
<preferred-size width="200" height="200" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
||||||
|
<preferred-size width="-1" height="20" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
||||||
|
</item> |
||||||
|
</group> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,231 @@ |
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<groupId>com.example.workflow</groupId> |
||||||
|
<artifactId>camunda</artifactId> |
||||||
|
<version>1.0.0-SNAPSHOT</version> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
<maven.compiler.source>8</maven.compiler.source> |
||||||
|
<maven.compiler.target>8</maven.compiler.target> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<dependencyManagement> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.boot</groupId> |
||||||
|
<artifactId>spring-boot-dependencies</artifactId> |
||||||
|
<version>2.5.4</version> |
||||||
|
<type>pom</type> |
||||||
|
<scope>import</scope> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm</groupId> |
||||||
|
<artifactId>camunda-bom</artifactId> |
||||||
|
<version>7.15.0</version> |
||||||
|
<scope>import</scope> |
||||||
|
<type>pom</type> |
||||||
|
</dependency> |
||||||
|
<!-- groovy --> |
||||||
|
<dependency> |
||||||
|
<groupId>org.codehaus.groovy</groupId> |
||||||
|
<artifactId>groovy-all</artifactId> |
||||||
|
<version>2.4.21</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.codehaus.groovy.modules.http-builder</groupId> |
||||||
|
<artifactId>http-builder</artifactId> |
||||||
|
<version>0.7.1</version> |
||||||
|
</dependency> |
||||||
|
<!-- camunda rest api --> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm.springboot</groupId> |
||||||
|
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId> |
||||||
|
<version>7.15.0</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
|
||||||
|
<!-- spin--> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.spin</groupId> |
||||||
|
<artifactId>camunda-spin-dataformat-all</artifactId> |
||||||
|
<version>1.9.0</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<!-- camunda rest openapi--> |
||||||
|
<!-- http://localhost:11001/swagger.json --> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm.extension.swagger</groupId> |
||||||
|
<artifactId>camunda-bpm-swagger-json</artifactId> |
||||||
|
<version>7.8.0</version> |
||||||
|
</dependency> |
||||||
|
<!-- camunda swagger--> |
||||||
|
<!-- http://localhost:11001/webjars/swagger-ui/3.20.9/index.html?docExpansion=false&url=/swagger.json --> |
||||||
|
<dependency> |
||||||
|
<groupId>org.webjars</groupId> |
||||||
|
<artifactId>swagger-ui</artifactId> |
||||||
|
<version>${swagger-ui.version}</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.webjars.bower</groupId> |
||||||
|
<artifactId>swagger-ui-themes</artifactId> |
||||||
|
<version>3.0.0</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.springfox</groupId> |
||||||
|
<artifactId>springfox-swagger2</artifactId> |
||||||
|
<version>${springfox.version}</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.springfox</groupId> |
||||||
|
<artifactId>springfox-swagger-ui</artifactId> |
||||||
|
<version>${springfox.version}</version> |
||||||
|
</dependency> |
||||||
|
<!-- <dependency>--> |
||||||
|
<!-- <groupId>com.github.xiaoymin</groupId>--> |
||||||
|
<!-- <artifactId>knife4j-spring-boot-starter</artifactId>--> |
||||||
|
<!-- <version>2.0.3</version>--> |
||||||
|
<!-- </dependency>--> |
||||||
|
<!-- HTTP 连接器--> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.connect</groupId> |
||||||
|
<artifactId>camunda-connect-bom</artifactId> |
||||||
|
<version>1.5.2</version> |
||||||
|
<scope>import</scope> |
||||||
|
<type>pom</type> |
||||||
|
</dependency> |
||||||
|
<!-- 邮件连接器--> |
||||||
|
<!-- <dependency> |
||||||
|
<groupId>org.camunda.bpm.extension</groupId> |
||||||
|
<artifactId>camunda-bpm-mail-core</artifactId> |
||||||
|
<version>1.3.1-SNAPSHOT</version> |
||||||
|
</dependency>--> |
||||||
|
<!-- 全局监听连接器--> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm.extension.reactor</groupId> |
||||||
|
<artifactId>camunda-bpm-reactor-spring-starter</artifactId> |
||||||
|
<version>2.1.2</version> |
||||||
|
</dependency> |
||||||
|
<!-- 连接器基础包--> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.connect</groupId> |
||||||
|
<artifactId>camunda-connect-core</artifactId> |
||||||
|
<version>1.5.2</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.connect</groupId> |
||||||
|
<artifactId>camunda-connect-connectors-all</artifactId> |
||||||
|
<version>1.5.2</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm</groupId> |
||||||
|
<artifactId>camunda-engine-plugin-connect</artifactId> |
||||||
|
<version>7.15.0</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm.springboot</groupId> |
||||||
|
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId> |
||||||
|
<version>7.15.0</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.boot</groupId> |
||||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.postgresql</groupId> |
||||||
|
<artifactId>postgresql</artifactId> |
||||||
|
<version>42.5.0</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.alibaba</groupId> |
||||||
|
<artifactId>druid-spring-boot-starter</artifactId> |
||||||
|
<version>1.2.6</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.alibaba</groupId> |
||||||
|
<artifactId>fastjson</artifactId> |
||||||
|
<version>1.2.78</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.boot</groupId> |
||||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||||
|
<version>2.5.4</version> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>junit</groupId> |
||||||
|
<artifactId>junit</artifactId> |
||||||
|
<version>4.13.2</version> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
</dependencyManagement> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.boot</groupId> |
||||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm.springboot</groupId> |
||||||
|
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm.springboot</groupId> |
||||||
|
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm</groupId> |
||||||
|
<artifactId>camunda-engine-plugin-spin</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.spin</groupId> |
||||||
|
<artifactId>camunda-spin-dataformat-all</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.camunda.bpm</groupId> |
||||||
|
<artifactId>camunda-external-task-client</artifactId> |
||||||
|
<version>7.15.0</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.postgresql</groupId> |
||||||
|
<artifactId>postgresql</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.boot</groupId> |
||||||
|
<artifactId>spring-boot-starter-jdbc</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
</dependencies> |
||||||
|
|
||||||
|
<build> |
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<groupId>org.springframework.boot</groupId> |
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,13 @@ |
|||||||
|
package com.example.workflow; |
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication; |
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||||
|
|
||||||
|
@SpringBootApplication |
||||||
|
public class Application { |
||||||
|
|
||||||
|
public static void main(String... args) { |
||||||
|
SpringApplication.run(Application.class, args); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package com.example.workflow.listener; |
||||||
|
|
||||||
|
import org.camunda.bpm.engine.delegate.DelegateTask; |
||||||
|
import org.camunda.bpm.engine.delegate.TaskListener; |
||||||
|
|
||||||
|
public class SayHaloWodeListener implements TaskListener { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void notify(DelegateTask delegateTask) { |
||||||
|
System.out.println("halo wode"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,75 @@ |
|||||||
|
package com.example.workflow.rest.controller; |
||||||
|
|
||||||
|
import org.camunda.bpm.engine.RepositoryService; |
||||||
|
import org.camunda.bpm.engine.RuntimeService; |
||||||
|
import org.camunda.bpm.engine.TaskService; |
||||||
|
import org.camunda.bpm.engine.repository.Deployment; |
||||||
|
import org.camunda.bpm.engine.repository.ProcessDefinition; |
||||||
|
import org.camunda.bpm.engine.runtime.ProcessInstance; |
||||||
|
import org.camunda.bpm.engine.task.Task; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.util.List; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* 一个常规的说HaloWode的流程 |
||||||
|
* k |
||||||
|
* |
||||||
|
* @author chenchuancheng |
||||||
|
* @since 2022/11/21 10:08 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
public class ProcessController { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private RepositoryService repositoryService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private RuntimeService runtimeService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private TaskService taskService; |
||||||
|
|
||||||
|
@GetMapping("/deploy") |
||||||
|
public String deploy() { |
||||||
|
Deployment deploy = repositoryService.createDeployment() |
||||||
|
.name("流程") |
||||||
|
.addClasspathResource("process.bpmn") |
||||||
|
.deploy(); |
||||||
|
|
||||||
|
return deploy.getId(); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/queryProcess/{deployId}") |
||||||
|
public List<String> queryProcess(@PathVariable("deployId") String deployId) { |
||||||
|
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery() |
||||||
|
.deploymentId(deployId) |
||||||
|
.list(); |
||||||
|
return list.stream().map(ProcessDefinition::getId).collect(Collectors.toList()); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/start/{processDefinitionId}") |
||||||
|
public String start(@PathVariable("processDefinitionId") String processDefinitionId) { |
||||||
|
ProcessInstance processInstance = runtimeService |
||||||
|
.startProcessInstanceById(processDefinitionId); |
||||||
|
return processInstance.getId(); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/queryTask/{processInstanceId}") |
||||||
|
public List<String> queryTask(@PathVariable("processInstanceId") String processInstanceId) { |
||||||
|
List<Task> list = taskService.createTaskQuery() |
||||||
|
.processInstanceId(processInstanceId) |
||||||
|
.list(); |
||||||
|
return list.stream().map(Task::getId).collect(Collectors.toList()); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/finishTask/{taskId}") |
||||||
|
public void finishTask(@PathVariable("taskId") String taskId) { |
||||||
|
taskService.complete(taskId); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
spring: |
||||||
|
datasource: |
||||||
|
url: jdbc:postgresql://192.168.110.198:5432/camunda |
||||||
|
type: com.zaxxer.hikari.HikariDataSource |
||||||
|
driver-class-name: org.postgresql.Driver |
||||||
|
hikari: |
||||||
|
username: postgres |
||||||
|
password: postgres |
||||||
|
server: |
||||||
|
port: 1111 |
||||||
|
|
||||||
|
#camunda.bpm.admin-user: |
||||||
|
# id: admin |
||||||
|
# password: admin |
||||||
|
camunda: |
||||||
|
bpm: |
||||||
|
admin-user: |
||||||
|
id: admin |
||||||
|
password: admin |
||||||
|
database: |
||||||
|
# 乱写类型会出错,不如不写,camunda会自己判断。Error while building ibatis SqlSessionFactory: null |
||||||
|
# type: postgresql |
||||||
|
schema-update: drop-create |
||||||
|
auto-deployment-enabled: false |
@ -0,0 +1,31 @@ |
|||||||
|
{ |
||||||
|
"components": [ |
||||||
|
{ |
||||||
|
"label": "Amount", |
||||||
|
"type": "number", |
||||||
|
"id": "Field_13olf2v", |
||||||
|
"key": "amount" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"label": "Item", |
||||||
|
"type": "textfield", |
||||||
|
"id": "Field_01i827y", |
||||||
|
"key": "item" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"label": "Approved?", |
||||||
|
"type": "checkbox", |
||||||
|
"id": "Field_01klvvc", |
||||||
|
"key": "approved" |
||||||
|
} |
||||||
|
], |
||||||
|
"type": "default", |
||||||
|
"id": "payment-form", |
||||||
|
"exporter": { |
||||||
|
"name": "Camunda Modeler", |
||||||
|
"version": "5.5.0" |
||||||
|
}, |
||||||
|
"executionPlatform": "Camunda Platform", |
||||||
|
"executionPlatformVersion": "7.18.0", |
||||||
|
"schemaVersion": 5 |
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0dtfda4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.18.0"> |
||||||
|
<bpmn:process id="payment-retrieval" name="付款" isExecutable="true"> |
||||||
|
<bpmn:startEvent id="StartEvent_1" name="开始"> |
||||||
|
<bpmn:outgoing>Flow_0c2ozia</bpmn:outgoing> |
||||||
|
</bpmn:startEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_0c2ozia" sourceRef="StartEvent_1" targetRef="Activity_0ep2qfb" /> |
||||||
|
<bpmn:endEvent id="Event_1rzxmly" name="结束"> |
||||||
|
<bpmn:incoming>Flow_14ceptg</bpmn:incoming> |
||||||
|
</bpmn:endEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_14ceptg" sourceRef="Activity_0ep2qfb" targetRef="Event_1rzxmly" /> |
||||||
|
<bpmn:serviceTask id="Activity_0ep2qfb" name="付款"> |
||||||
|
<bpmn:incoming>Flow_0c2ozia</bpmn:incoming> |
||||||
|
<bpmn:outgoing>Flow_14ceptg</bpmn:outgoing> |
||||||
|
</bpmn:serviceTask> |
||||||
|
</bpmn:process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="payment-retrieval"> |
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> |
||||||
|
<dc:Bounds x="179" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="186" y="142" width="22" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Event_1rzxmly_di" bpmnElement="Event_1rzxmly"> |
||||||
|
<dc:Bounds x="432" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="439" y="142" width="22" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Activity_1n7oaxl_di" bpmnElement="Activity_0ep2qfb"> |
||||||
|
<dc:Bounds x="270" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge id="Flow_0c2ozia_di" bpmnElement="Flow_0c2ozia"> |
||||||
|
<di:waypoint x="215" y="117" /> |
||||||
|
<di:waypoint x="270" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="Flow_14ceptg_di" bpmnElement="Flow_14ceptg"> |
||||||
|
<di:waypoint x="370" y="117" /> |
||||||
|
<di:waypoint x="432" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</bpmn:definitions> |
@ -0,0 +1,58 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1h0z0z1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.18.0"> |
||||||
|
<bpmn:process id="Process_16mtg4x" isExecutable="true"> |
||||||
|
<bpmn:startEvent id="StartEvent_1" name="付款申请"> |
||||||
|
<bpmn:outgoing>Flow_17chpj9</bpmn:outgoing> |
||||||
|
</bpmn:startEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_17chpj9" sourceRef="StartEvent_1" targetRef="Activity_1mv1vg0" /> |
||||||
|
<bpmn:sequenceFlow id="Flow_0jc5m04" sourceRef="Activity_1mv1vg0" targetRef="Activity_0i4hchg" /> |
||||||
|
<bpmn:endEvent id="Event_1a62gsy" name="结束"> |
||||||
|
<bpmn:incoming>Flow_1maa5hg</bpmn:incoming> |
||||||
|
</bpmn:endEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_1maa5hg" sourceRef="Activity_0i4hchg" targetRef="Event_1a62gsy" /> |
||||||
|
<bpmn:userTask id="Activity_1mv1vg0" name="批准" camunda:formRef="payment-form" camunda:formRefBinding="latest" camunda:assignee="chenchuancheng"> |
||||||
|
<bpmn:extensionElements /> |
||||||
|
<bpmn:incoming>Flow_17chpj9</bpmn:incoming> |
||||||
|
<bpmn:outgoing>Flow_0jc5m04</bpmn:outgoing> |
||||||
|
</bpmn:userTask> |
||||||
|
<bpmn:serviceTask id="Activity_0i4hchg" name="付款" camunda:type="external" camunda:topic="charge-card"> |
||||||
|
<bpmn:extensionElements /> |
||||||
|
<bpmn:incoming>Flow_0jc5m04</bpmn:incoming> |
||||||
|
<bpmn:outgoing>Flow_1maa5hg</bpmn:outgoing> |
||||||
|
</bpmn:serviceTask> |
||||||
|
</bpmn:process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_16mtg4x"> |
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> |
||||||
|
<dc:Bounds x="179" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="175" y="142" width="44" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Event_1a62gsy_di" bpmnElement="Event_1a62gsy"> |
||||||
|
<dc:Bounds x="592" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="599" y="142" width="22" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Activity_0llgjen_di" bpmnElement="Activity_1mv1vg0"> |
||||||
|
<dc:Bounds x="270" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Activity_01vln1f_di" bpmnElement="Activity_0i4hchg"> |
||||||
|
<dc:Bounds x="430" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge id="Flow_17chpj9_di" bpmnElement="Flow_17chpj9"> |
||||||
|
<di:waypoint x="215" y="117" /> |
||||||
|
<di:waypoint x="270" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="Flow_1maa5hg_di" bpmnElement="Flow_1maa5hg"> |
||||||
|
<di:waypoint x="530" y="117" /> |
||||||
|
<di:waypoint x="592" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="Flow_0jc5m04_di" bpmnElement="Flow_0jc5m04"> |
||||||
|
<di:waypoint x="370" y="117" /> |
||||||
|
<di:waypoint x="430" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</bpmn:definitions> |
@ -0,0 +1,41 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0fr9mxs" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.0"> |
||||||
|
<bpmn:process id="camunda-process" isExecutable="true"> |
||||||
|
<bpmn:startEvent id="StartEvent_1"> |
||||||
|
<bpmn:outgoing>SequenceFlow_1fp17al</bpmn:outgoing> |
||||||
|
</bpmn:startEvent> |
||||||
|
<bpmn:sequenceFlow id="SequenceFlow_1fp17al" sourceRef="StartEvent_1" targetRef="say-hello" /> |
||||||
|
<bpmn:endEvent id="EndEvent_0x6ir2l"> |
||||||
|
<bpmn:incoming>SequenceFlow_16gzt2m</bpmn:incoming> |
||||||
|
</bpmn:endEvent> |
||||||
|
<bpmn:sequenceFlow id="SequenceFlow_16gzt2m" sourceRef="say-hello" targetRef="EndEvent_0x6ir2l" /> |
||||||
|
<bpmn:userTask id="say-hello" name="Say Halo Wode" camunda:candidateUsers="admin"> |
||||||
|
<bpmn:extensionElements> |
||||||
|
<camunda:taskListener class="com.example.workflow.listener.SayHaloWodeListener" event="create" /> |
||||||
|
</bpmn:extensionElements> |
||||||
|
<bpmn:incoming>SequenceFlow_1fp17al</bpmn:incoming> |
||||||
|
<bpmn:outgoing>SequenceFlow_16gzt2m</bpmn:outgoing> |
||||||
|
</bpmn:userTask> |
||||||
|
</bpmn:process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="camunda-process"> |
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> |
||||||
|
<dc:Bounds x="179" y="99" width="36" height="36" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="EndEvent_0x6ir2l_di" bpmnElement="EndEvent_0x6ir2l"> |
||||||
|
<dc:Bounds x="432" y="99" width="36" height="36" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="UserTask_08mft2c_di" bpmnElement="say-hello"> |
||||||
|
<dc:Bounds x="270" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge id="SequenceFlow_1fp17al_di" bpmnElement="SequenceFlow_1fp17al"> |
||||||
|
<di:waypoint x="215" y="117" /> |
||||||
|
<di:waypoint x="270" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="SequenceFlow_16gzt2m_di" bpmnElement="SequenceFlow_16gzt2m"> |
||||||
|
<di:waypoint x="370" y="117" /> |
||||||
|
<di:waypoint x="432" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</bpmn:definitions> |
@ -0,0 +1,37 @@ |
|||||||
|
package com.example.workflow.rest.controller; |
||||||
|
|
||||||
|
import org.camunda.bpm.client.ExternalTaskClient; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
import java.net.URI; |
||||||
|
|
||||||
|
public class ChargeCardWorker { |
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ChargeCardWorker.class); |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
ExternalTaskClient client = ExternalTaskClient.create() |
||||||
|
.baseUrl("http://localhost:8080/engine-rest") |
||||||
|
.asyncResponseTimeout(10000) // 长轮询超时时间
|
||||||
|
.build(); |
||||||
|
// 订阅指定的外部任务
|
||||||
|
client.subscribe("charge-card") |
||||||
|
.lockDuration(1000) |
||||||
|
.handler(((externalTask, externalTaskService) -> { |
||||||
|
// 获取流程变量
|
||||||
|
String item = (String) externalTask.getVariable("item"); |
||||||
|
Integer amount = (Integer) externalTask.getVariable("amount"); |
||||||
|
System.out.println("item--->"+item + " amount-->" + amount); |
||||||
|
try { |
||||||
|
Desktop.getDesktop().browse(new URI("https://docs.camunda.org/get-started/quick-start/complete")); |
||||||
|
} catch (Exception e) { |
||||||
|
e.printStackTrace(); |
||||||
|
} |
||||||
|
|
||||||
|
// 完成任务
|
||||||
|
externalTaskService.complete(externalTask); |
||||||
|
})).open(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
package com.example.workflow.rest.controller; |
||||||
|
|
||||||
|
import org.camunda.bpm.engine.RepositoryService; |
||||||
|
import org.camunda.bpm.engine.RuntimeService; |
||||||
|
import org.camunda.bpm.engine.TaskService; |
||||||
|
import org.camunda.bpm.engine.repository.Deployment; |
||||||
|
import org.camunda.bpm.engine.repository.ProcessDefinition; |
||||||
|
import org.camunda.bpm.engine.repository.ProcessDefinitionQuery; |
||||||
|
import org.camunda.bpm.engine.runtime.ProcessInstance; |
||||||
|
import org.camunda.bpm.engine.task.Task; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*; |
||||||
|
|
||||||
|
@SpringBootTest |
||||||
|
class ProcessControllerTest { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private RepositoryService repositoryService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private RuntimeService runtimeService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private TaskService taskService; |
||||||
|
|
||||||
|
|
||||||
|
@Test |
||||||
|
void finishTask() { |
||||||
|
Deployment deploy = repositoryService.createDeployment() |
||||||
|
.name("流程") |
||||||
|
.addClasspathResource("process.bpmn") |
||||||
|
.deploy(); |
||||||
|
List<ProcessDefinition> processDefinitionList = repositoryService.createProcessDefinitionQuery() |
||||||
|
.deploymentId(deploy.getId()) |
||||||
|
.list(); |
||||||
|
ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionList.get(0).getId()); |
||||||
|
List<Task> taskList = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list(); |
||||||
|
Task task = taskList.get(0); |
||||||
|
taskService.complete(task.getId()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
spring: |
||||||
|
datasource: |
||||||
|
url: jdbc:postgresql://192.168.110.198:5432/camunda |
||||||
|
type: com.zaxxer.hikari.HikariDataSource |
||||||
|
driver-class-name: org.postgresql.Driver |
||||||
|
hikari: |
||||||
|
username: postgres |
||||||
|
password: postgres |
||||||
|
server: |
||||||
|
port: 1111 |
||||||
|
|
||||||
|
#camunda.bpm.admin-user: |
||||||
|
# id: admin |
||||||
|
# password: admin |
||||||
|
camunda: |
||||||
|
bpm: |
||||||
|
admin-user: |
||||||
|
id: admin |
||||||
|
password: admin |
||||||
|
database: |
||||||
|
# 乱写类型会出错,不如不写,camunda会自己判断。Error while building ibatis SqlSessionFactory: null |
||||||
|
# type: postgresql |
||||||
|
schema-update: drop-create |
||||||
|
auto-deployment-enabled: false |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,31 @@ |
|||||||
|
{ |
||||||
|
"components": [ |
||||||
|
{ |
||||||
|
"label": "Amount", |
||||||
|
"type": "number", |
||||||
|
"id": "Field_13olf2v", |
||||||
|
"key": "amount" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"label": "Item", |
||||||
|
"type": "textfield", |
||||||
|
"id": "Field_01i827y", |
||||||
|
"key": "item" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"label": "Approved?", |
||||||
|
"type": "checkbox", |
||||||
|
"id": "Field_01klvvc", |
||||||
|
"key": "approved" |
||||||
|
} |
||||||
|
], |
||||||
|
"type": "default", |
||||||
|
"id": "payment-form", |
||||||
|
"exporter": { |
||||||
|
"name": "Camunda Modeler", |
||||||
|
"version": "5.5.0" |
||||||
|
}, |
||||||
|
"executionPlatform": "Camunda Platform", |
||||||
|
"executionPlatformVersion": "7.18.0", |
||||||
|
"schemaVersion": 5 |
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0dtfda4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.18.0"> |
||||||
|
<bpmn:process id="payment-retrieval" name="付款" isExecutable="true"> |
||||||
|
<bpmn:startEvent id="StartEvent_1" name="开始"> |
||||||
|
<bpmn:outgoing>Flow_0c2ozia</bpmn:outgoing> |
||||||
|
</bpmn:startEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_0c2ozia" sourceRef="StartEvent_1" targetRef="Activity_0ep2qfb" /> |
||||||
|
<bpmn:endEvent id="Event_1rzxmly" name="结束"> |
||||||
|
<bpmn:incoming>Flow_14ceptg</bpmn:incoming> |
||||||
|
</bpmn:endEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_14ceptg" sourceRef="Activity_0ep2qfb" targetRef="Event_1rzxmly" /> |
||||||
|
<bpmn:serviceTask id="Activity_0ep2qfb" name="付款"> |
||||||
|
<bpmn:incoming>Flow_0c2ozia</bpmn:incoming> |
||||||
|
<bpmn:outgoing>Flow_14ceptg</bpmn:outgoing> |
||||||
|
</bpmn:serviceTask> |
||||||
|
</bpmn:process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="payment-retrieval"> |
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> |
||||||
|
<dc:Bounds x="179" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="186" y="142" width="22" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Event_1rzxmly_di" bpmnElement="Event_1rzxmly"> |
||||||
|
<dc:Bounds x="432" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="439" y="142" width="22" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Activity_1n7oaxl_di" bpmnElement="Activity_0ep2qfb"> |
||||||
|
<dc:Bounds x="270" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge id="Flow_0c2ozia_di" bpmnElement="Flow_0c2ozia"> |
||||||
|
<di:waypoint x="215" y="117" /> |
||||||
|
<di:waypoint x="270" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="Flow_14ceptg_di" bpmnElement="Flow_14ceptg"> |
||||||
|
<di:waypoint x="370" y="117" /> |
||||||
|
<di:waypoint x="432" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</bpmn:definitions> |
@ -0,0 +1,58 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1h0z0z1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.18.0"> |
||||||
|
<bpmn:process id="Process_16mtg4x" isExecutable="true"> |
||||||
|
<bpmn:startEvent id="StartEvent_1" name="付款申请"> |
||||||
|
<bpmn:outgoing>Flow_17chpj9</bpmn:outgoing> |
||||||
|
</bpmn:startEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_17chpj9" sourceRef="StartEvent_1" targetRef="Activity_1mv1vg0" /> |
||||||
|
<bpmn:sequenceFlow id="Flow_0jc5m04" sourceRef="Activity_1mv1vg0" targetRef="Activity_0i4hchg" /> |
||||||
|
<bpmn:endEvent id="Event_1a62gsy" name="结束"> |
||||||
|
<bpmn:incoming>Flow_1maa5hg</bpmn:incoming> |
||||||
|
</bpmn:endEvent> |
||||||
|
<bpmn:sequenceFlow id="Flow_1maa5hg" sourceRef="Activity_0i4hchg" targetRef="Event_1a62gsy" /> |
||||||
|
<bpmn:userTask id="Activity_1mv1vg0" name="批准" camunda:formRef="payment-form" camunda:formRefBinding="latest" camunda:assignee="chenchuancheng"> |
||||||
|
<bpmn:extensionElements /> |
||||||
|
<bpmn:incoming>Flow_17chpj9</bpmn:incoming> |
||||||
|
<bpmn:outgoing>Flow_0jc5m04</bpmn:outgoing> |
||||||
|
</bpmn:userTask> |
||||||
|
<bpmn:serviceTask id="Activity_0i4hchg" name="付款" camunda:type="external" camunda:topic="charge-card"> |
||||||
|
<bpmn:extensionElements /> |
||||||
|
<bpmn:incoming>Flow_0jc5m04</bpmn:incoming> |
||||||
|
<bpmn:outgoing>Flow_1maa5hg</bpmn:outgoing> |
||||||
|
</bpmn:serviceTask> |
||||||
|
</bpmn:process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_16mtg4x"> |
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> |
||||||
|
<dc:Bounds x="179" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="175" y="142" width="44" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Event_1a62gsy_di" bpmnElement="Event_1a62gsy"> |
||||||
|
<dc:Bounds x="592" y="99" width="36" height="36" /> |
||||||
|
<bpmndi:BPMNLabel> |
||||||
|
<dc:Bounds x="599" y="142" width="22" height="14" /> |
||||||
|
</bpmndi:BPMNLabel> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Activity_0llgjen_di" bpmnElement="Activity_1mv1vg0"> |
||||||
|
<dc:Bounds x="270" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="Activity_01vln1f_di" bpmnElement="Activity_0i4hchg"> |
||||||
|
<dc:Bounds x="430" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge id="Flow_17chpj9_di" bpmnElement="Flow_17chpj9"> |
||||||
|
<di:waypoint x="215" y="117" /> |
||||||
|
<di:waypoint x="270" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="Flow_1maa5hg_di" bpmnElement="Flow_1maa5hg"> |
||||||
|
<di:waypoint x="530" y="117" /> |
||||||
|
<di:waypoint x="592" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="Flow_0jc5m04_di" bpmnElement="Flow_0jc5m04"> |
||||||
|
<di:waypoint x="370" y="117" /> |
||||||
|
<di:waypoint x="430" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</bpmn:definitions> |
@ -0,0 +1,41 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0fr9mxs" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.0"> |
||||||
|
<bpmn:process id="camunda-process" isExecutable="true"> |
||||||
|
<bpmn:startEvent id="StartEvent_1"> |
||||||
|
<bpmn:outgoing>SequenceFlow_1fp17al</bpmn:outgoing> |
||||||
|
</bpmn:startEvent> |
||||||
|
<bpmn:sequenceFlow id="SequenceFlow_1fp17al" sourceRef="StartEvent_1" targetRef="say-hello" /> |
||||||
|
<bpmn:endEvent id="EndEvent_0x6ir2l"> |
||||||
|
<bpmn:incoming>SequenceFlow_16gzt2m</bpmn:incoming> |
||||||
|
</bpmn:endEvent> |
||||||
|
<bpmn:sequenceFlow id="SequenceFlow_16gzt2m" sourceRef="say-hello" targetRef="EndEvent_0x6ir2l" /> |
||||||
|
<bpmn:userTask id="say-hello" name="Say Halo Wode" camunda:candidateUsers="admin"> |
||||||
|
<bpmn:extensionElements> |
||||||
|
<camunda:taskListener class="com.example.workflow.listener.SayHaloWodeListener" event="create" /> |
||||||
|
</bpmn:extensionElements> |
||||||
|
<bpmn:incoming>SequenceFlow_1fp17al</bpmn:incoming> |
||||||
|
<bpmn:outgoing>SequenceFlow_16gzt2m</bpmn:outgoing> |
||||||
|
</bpmn:userTask> |
||||||
|
</bpmn:process> |
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
||||||
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="camunda-process"> |
||||||
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> |
||||||
|
<dc:Bounds x="179" y="99" width="36" height="36" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="EndEvent_0x6ir2l_di" bpmnElement="EndEvent_0x6ir2l"> |
||||||
|
<dc:Bounds x="432" y="99" width="36" height="36" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNShape id="UserTask_08mft2c_di" bpmnElement="say-hello"> |
||||||
|
<dc:Bounds x="270" y="77" width="100" height="80" /> |
||||||
|
</bpmndi:BPMNShape> |
||||||
|
<bpmndi:BPMNEdge id="SequenceFlow_1fp17al_di" bpmnElement="SequenceFlow_1fp17al"> |
||||||
|
<di:waypoint x="215" y="117" /> |
||||||
|
<di:waypoint x="270" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
<bpmndi:BPMNEdge id="SequenceFlow_16gzt2m_di" bpmnElement="SequenceFlow_16gzt2m"> |
||||||
|
<di:waypoint x="370" y="117" /> |
||||||
|
<di:waypoint x="432" y="117" /> |
||||||
|
</bpmndi:BPMNEdge> |
||||||
|
</bpmndi:BPMNPlane> |
||||||
|
</bpmndi:BPMNDiagram> |
||||||
|
</bpmn:definitions> |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue