You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Hi,

We have got two forms. In the first form we set a workflow variable value (global1) use by a textbox. The second form we would like to set this workflow variable value to the local variable(test) in  the plugin and we would like to use after in beanshell plugin script this value.

#variable.global1# working in the Launch form builder but not working in the plugin.

Like this:

String test = "#variable.global1#";

The problem no set global1 value to the test.

How can I set a workflow variable value in beanshell?

Thx. Please help.

That's the code, but not at all:

import java.util.*;
import org.apache.commons.collections.SequencedHashMap;
import java.sql.*;
import org.joget.workflow.model.service.*;

WorkflowManager wm = (WorkflowManager) pluginManager.getBean("workflowManager");
*//*String test = "SAP"; <<<< It's working
String test = "#variable.global1#";   <<<PROBLEM NOT WORKING

Map result = new SequencedHashMap();
Connection con = null;

try {
 Class.forName("com.mysql.jdbc.Driver").newInstance();
 con = DriverManager.getConnection("jdbc:mysql://localhost:3306/wflowdb?useUnicode=true&characterEncoding=UTF-8", "---", "---"); // declare datasource

 if(!con.isClosed()){
 PreparedStatement stmt = con.prepareStatement("SELECT id, c_User_ID, c_Szkor_ID, c_Szkor_nev FROM formdata_Sz_gazdak WHERE c_Szolg_ID = '"#test#"');
                                                                                                                                                                                                                                PROBLEM
  ResultSet rs = stmt.executeQuery();

...

return result;

  • No labels