Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
liyuliang5 committed Nov 8, 2024
1 parent 930a3ed commit d33c679
Show file tree
Hide file tree
Showing 513 changed files with 224,916 additions and 223 deletions.
15 changes: 12 additions & 3 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,23 @@ Spring环境可直接定义FlowEngineImpl bean.
[main ] INFO BaseFlowRunner - NEXT NODES:
[main ] INFO QuickStartTest - Execute finish, current node is:node003
```
以上只是简单使用示例,EasyFlow可支持很多的配置项和使用场景,更多使用见wiki文档.

#### 流程引擎-BPMN
打开easyflow-flow-bpmn/BPMNDesigner.html流程设计器. 点击导入按钮,导入easyflow-flow-bpmn/src/test/resources/flow/quickstart/quickstart_001.bpmn文件,可在设计器中看到和以上JSON定义等价的BPMN流程定义.
使用时只需要将FlowEngineImpl的flowParser设置为BpmnFlowParser.

### 更多
以上只是简单使用示例,EasyFlow可支持很多的配置项和使用场景,更多使用见wiki文档.
#### 工作流
工作流模块提供了基于流程引擎的持久化和任务审批能力, 需要关系型数据库支持. 源码中的示例工程启动步骤如下:
1. 检出本工程库代码至本地.
1. 安装关系型数据库, 如MYSQL(使用时需遵守其许可).
1. 建库表, 数据库名为easyflow, 表结构可参考源码中的create_all_table.sql和sample_form_template.sql.
1. sample模块的application-open-all.yml文件中配置数据库连接信息, pom中引入数据库驱动jar包.
1. 编译构建代码工程, 启动IntegrationOpenApplication类. 启动成功后访问http://localhost:9888便可看到JDEasyFlow管理界面.


JDEasyFlow具有非常灵活的扩展性,你可以基于目前已开源组件做更多的功能,如流程持久化、任务审批等.
### 更多
JDEasyFlow具有非常灵活的扩展性,你可以基于目前已开源组件扩展做更多的功能.

### 联系我们
email: [email protected]
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,22 @@ The executing log are as follows:
[main ] INFO BaseFlowRunner - NEXT NODES:
[main ] INFO QuickStartTest - Execute finish, current node is:node003
```
Above is simple usecase, JDEasyFlow support many configurations and use cases. More can be seen in wiki doc.

#### FlowEngine-BPMN
Open flow designer with path easyflow-flow-bpmn/BPMNDesigner.html. Click import button, import easyflow-flow-bpmn/src/test/resources/flow/quickstart/quickstart_001.bpmn file. You can see bpmn flow definition of equal JSON format.
You only need set flowPaser of FlowEngineImpl to BpmnFlowParser when use.

#### Process
Process module provide persistence and task audit ability based on flow engine, needing relation database support. Sample application in the source code can be started as follows:
1. Checkout source code.
1. Install relation database system, for example MYSQL(You should obey their license).
1. Create database and table. Database name is easyflow, Table schema can be referred by create_all_table.sql and sample_form_template.sql.
1. Config database connection info in application-open-all.yml of sample module, Import database driver jar in pom.xml of sample module.
1. Build the project. Start IntegrationOpenApplication. Access http://localhost:9888.


### More
Above is simple usecase, JDEasyFlow support many configurations and use cases. More can be seen in wiki doc.

JDEasyFlow has very flexible extension ability. You can implement more features based on current component. For example flow data persistence, auditting, exception retry.

Expand Down
2 changes: 1 addition & 1 deletion easyflow-flow-bpmn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>easyflow-parent</artifactId>
<groupId>com.jd.easyflow</groupId>
<version>1.3.1</version>
<version>1.4.0</version>
</parent>
<artifactId>easyflow-flow-bpmn</artifactId>
<name>easyflow-flow-bpmn</name>
Expand Down
5 changes: 3 additions & 2 deletions easyflow-flow-bpmn/static/plugins/flow/flow.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@

/**instance info style*/
.j-bpmn-node-close:not(.djs-connection) .djs-visual>:nth-child(1) {
fill: #3f3 !important; /* color elements as green */
fill: #F0FFF0 !important; /* color elements as green */
}

.j-bpmn-node-active:not(.djs-connection) .djs-visual>:nth-child(1) {
fill: #ff0 !important; /* color elements as green */
fill: #FFFACD !important; /* color elements as green */
}


