有些东西,这个地方都阐述了。我在这里,仅仅说明一下自己遇到的问题和想法。
step1 : 上maven pom.xml文件
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
<
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.jbpm</
groupId
>
<
artifactId
>jbpm4ssh</
artifactId
>
<
version
>0.0.1-SNAPSHOT</
version
>
<
packaging
>war</
packaging
>
<
properties
>
<
java.version
>1.6</
java.version
>
<
java.encoding
>UTF-8</
java.encoding
>
<
java.home
>D:\Java\jdk1.6.0_10</
java.home
>
</
properties
>
<
repositories
>
<
repository
>
<
id
>maven</
id
>
<
url
>http://repo1.maven.org/maven2/</
url
>
</
repository
>
<
repository
>
<
id
>jboss</
id
>
<
url
>https://repository.jboss.org/nexus/content/repositories/releases</
url
>
</
repository
>
</
repositories
>
<
dependencies
>
<
dependency
>
<
groupId
>org.jbpm.jbpm4</
groupId
>
<
artifactId
>jbpm-api</
artifactId
>
<
version
>4.4</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.jbpm.jbpm4</
groupId
>
<
artifactId
>jbpm-bpmn</
artifactId
>
<
version
>4.4</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.springframework</
groupId
>
<
artifactId
>spring-web</
artifactId
>
<
version
>3.0.4.RELEASE</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.springframework</
groupId
>
<
artifactId
>spring-orm</
artifactId
>
<
version
>3.0.4.RELEASE</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.jbpm.jbpm4</
groupId
>
<
artifactId
>jbpm-db</
artifactId
>
<
version
>4.4</
version
>
<
exclusions
>
<
exclusion
>
<
groupId
>hsqldb</
groupId
>
<
artifactId
>hsqldb</
artifactId
>
</
exclusion
>
<
exclusion
>
<
groupId
>mysql</
groupId
>
<
artifactId
>mysql-connector-java</
artifactId
>
</
exclusion
>
<
exclusion
>
<
groupId
>postgresql</
groupId
>
<
artifactId
>postgresql</
artifactId
>
</
exclusion
>
</
exclusions
>
</
dependency
>
<
dependency
>
<
groupId
>com.oracle</
groupId
>
<
artifactId
>ojdbc14</
artifactId
>
<
version
>10.2.0.1.0</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.hibernate</
groupId
>
<
artifactId
>hibernate-core</
artifactId
>
<
version
>3.6.5.Final</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
<
exclusions
>
<
exclusion
>
<
groupId
>org.slf4j</
groupId
>
<
artifactId
>slf4j-api</
artifactId
>
</
exclusion
>
</
exclusions
>
</
dependency
>
<
dependency
>
<
groupId
>org.apache.struts</
groupId
>
<
artifactId
>struts2-spring-plugin</
artifactId
>
<
version
>2.1.8.1</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>javax.servlet</
groupId
>
<
artifactId
>jsp-api</
artifactId
>
<
version
>2.0</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>org.apache.struts</
groupId
>
<
artifactId
>struts2-core</
artifactId
>
<
version
>2.1.8.1</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>com.sun</
groupId
>
<
artifactId
>tools</
artifactId
>
<
version
>1.5.0</
version
>
<
scope
>system</
scope
>
<
systemPath
>${java.home}/lib/tools.jar</
systemPath
>
</
dependency
>
<
dependency
>
<
groupId
>org.aspectj</
groupId
>
<
artifactId
>aspectjweaver</
artifactId
>
<
version
>1.7.0</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>org.aspectj</
groupId
>
<
artifactId
>aspectjrt</
artifactId
>
<
version
>1.7.0</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.slf4j</
groupId
>
<
artifactId
>slf4j-api</
artifactId
>
<
version
>1.6.3</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>org.slf4j</
groupId
>
<
artifactId
>slf4j-log4j12</
artifactId
>
<
version
>1.6.3</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>org.slf4j</
groupId
>
<
artifactId
>slf4j-nop</
artifactId
>
<
version
>1.6.3</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>commons-dbcp</
groupId
>
<
artifactId
>commons-dbcp</
artifactId
>
<
version
>1.2.2</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>javax.activation</
groupId
>
<
artifactId
>activation</
artifactId
>
<
version
>1.1.1</
version
>
<
type
>jar</
type
>
<
scope
>compile</
scope
>
</
dependency
>
<
dependency
>
<
groupId
>javax.mail</
groupId
>
<
artifactId
>mail</
artifactId
>
<
version
>1.4.2</
version
>
</
dependency
>
<
dependency
>
<
groupId
>org.apache.tomcat</
groupId
>
<
artifactId
>jasper</
artifactId
>
<
version
>6.0.13</
version
>
</
dependency
>
</
dependencies
>
<
build
>
<
finalName
>simple-webapp</
finalName
>
<
plugins
>
<
plugin
>
<
groupId
>org.apache.maven.plugins</
groupId
>
<
artifactId
>maven-war-plugin</
artifactId
>
<
version
>2.1.1</
version
>
<
configuration
>
<
webXml
>.\src\main\webapp\WEB-INF\web.xml</
webXml
>
</
configuration
>
</
plugin
>
</
plugins
>
</
build
>
</
project
>
|
迷恋maven的朋友,知道maven的
我的数据库是orace,个人看情况定。
我发现,<s:debug>在jetty运行,报错。这个问题一直没有解决。网上说是jetty的原因。在tomcat下没问题。对这个问题,我没有深究。在这里,仅仅关注JBPM.
运行起来,效果是这样子。
对于工作流,和人员权限有非常密切的关系,是在程序里写死的。如果在实际环境中,可以通过查询数据库实现。
LoginAction.java 片段。
虚拟了3个角色,分别对应请假流程的三个节点。
申请,经理审批,老板审批。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
String manager =
"admin,centre,xie"
;
String boss =
"god,oo,test,boss"
;
String roleName =
""
;
// 要按此名去查找它所在的节点
System.out.println(userName);
if
(userName==
null
) {
return
"login"
;
}
else
if
(manager.contains(userName)) {
// 经理登陆
roleName =
"manager"
;
}
else
if
(boss.contains(userName)) {
// 老板登陆
roleName =
"boss"
;
}
else
{
// 普通用户
roleName = userName;
}
Map<String, Object> map = ActionContext.getContext().getSession();
map.put(
"user"
, userName);
map.put(
"role"
, roleName);
|
本文转自 randy_shandong 51CTO博客,原文链接:http://blog.51cto.com/dba10g/1347274,如需转载请自行联系原作者