forked from henryyan/kft-activiti-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
254 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"/> | ||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/> | ||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> | ||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/me/kafeitu/demo/activiti/web/form/dynamic/DynamicFormController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package me.kafeitu.demo.activiti.web.form.dynamic; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.activiti.engine.FormService; | ||
import org.activiti.engine.RepositoryService; | ||
import org.activiti.engine.form.StartFormData; | ||
import org.activiti.engine.impl.form.StartFormDataImpl; | ||
import org.activiti.engine.repository.ProcessDefinition; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
/** | ||
* 动态FormController | ||
* | ||
* @author HenryYan | ||
*/ | ||
@Controller | ||
@RequestMapping(value = "/form/dynamic") | ||
public class DynamicFormController { | ||
|
||
@Autowired | ||
private RepositoryService repositoryService; | ||
|
||
@Autowired | ||
private FormService formService; | ||
|
||
/** | ||
* 动态form流程列表 | ||
* @param model | ||
* @return | ||
*/ | ||
@RequestMapping(value = { "list", "" }) | ||
public ModelAndView processDefinitionList(Model model) { | ||
ModelAndView mav = new ModelAndView("/form/dynamic/dynamic-form-process-list"); | ||
List<ProcessDefinition> newResult = new ArrayList<ProcessDefinition>(); | ||
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list(); | ||
|
||
/* | ||
* 只读取包含dynamic的流程 | ||
*/ | ||
for (ProcessDefinition processDefinition : list) { | ||
if (processDefinition.getKey().indexOf("dynamic") != -1) { | ||
newResult.add(processDefinition); | ||
} | ||
} | ||
mav.addObject("processes", newResult); | ||
return mav; | ||
} | ||
|
||
/** | ||
* 读取启动流程的表单字段 | ||
*/ | ||
@RequestMapping(value = "get-start-form-field/{processDefinitionId}") | ||
@ResponseBody | ||
public StartFormData findFieldOfForm(@PathVariable("processDefinitionId") String processDefinitionId) throws Exception { | ||
StartFormDataImpl startFormData = (StartFormDataImpl) formService.getStartFormData(processDefinitionId); | ||
startFormData.setProcessDefinition(null); | ||
return startFormData; | ||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.48 KB
(110%)
src/main/resources/diagrams/leave-dynamic-from/leave-dynamic-from.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions
52
src/main/webapp/WEB-INF/views/form/dynamic/dynamic-form-process-list.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<head> | ||
<%@ include file="/common/global.jsp"%> | ||
<title>动态Form流程列表</title> | ||
<%@ include file="/common/meta.jsp" %> | ||
<%@ include file="/common/include-base-styles.jsp" %> | ||
<%@ include file="/common/include-jquery-ui-theme.jsp" %> | ||
<link href="${ctx }/js/common/plugins/jui/extends/timepicker/jquery-ui-timepicker-addon.css" type="text/css" rel="stylesheet" /> | ||
|
||
<script src="${ctx }/js/common/jquery.js" type="text/javascript"></script> | ||
<script src="${ctx }/js/common/plugins/jui/jquery-ui.min.js" type="text/javascript"></script> | ||
<script src="${ctx }/js/common/plugins/jui/extends/timepicker/jquery-ui-timepicker-addon.js" type="text/javascript"></script> | ||
<script src="${ctx }/js/common/plugins/jui/extends/i18n/jquery-ui-date_time-picker-zh-CN.js" type="text/javascript"></script> | ||
<script src="${ctx }/js/common/common.js" type="text/javascript"></script> | ||
<script src="${ctx }/js/module/form/dynamic/process.js?v=${timeInMillis}" type="text/javascript"></script> | ||
</head> | ||
|
||
<body> | ||
<table width="100%" class="need-border"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>DID</th> | ||
<th>名称</th> | ||
<th>KEY</th> | ||
<th>版本号</th> | ||
<th>XML</th> | ||
<th>图片</th> | ||
<th>操作</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<c:forEach items="${processes }" var="process"> | ||
<tr> | ||
<td class='process-id'>${process.id }</td> | ||
<td>${process.deploymentId }</td> | ||
<td class='process-name'>${process.name }</td> | ||
<td>${process.key }</td> | ||
<td>${process.version }</td> | ||
<td><a target="_blank" href='${ctx }/workflow/resource/deployment?deploymentId=${process.deploymentId}&resourceName=${process.resourceName }'>${process.resourceName }</a></td> | ||
<td><a target="_blank" href='${ctx }/workflow/resource/deployment?deploymentId=${process.deploymentId}&resourceName=${process.diagramResourceName }'>${process.diagramResourceName }</a></td> | ||
<td><a class="startup-process">启动</a></td> | ||
</tr> | ||
</c:forEach> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.