.j-bpmn-comment-select-container {
display: inline-block;
}
Expand Down
39 changes: 28 additions & 11 deletions easyflow-flow-bpmn/static/plugins/std-common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,8 @@ var _ajaxSuccessCallback = function(data, option, $element) {

var fileInputs = $('input[type=file]', $form);
var hasFileInputs = fileInputs.length > 0;
if(hasFileInputs && (option.iframe === undefined)) {
option.iframe=true;
if(hasFileInputs) {
throw new Error("file type is unsupported");
}
option.dataType = "text";

Expand All @@ -567,28 +567,42 @@ var _ajaxSuccessCallback = function(data, option, $element) {
$.jLoading.hide(loading);
$.jMessage({title: '&nbsp;', msg: J.msg['jAjax.requestException']});
};

// Has confirm dialog
if (confirm) {
$.jConfirm({msg:confirm, callback:function(){
loading = $.jLoading.show();
$form.ajaxSubmit(option);
_jAjaxSubmit($form, option);
}});
// No confirm dialog
} else {
loading=$.jLoading.show();
$form.ajaxSubmit(option);
_jAjaxSubmit($form, option);
}
};

var _jAjaxSubmit=function($form, option) {
var url = $form.attr("action");
var data = $form.serialize();
$.ajax({
type:"POST",
url:url,
data: data,
dataType:"text",
success:option.success,
error:option.error
});

}

//Table select control
var JTableSelect=function(option) {
this.$container = option.container;
this.fieldValueName=option.name;//form field name, required
this.inputFieldName = option.inputFieldName;//name of input control, not required, jquery validate
this.inputFieldName = option.inputFieldName;//name of input control, not required,jquery validate
this.selectType = option.selectType==="multiple"?"multiple":"single";//select type
this.initValue = option.initValue;//init value, single select is tring, multiple select is array
this.initInput = option.initInput;//init input, single select is tring, multiple select is array
this.initValue = option.initValue;//init value,single select is tring,multiple select is array
this.initInput = option.initInput;//init input,single select is tring,multiple select is array
this.valueColumn=option.valueColumn?option.valueColumn:option.name;// value column of table(input back to select)
this.inputColumn=option.inputColumn?option.inputColumn:this.valueColumn;// input column of talbe(input back to input)
this.showValue=option.showValue === true ? true:false;
Expand Down Expand Up @@ -671,7 +685,7 @@ var _ajaxSuccessCallback = function(data, option, $element) {
this.$inputField = this.$container.find("input");
this._renderValue(this.initValue);
this._renderInput(this._inputText(this.initInput, this.initValue));
//ajax get init show value.input format {value:value},output format {input:input},single select is string, multiple select is array
//ajax get init show value.input format {value:value},output format {input:input},single select is string,multiple select is array
if (this.initValue !== '' && this.initValue !== null && this.initValue !== undefined && (this.initInput === undefined || this.initInput===''||this.initInput===null) && this.initUrl) {
this._renderInput(this.initValue);
$.ajax({url: this.initUrl, data:JSON.stringify({value:this.initValue}),
Expand Down Expand Up @@ -757,7 +771,7 @@ var _ajaxSuccessCallback = function(data, option, $element) {
// List select control
var JListSelect = function (option) {
this.$container = option.container;
this.initValue = option.initValue;//init value, array
this.initValue = option.initValue;//init value,array
this.initUrl = option.initUrl;//init show url
var _self = this;
this.render=function() {
Expand Down Expand Up @@ -952,6 +966,9 @@ J.formatTimestampOrStrTime = function(timesMs) {
return y+'-'+check(m)+'-'+check(d)+' '+check(h)+':'+check(mm)+':'+check(s);
};

/**
* Open window
*/
J.openWindow=function(url, name, specs, replace) {
if (self != top) {
window.location.href=url;
Expand All @@ -961,7 +978,7 @@ J.openWindow=function(url, name, specs, replace) {
}

/**
*
* eval js, print exception.
*/
J.eval = function(js, ctxData) {
try {
Expand Down
2 changes: 1 addition & 1 deletion easyflow-flow-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>easyflow-parent</artifactId>
<groupId>com.jd.easyflow</groupId>
<version>1.3.1</version>
<version>1.4.0</version>
</parent>
<artifactId>easyflow-flow-extension</artifactId>
<name>easyflow-flow-extension</name>
Expand Down
2 changes: 1 addition & 1 deletion easyflow-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>easyflow-parent</artifactId>
<groupId>com.jd.easyflow</groupId>
<version>1.3.1</version>
<version>1.4.0</version>
</parent>
<artifactId>easyflow-flow</artifactId>
<name>easyflow-flow</name>
Expand Down
2 changes: 1 addition & 1 deletion easyflow-fsm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>easyflow-parent</artifactId>
<groupId>com.jd.easyflow</groupId>
<version>1.3.1</version>
<version>1.4.0</version>
</parent>
<artifactId>easyflow-fsm</artifactId>
<name>easyflow-fsm</name>
Expand Down
48 changes: 48 additions & 0 deletions easyflow-process/easyflow-process-admin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<artifactId>easyflow-process</artifactId>
<groupId>com.jd.easyflow</groupId>
<version>1.4.0</version>
</parent>
<artifactId>easyflow-process-admin</artifactId>
<name>easyflow-process-admin</name>
<packaging>jar</packaging>
<properties>
</properties>
<dependencies>
<dependency>
<groupId>com.jd.easyflow</groupId>
<artifactId>easyflow-process-api</artifactId>
</dependency>
<dependency>
<groupId>com.jd.easyflow</groupId>
<artifactId>easyflow-process-common</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.jd.easyflow</groupId>
<artifactId>easyflow-flow-bpmn</artifactId>
</dependency>
<dependency>
<groupId>com.jd.easyflow</groupId>
<artifactId>easyflow-fsm</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.jd.easyflow.admin.form.adapter.page;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jd.easyflow.admin.form.adapter.page.converter.PagerConverter;
import com.jd.easyflow.common.adapter.export.dto.ExportRequest;
import com.jd.easyflow.common.adapter.export.dto.ExportResponse;
import com.jd.easyflow.common.adapter.export.util.ExportResponseUtil;
import com.jd.easyflow.common.adapter.page.BasePageController;
import com.jd.easyflow.common.dto.DataResponse;
import com.jd.easyflow.common.dto.pager.PagerCondition;
import com.jd.easyflow.form.adapter.export.FormTemplateExport;
import com.jd.easyflow.form.adapter.export.dto.FormTemplateDTO;
import com.jd.easyflow.objects.factory.ObjectFactorys;

/**
*
* @author liyuliang5
*
*/
@Controller
public class FormTemplateAdminController extends BasePageController {

private FormTemplateExport formTemplateExport;

@RequestMapping("easyflow/formTemplate/formTemplateList")
public String templateList(Model model) {
return "easyflow/formtemplate/formTemplateList";
}

@RequestMapping("easyflow/formTemplate/ajax/getListData")
@ResponseBody
public DataResponse<com.jd.easyflow.common.adapter.export.dto.pager.PagerResult> getData() {
PagerCondition condition = getPagerCondition();
ExportResponse<com.jd.easyflow.common.adapter.export.dto.pager.PagerResult> response = getFormTemplateExport()
.find(new ExportRequest(PagerConverter.INSTANCE.convert(condition)));
response.getData().getList().forEach(o -> {
((FormTemplateDTO) o).setConfig(null);
});
return new DataResponse<com.jd.easyflow.common.adapter.export.dto.pager.PagerResult>(
ExportResponseUtil.unwrap(response));
}

@RequestMapping("easyflow/formTemplate/formTemplateDetail")
public String detailPage(String templateCode, Model model) {
ExportResponse<FormTemplateDTO> response = getFormTemplateExport().get(new ExportRequest(templateCode));
FormTemplateDTO formTemplate = ExportResponseUtil.unwrap(response);
model.addAttribute("detail", formTemplate);
return "easyflow/formtemplate/formTemplateDetail";
}

@RequestMapping("easyflow/formTemplate/formTemplateAdd")
public String addPage(Model model) {
return "easyflow/formtemplate/formTemplateAdd";
}

@RequestMapping("easyflow/formTemplate/formTemplateEdit")
public String editPage(String templateCode, Model model) {
ExportResponse<FormTemplateDTO> response = getFormTemplateExport().get(new ExportRequest(templateCode));
model.addAttribute("detail", ExportResponseUtil.unwrap(response));
return "easyflow/formtemplate/formTemplateEdit";
}

@RequestMapping("easyflow/formTemplate/ajax/add")
@ResponseBody
public DataResponse<Void> add(FormTemplateDTO formTemplate) {
getFormTemplateExport().add(new ExportRequest(formTemplate));
return new DataResponse<>();
}

@RequestMapping("easyflow/formTemplate/ajax/edit")
@ResponseBody
public DataResponse<Void> edit(FormTemplateDTO formTemplate) {
getFormTemplateExport().update(new ExportRequest(formTemplate));
return new DataResponse<>();
}

@RequestMapping("easyflow/formTemplate/ajax/getTemplate")
@ResponseBody
public DataResponse<Map<String, Object>> getTemplate(String templateCode) {
ExportResponse<FormTemplateDTO> response = getFormTemplateExport().get(new ExportRequest(templateCode));
Map<String, Object> result = new HashMap<>();
String config = null == ExportResponseUtil.unwrap(response) ? null : ExportResponseUtil.unwrap(response).getConfig();
result.put("config", config);
return new DataResponse<>(result);
}

public FormTemplateExport getFormTemplateExport() {
if (formTemplateExport == null) {
formTemplateExport = ObjectFactorys.getDefault().getObject(FormTemplateExport.class);
}
return formTemplateExport;
}

}
Loading

0 comments on commit d33c679

Please sign in to comment.