flowable6.8驳回
时间: 2023-12-05 17:39:30 浏览: 50
以下是Flowable 6.8驳回的方法:
1.在BPMN模型中添加一个UserTask节点,用于处理驳回操作。
2.在UserTask节点的属性中,设置Assignee为${initiator},表示任务的处理人为流程的发起人。
3.在UserTask节点的属性中,设置Candidate Groups为${deptLeader},表示任务的候选组为部门领导。
4.在UserTask节点的属性中,设置Task Listener为class类型,Listener Type为complete,Class为org.flowable.engine.delegate.TaskListener,Implementation为Java Class的全限定名,如com.example.MyTaskListener。
5.在MyTaskListener中,实现notify方法,用于处理任务完成时的逻辑。在该方法中,可以通过task.getExecution().getVariable("status")获取流程的状态,如果状态为“驳回”,则将任务的处理人设置为流程的发起人,将任务的候选组设置为部门领导。
6.在BPMN模型中,将UserTask节点的Outgoing Sequence Flow连接到之前的节点,表示驳回操作完成后,流程将回到之前的节点。
以下是Java代码示例:
```java
public class MyTaskListener implements TaskListener {
@Override
public void notify(DelegateTask task) {
String status = (String) task.getExecution().getVariable("status");
if ("驳回".equals(status)) {
task.setAssignee((String) task.getExecution().getVariable("initiator"));
task.addCandidateGroup((String) task.getExecution().getVariable("deptLeader"));
}
}
}
```
相关推荐
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)