Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi ,
Anyone Know that how to get login user Name form the beanshell plugin?is can be using hash variable?
I tryed it like this.but its not works.is there any idea to solve this proble?aslo i tryed using #form.name#.but its also not working?
import java.util.*;
import org.apache.commons.collections.SequencedHashMap;
import java.sql.*;
import org.joget.workflow.model.service.*;
Map result = new SequencedHashMap();
WorkflowManager wm = (WorkflowManager) pluginManager.getBean("workflowManager");
String test ="#performer.wp1_act1.firstName#";
String ttt;
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost:3307/sampledb?useUnicode=true&characterEncoding=UTF-8", "root", ""); // declare datasource
if(!con.isClosed()){
PreparedStatement stmt = con.prepareStatement("select myBackUser, username from dir_user where id='"test"'"); // SQL query
ResultSet rs = stmt.executeQuery();
Map result = new SequencedHashMap();
while (rs.next())
}
} catch(Exception e) {
System.err.println("Exception from BeanShell activity: " + e.getMessage());
} finally{
try
catch(SQLException e) {}
}
result.put("bvbb",ttt);
return result;