Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
flowable-engine
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
郑越
flowable-engine
Commits
462a7f93
Commit
462a7f93
authored
Jun 10, 2021
by
郑越
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
2890402c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
184 deletions
+136
-184
CmmnListenerNotificationHelper.java
.../engine/impl/listener/CmmnListenerNotificationHelper.java
+3
-1
pom.xml
modules/flowable-engine/pom.xml
+17
-0
TaskBusinessCallListener.java
...e/engine/impl/bpmn/listener/TaskBusinessCallListener.java
+115
-0
TaskFormResource.java
...a/org/flowable/ui/task/rest/runtime/TaskFormResource.java
+1
-0
pom.xml
modules/flowable-ui/pom.xml
+0
-183
No files found.
modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/listener/CmmnListenerNotificationHelper.java
View file @
462a7f93
...
@@ -52,13 +52,15 @@ public class CmmnListenerNotificationHelper {
...
@@ -52,13 +52,15 @@ public class CmmnListenerNotificationHelper {
public
void
executeTaskListeners
(
HumanTask
humanTask
,
TaskEntity
taskEntity
,
String
eventType
)
{
public
void
executeTaskListeners
(
HumanTask
humanTask
,
TaskEntity
taskEntity
,
String
eventType
)
{
for
(
FlowableListener
listener
:
humanTask
.
getTaskListeners
())
{
for
(
FlowableListener
listener
:
humanTask
.
getTaskListeners
())
{
String
event
=
listener
.
getEvent
();
String
event
=
listener
.
getEvent
();
System
.
out
.
println
(
"get executeTaskListeners eventName:"
+
event
);
if
(
event
.
equals
(
eventType
)
||
event
.
equals
(
TaskListener
.
EVENTNAME_ALL_EVENTS
))
{
if
(
event
.
equals
(
eventType
)
||
event
.
equals
(
TaskListener
.
EVENTNAME_ALL_EVENTS
))
{
TaskListener
taskListener
=
createTaskListener
(
listener
);
TaskListener
taskListener
=
createTaskListener
(
listener
);
System
.
out
.
println
(
"get executeTaskListeners taskListener:"
+
taskListener
.
toString
());
taskEntity
.
setEventName
(
eventType
);
taskEntity
.
setEventName
(
eventType
);
taskEntity
.
setEventHandlerId
(
listener
.
getId
());
taskEntity
.
setEventHandlerId
(
listener
.
getId
());
try
{
try
{
System
.
out
.
println
(
"get executeTaskListeners notify:"
+
taskEntity
.
toString
());
taskListener
.
notify
(
taskEntity
);
taskListener
.
notify
(
taskEntity
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
FlowableException
(
"Exception while invoking TaskListener: "
+
e
.
getMessage
(),
e
);
throw
new
FlowableException
(
"Exception while invoking TaskListener: "
+
e
.
getMessage
(),
e
);
...
...
modules/flowable-engine/pom.xml
View file @
462a7f93
...
@@ -14,6 +14,11 @@
...
@@ -14,6 +14,11 @@
</parent>
</parent>
<dependencies>
<dependencies>
<dependency>
<groupId>
javax.annotation
</groupId>
<artifactId>
javax.annotation-api
</artifactId>
<version>
1.3.2
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-bpmn-converter
</artifactId>
<artifactId>
flowable-bpmn-converter
</artifactId>
...
@@ -281,6 +286,18 @@
...
@@ -281,6 +286,18 @@
<version>
4.0.3
</version>
<version>
4.0.3
</version>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
</dependency>
</dependencies>
</dependencies>
...
...
modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/listener/TaskBusinessCallListener.java
0 → 100644
View file @
462a7f93
package
org
.
flowable
.
engine
.
impl
.
bpmn
.
listener
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.flowable.common.engine.impl.el.FixedValue
;
import
org.flowable.engine.runtime.ProcessInstance
;
import
org.flowable.task.service.delegate.DelegateTask
;
import
org.flowable.task.service.delegate.TaskListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.client.RestTemplate
;
import
org.flowable.engine.RuntimeService
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
org.flowable.engine.impl.context.Context
;
@Component
(
value
=
"taskBusinessCallListener"
)
public
class
TaskBusinessCallListener
implements
TaskListener
{
/**
* rest接口
*/
private
FixedValue
restUrl
;
/**
* 参数 多个的话用分号隔开 实例 userCode:00004737;status:1
*/
private
FixedValue
params
;
@Autowired
private
RestTemplate
restTemplate
;
@Autowired
private
ObjectMapper
objectMapper
;
@Autowired
private
RuntimeService
runtimeService
;
private
static
TaskBusinessCallListener
taskBusinessCallListener
;
@PostConstruct
public
void
init
(){
System
.
out
.
println
(
"---------init------"
+
this
);
taskBusinessCallListener
=
this
;
taskBusinessCallListener
.
restTemplate
=
this
.
restTemplate
;
taskBusinessCallListener
.
objectMapper
=
this
.
objectMapper
;
taskBusinessCallListener
.
runtimeService
=
this
.
runtimeService
;
System
.
out
.
println
(
"---------init------"
+
this
.
restTemplate
);
}
@Override
public
void
notify
(
DelegateTask
delegateTask
)
{
try
{
String
processInstanceId
=
delegateTask
.
getProcessInstanceId
();
String
restUrlStr
=
null
,
paramsStr
=
null
;
if
(
restUrl
!=
null
)
{
restUrlStr
=
restUrl
.
getExpressionText
();
}
if
(
params
!=
null
)
{
paramsStr
=
params
.
getExpressionText
();
}
System
.
out
.
println
(
restUrlStr
+
"?FlowDefID="
+
processInstanceId
);
System
.
out
.
println
(
paramsStr
);
restUrlStr
+=
"?FlowDefID="
+
processInstanceId
;
//执行回调
this
.
callBack
(
processInstanceId
,
restUrlStr
,
paramsStr
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"-----TaskBusinessCallListener----"
+
e
);
}
}
public
void
callBack
(
String
pocessInstanceId
,
String
restUrl
,
String
params
)
{
String
paramsJson
=
null
;
try
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
RuntimeService
runtime
=
Context
.
getProcessEngineConfiguration
().
getRuntimeService
();
ProcessInstance
processInstance
=
runtime
.
createProcessInstanceQuery
().
processInstanceId
(
pocessInstanceId
).
singleResult
();
paramMap
.
put
(
"FlowDefID"
,
processInstance
.
getBusinessKey
());
//paramMap.put("FlowDefID", pocessInstanceId);
this
.
setParams
(
params
,
paramMap
);
this
.
objectMapper
=
new
ObjectMapper
();
paramsJson
=
this
.
objectMapper
.
writeValueAsString
(
paramMap
);
//执行dubbo方法
//LOGGER.info("开始调用业务系统接口" + restUrl + ",业务参数:" + paramsJson);
this
.
restTemplate
=
new
RestTemplate
();
this
.
restTemplate
.
postForObject
(
restUrl
,
paramsJson
,
String
.
class
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"---------callBack------"
+
e
);
//throw new FlowableException("Exception while invoking TaskListener: " + e.getMessage(), e);
}
}
/**
* 设置参数
* @param parameters 参数
* @param paramMap 传值map
*/
public
void
setParams
(
String
parameters
,
Map
<
String
,
Object
>
paramMap
)
{
if
(
StringUtils
.
isNotBlank
(
parameters
))
{
String
[]
ps
=
parameters
.
split
(
";"
);
if
(
ps
!=
null
&&
ps
.
length
>
0
)
{
for
(
String
p
:
ps
)
{
String
[]
split
=
p
.
split
(
":"
);
if
(
split
!=
null
&&
split
.
length
>
0
)
{
paramMap
.
put
(
split
[
0
],
split
[
1
]);
}
}
}
}
}
}
modules/flowable-ui/flowable-ui-task-rest/src/main/java/org/flowable/ui/task/rest/runtime/TaskFormResource.java
View file @
462a7f93
...
@@ -79,6 +79,7 @@ public class TaskFormResource {
...
@@ -79,6 +79,7 @@ public class TaskFormResource {
Map
<
String
,
Object
>
flowParas
=
new
HashMap
<>();
Map
<
String
,
Object
>
flowParas
=
new
HashMap
<>();
flowParas
.
putAll
(
paras
);
flowParas
.
putAll
(
paras
);
flowParas
.
put
(
"outcome"
,
"拒绝"
);
taskService
.
complete
(
taskId
,
flowParas
);
taskService
.
complete
(
taskId
,
flowParas
);
if
(
bok
){
if
(
bok
){
...
...
modules/flowable-ui/pom.xml
deleted
100644 → 0
View file @
2890402c
<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>
<name>
Flowable UI Parent
</name>
<artifactId>
flowable-ui-parent
</artifactId>
<packaging>
pom
</packaging>
<parent>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-spring-boot
</artifactId>
<relativePath>
../flowable-spring-boot/pom.xml
</relativePath>
<version>
6.6.1-SNAPSHOT
</version>
</parent>
<properties>
<!-- Maven build properties -->
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<modules>
<module>
flowable-ui-common
</module>
<module>
flowable-ui-admin-logic
</module>
<module>
flowable-ui-admin-rest
</module>
<module>
flowable-ui-admin-conf
</module>
<module>
flowable-ui-admin-frontend
</module>
<module>
flowable-ui-idm-logic
</module>
<module>
flowable-ui-idm-rest
</module>
<module>
flowable-ui-idm-conf
</module>
<module>
flowable-ui-idm-frontend
</module>
<module>
flowable-ui-modeler-logic
</module>
<module>
flowable-ui-modeler-rest
</module>
<module>
flowable-ui-modeler-conf
</module>
<module>
flowable-ui-modeler-frontend
</module>
<module>
flowable-ui-task-logic
</module>
<module>
flowable-ui-task-rest
</module>
<module>
flowable-ui-task-conf
</module>
<module>
flowable-ui-task-frontend
</module>
<module>
flowable-spring-boot-starter-ui-admin
</module>
<module>
flowable-spring-boot-starter-ui-idm
</module>
<module>
flowable-spring-boot-starter-ui-modeler
</module>
<module>
flowable-spring-boot-starter-ui-task
</module>
<module>
flowable-ui-app
</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-common
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-admin-logic
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-admin-rest
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-admin-conf
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-admin-frontend
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-idm-logic
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-idm-rest
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-idm-conf
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-idm-frontend
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-modeler-logic
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-modeler-rest
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-modeler-conf
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-modeler-frontend
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-task-logic
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-task-rest
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-task-conf
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-ui-task-frontend
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-spring-boot-starter-ui-admin
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-spring-boot-starter-ui-idm
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-spring-boot-starter-ui-modeler
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.flowable
</groupId>
<artifactId>
flowable-spring-boot-starter-ui-task
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>
docker
</id>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-deploy-plugin
</artifactId>
<configuration>
<skip>
true
</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
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