Countersigning
First of all, we need to implement a listener. There are two kinds of task listener and process listener. Here I use task listener.
public class MyTaksListener implements TaskListener { @Override public void notify(DelegateTask delegateTask) { System.out.println("delegateTask.getEventName() = " + delegateTask.getEventName()); //Adding signers, all of them are approved before they can enter the next stage. List<String> assigneeList = new ArrayList<String>(); assigneeList.add("lfs"); assigneeList.add("cwb"); delegateTask.setVariable("publicityList",assigneeList); } }
Start the listener at the initiating application node in the process
Setting variables at nodes that require approval by multiple people
Use your own user table
Delete the tables act_id_user, act_id_group, act_id_membership that come with Activiti
Use views to query your own user table data instead of existing tables
DROP VIEW IF EXISTS OYDGHR.act_id_membership; DROP VIEW IF EXISTS OYDGHR.act_id_user; DROP VIEW IF EXISTS OYDGHR.act_id_group; -- (ID_,REV_,FIRST_,LAST_,EMAIL_,PWD_,PICTURE_ID_ ,CONSTRAINT id_pk PRIMARY KEY(ID_) RELY DISABLE NOVALIDATE) CREATE VIEW OYDGHR.act_id_user AS SELECT TO_CHAR(au.S01_ID) AS ID_, 0 AS REV_, to_char(au.S0109) AS FIRST_, '' AS LAST_, to_char(au.S0117) AS EMAIL_, to_char(au.S0170) AS PWD_, '' AS PICTURE_ID_ FROM OYDGHR.S01 au; CREATE VIEW OYDGHR.act_id_group AS SELECT ar.S05_ID AS ID_, NULL AS REV_, ar.S0504 AS NAME_, 'assignment' AS TYPE_ FROM OYDGHR.S05 ar; CREATE VIEW OYDGHR.act_id_membership AS SELECT (SELECT u.S01_ID FROM OYDGHR.S01 u WHERE u.S01_ID=ur.S01_ID) AS USER_ID_, (SELECT r.S05_ID FROM OYDGHR.S05 r WHERE r.S05_ID=ur.S05_ID) AS GROUP_ID_ FROM OYDGHR.S011 ur;