Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
In your approver swimlane, you will need to add logic to pick up who has approved before and only return those never approved before.
In your approver's swimlane, you can configure it to point to beanshell participant plugin with the following code.
import java.util.ArrayList; import java.util.Collection; import org.joget.commons.util.LogUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.sql.DataSource; import org.joget.apps.app.service.AppUtil; //list down all approvers Collection assignees = new ArrayList(); assignees.add("cat"); assignees.add("jack"); assignees.add("mike"); //find out who has already approved and remove them from assignees Connection con = null; try { // retrieve connection from the default datasource DataSource ds = (DataSource)AppUtil.getApplicationContext().getBean("setupDataSource"); con = ds.getConnection(); // execute SQL query if(!con.isClosed()) { PreparedStatement stmt = con.prepareStatement("SELECT createdBy from app_fd_#appDef.appId#_pd where c_status = 'Approved'"); ResultSet rs = stmt.executeQuery(); while (rs.next()) { String user = rs.getObject("createdBy"); assignees.remove(user); } } } catch(Exception e) { LogUtil.error("Participant Mapping", e, "Error loading user data in participant mapping"); } finally { //always close the connection after used try { if(con != null) { con.close(); } } catch(SQLException e) {/* ignored */} } return assignees;
I tested this code and it worked on mine. You can adjust to your needs.
Hi ,
I have a system whith a multiple approval by :Process Enhancement Plugin#MapActivitiestoForms-MoreSettings
My problem is when the one of the approver managers chooses: (clarification), re-requesting approval is sent to everyone (even those who previously chooses approve it).
How can I re-request approval to the person who only asked for clarification?