Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Using Preset Form Data Tool set ID for Approval Form, which leads to creating row in table with correct process ID (which datalist inbox uses for pairing with assignments through SHKAssignmentsTable ). Into field ID we assign #assignment.processId#, for Approval Form.
Ignore "Sample Form" it is my application with different names, there should be Form linked to Approval.
Add following lines into Generate Approvals Tool. This will save all child process ID's into childIDs column so we can have reference for datalist inbox.
Connection con = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jwdb?characterEncoding=UTF-8", "root", "/////////////"); if (!con.isClosed()) { String sql = "UPDATE jwdb.app_fd_multiApproval_applications SET c_childIDs = ? WHERE id = ?"; PreparedStatement stmt = con.prepareStatement(sql); String concated = approvalInstanceIds.substring(0, approvalInstanceIds.length() - 1); //cut out last "," stmt.setString(1, concated); stmt.setString(2, "#assignment.processId#"); stmt.execute(); } } catch (Exception ex) { System.err.println("Exception: " + ex.getMessage()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { System.err.println("Exception: " + ex.getMessage()); } }
setup connection to JWDB
Now write your own query to UNION data of this 2 processes.
This is example one which I use.
select jwdb.app_fd_multiApproval_approvals.id,NR.dateCreated, NR.dateModified, NR.c_value, NR.c_number, NR.c_doc_org, NR.c_requester_name, NR.c_priority from (select 1 n union all select 2 union all select 3 union all select 4 union all select 5) numbers INNER JOIN jwdb.app_fd_multiApproval_applications NR on CHAR_LENGTH(NR.c_childIDs) -CHAR_LENGTH(REPLACE(NR.c_childIDs, ',', ''))>=numbers.n-1 JOIN jwdb.app_fd_multiApproval_approvals ON SUBSTRING_INDEX(SUBSTRING_INDEX(NR.c_childIDs, ',', numbers.n), ',', -1) COLLATE utf8_general_ci = jwdb.app_fd_multiApproval_approvals.id where c_childIDs != '' and NR.c_requester is not null UNION select id, dateCreated, dateModified,c_value, c_number, c_doc_org, c_requester_name, c_priority from jwdb.app_fd_multiApproval_applications where jwdb.app_fd_multiApproval_applications .c_requester is not null
P.S. I would like to provide my application, but it is quite robust and this is only small part of it, I will try to provide edited Multiple Approval v2 (Thread safe) with datalist inbox as soon as possible.