cancel
Showing results for 
Search instead for 
Did you mean: 

record of database as a field injection

ibfgroupwork
Champ in-the-making
Champ in-the-making
hi,
i'm still a newbie with activiti and i have the following question:

how can i create a combobox that shows data from the database ?
ive been testing using a listener implementation but with no luck !!!!!!!!
please can someone help me with a full "how to "
i'll be so much greatful
thks in advance!!!!!!!!!!!!!
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Do not try to do everything IN Activiti… Use a normal webapp for things as well and integrate activiti in it…

ibfgroupwork
Champ in-the-making
Champ in-the-making
thaks for your replay!!!!!!!!!!  Smiley Happy

i was hoping that i can use listeners or such !!!!
in fact i dont need to build a webapp , the activitiexplorer is already enough for me
all i have is simple processes and vary simple forms
the only concern is that i want to display data from my database (mysql) in a field within a form
i've been reading and searching in the forums and i've found that this could be done with an external java class called from a listener
only i dont know how to cordinate between the result of this given class and the field within the form???????????!!!!!

thank for any help !!!!!!!!!!

ibfgroupwork
Champ in-the-making
Champ in-the-making
hi,
i've managed to read a value from the database and display it in a form field

i've use a java service task with the following class:

public class aicha implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception  {
 
  try {
   Class.forName("com.mysql.jdbc.Driver");
  } catch (ClassNotFoundException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
   Connection con;
   Statement stmt;

   try {
  

    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/activiti","root","a");
    System.out.println ("Ok, connection to the DB worked.");
    stmt = con.createStatement();
    String queryString1 = " select FIRST_ from act_id_user  ";
     
    ResultSet rs  = stmt.executeQuery(queryString1);
    while (rs.next()) {
      String name = rs.getString("FIRST_");
      execution.setVariable("nom",name);
   
     }
   
   
   
   } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   
   }
  

  //String nom = (String) execution.getVariable("nom");
  //conn();
  //execution.setVariable("nom",conn());
 
}
}

where nom is the id of the form's field in the process diagram.but i still have ine issue
how can' i display a collection of items from the database (combo box ) .i've tried to use the type "enum" but no results!!!!!!!


thanks for any reply