Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
workflow
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
workflow
Commits
2c162c22
Commit
2c162c22
authored
Sep 13, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
8a45e49f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
55 deletions
+30
-55
TestApiImpl.java
src/main/java/com/egolm/workflow/test/TestApiImpl.java
+30
-6
TestApplication.java
src/main/java/com/egolm/workflow/test/TestApplication.java
+0
-49
No files found.
src/main/java/com/egolm/workflow/test/TestApiImpl.java
View file @
2c162c22
...
...
@@ -2,18 +2,19 @@ package com.egolm.workflow.test;
import
java.util.Map
;
import
org.junit.Test
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.workflow.AbstractOpenApi
;
import
com.egolm.workflow.bean.TFlowTask
;
import
com.mchange.v2.c3p0.ComboPooledDataSource
;
public
class
TestApiImpl
extends
AbstractOpenApi
{
private
JdbcTemplate
jdbcTemplate
;
public
TestApiImpl
(
JdbcTemplate
jdbcTemplate
)
{
this
.
jdbcTemplate
=
jdbcTemplate
;
}
@Override
public
JdbcTemplate
getFlowDBTemplate
()
{
return
this
.
jdbcTemplate
;
...
...
@@ -37,5 +38,28 @@ public class TestApiImpl extends AbstractOpenApi {
public
String
parseFlowSettings
(
String
jsonData
)
{
return
null
;
}
}
@Test
public
void
exec
(){
ComboPooledDataSource
ds
=
new
ComboPooledDataSource
(
"db"
);
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
ds
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
jdbcTemplate
.
setSql_level
(
3
);
TestApiImpl
openApi
=
new
TestApiImpl
();
openApi
.
jdbcTemplate
=
jdbcTemplate
;
String
flowName
=
"测试4"
;
String
owner
=
"quxl"
;
String
manager
=
"hanxu"
;
TFlowTask
task
=
openApi
.
start
(
flowName
,
owner
,
null
);
openApi
.
accept
(
task
.
getsTaskID
(),
owner
);
task
=
openApi
.
commit
(
task
.
getsTaskID
(),
"提交请假单"
,
"流程发起人提交请假单"
,
owner
,
null
);
openApi
.
accept
(
task
.
getsTaskID
(),
manager
);
task
=
openApi
.
commit
(
task
.
getsTaskID
(),
"同意"
,
"经理批准请假"
,
manager
,
null
);
}
}
\ No newline at end of file
src/main/java/com/egolm/workflow/test/TestApplication.java
deleted
100644 → 0
View file @
8a45e49f
package
com
.
egolm
.
workflow
.
test
;
import
java.beans.PropertyVetoException
;
import
java.sql.SQLException
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
org.junit.Before
;
import
org.junit.Test
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.workflow.AbstractOpenApi
;
import
com.egolm.workflow.bean.TFlowTask
;
import
com.mchange.v2.c3p0.ComboPooledDataSource
;
public
class
TestApplication
{
private
final
String
flowName
=
"测试4"
;
private
final
String
owner
=
"quxinliang"
;
private
final
String
manager
=
"hanxu"
;
private
final
String
formId
=
"Leave_001"
;
private
AbstractOpenApi
openApi
=
null
;
@Before
public
void
init
()
throws
PropertyVetoException
,
SQLException
{
ComboPooledDataSource
ds
=
new
ComboPooledDataSource
(
"db"
);
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
ds
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
jdbcTemplate
.
setSql_level
(
3
);
openApi
=
new
TestApiImpl
(
jdbcTemplate
);
}
@Test
public
void
exec
(){
TFlowTask
task
=
openApi
.
start
(
flowName
,
owner
,
null
);
Map
<
String
,
Object
>
vars
=
new
LinkedHashMap
<
String
,
Object
>();
vars
.
put
(
"id"
,
formId
);
openApi
.
accept
(
task
.
getsTaskID
(),
owner
);
task
=
openApi
.
commit
(
task
.
getsTaskID
(),
"提交请假单"
,
"流程发起人提交请假单"
,
owner
,
vars
);
openApi
.
accept
(
task
.
getsTaskID
(),
manager
);
task
=
openApi
.
commit
(
task
.
getsTaskID
(),
"同意"
,
"经理批准请假"
,
manager
,
null
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment