Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
I want to use Beanshell plugins and SQL join queries to return the name of user(s) for mapping participants.
It doesn't seem to work. How do I go about doing this
SELECT username FROM dir_user WHERE criteria = 'something';
Connection con = null;
try { Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost:3307/jwdb?characterEncoding=UTF-8", "root", "");
if(!con.isClosed()){
//manually handle insert and update by checking the data is exist or not
String selectQuery = "SELECT `id` FROM dir_user WHERE `id`=?";
PreparedStatement stmt = con.prepareStatement(selectQuery);
stmt.setString(1, id);
ResultSet rs = stmt.executeQuery();
... Connection con = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3307/jwdb?characterEncoding=UTF-8", "root", "London2012"); if(!con.isClosed()){ //manually handle insert and update by checking the data is exist or not String selectQuery = "SELECT `id` FROM dir_user WHERE `id`=?"; PreparedStatement stmt = con.prepareStatement(selectQuery); stmt.setString(1, id); ResultSet rs = stmt.executeQuery(); } catch (Exception ex) { System.err.println("#### Exception: " + ex.getMessage()); } finally { try { if(con != null) con.close(); } catch(SQLException e) {} } return rs; ...
4 Comments
Bastiana
What error are you getting?
Garrett
I am using
There is no error return but it is not mapping the process to the Admin participant. anyone can run the process
Hugo
Hi there,
Please see Bean Shell Programming. Look for Participant Type Plugin. You will see an example on how to set the assignees from the Beanshell.
Cheers
Hafidz Muttiillah
Hi Garrett i have problem same with you, you can use has variable joget like that
"SELECT yourfield FROM yourtable where id = ' #assignment.processId# ' ;"