0 Replies Latest reply on Dec 22, 2005 5:28 PM by David Sanchez

    Best way to add db table along with jbpm installation?

    David Sanchez Novice

      I kind of see how the Object classes at org/jbpm/graph/def map with the xml files at org/jbpm/graph/action. However I don't see what I need to do if I want to define my own class (hence database table) so that its picked up and run by the installation script.

      Help! Thanks as always.

      Also can you glance at my class and xml file to see if its obviously broken.

      Part_Info.java

      package org.jbpm.graph.def;
      
      import java.io.*;
      import java.util.*;
      
      import org.dom4j.*;
      import org.jbpm.command.ExecuteActionCommand;
      import org.jbpm.command.ExecuteNodeCommand;
      import org.jbpm.graph.exe.*;
      import org.jbpm.instantiation.*;
      import org.jbpm.jpdl.xml.*;
      import org.jbpm.msg.Message;
      import org.jbpm.msg.exe.MessageInstance;
      
      public class Part_Info implements Serializable {
      
       private static final long serialVersionUID = 1L;
      
       long id = 0;
      
       protected String part_name = "";
       protected String part_number = "";
       protected String rohs_status = "";
       protected String send_inquiry = "";
       protected String new_part_name = "";
       protected String new_part_number = "";
       protected String new_part_vendor = "";
       protected String ques_vendor_approval = "";
       protected String ques_test_result = "";
       protected String ques_notify_part_num_change = "";
      
       public Part_Info() {
       }
      
       public String toString() {
       String toString = null;
       toString = "part_name = " + part_name + " " +
       "part_number = " + part_number + " " +
       "rohs_status = " + rohs_status + " " +
       "send_inquiry = " + send_inquiry + " " +
       "new_part_name = " + new_part_name + " " +
       "new_part_number = " + new_part_number + " " +
       "new_part_vendor = " + new_part_vendor + " " +
       "ques_vendor_approval = " + ques_vendor_approval + " " +
       "ques_test_result = " + ques_test_result + " " +
       "ques_notify_part_num_change = " + ques_notify_part_num_change + " "
       ;
      
       return toString;
       }
      
       public void setPart_name(String part_name) {
       this.part_name = part_name;
       }
      
       public String getPart_number() {
       return part_number;
       }
      
       public void setPart_number(String part_number) {
       this.part_number = part_number;
       }
      
       public String getRohs_status() {
       return rohs_status;
       }
      
       public void setRohs_status(String rohs_status) {
       this.rohs_status = rohs_status;
       }
      
       public String getSend_inquiry() {
       return send_inquiry;
       }
      
       public void setSend_inquiry(String send_inquiry) {
       this.send_inquiry = send_inquiry;
       }
      
       public String getNew_part_name() {
       return new_part_name;
       }
      
       public void setNew_part_name(String new_part_name) {
       this.new_part_name = new_part_name;
       }
      
       public String getNew_part_number() {
       return new_part_number;
       }
      
       public void setNew_part_number(String new_part_number) {
       this.new_part_number = new_part_number;
       }
      
       public String getNew_part_vendor() {
       return new_part_number;
       }
      
       public void setNew_part_vendor(String new_part_vendor) {
       this.new_part_vendor = new_part_vendor;
       }
      
       public String getQues_vendor_approval() {
       return ques_vendor_approval;
       }
      
       public void setQues_vendor_approval(String ques_vendor_approval) {
       this.ques_vendor_approval = ques_vendor_approval;
       }
      
       public String getQues_test_result() {
       return ques_test_result;
       }
      
       public void setQues_test_result(String ques_test_result) {
       this.ques_test_result = ques_test_result;
       }
      
       public String getNotify_part_num_change() {
       return ques_notify_part_num_change;
       }
      
       public void setNotify_part_number_change(String ques_notify_part_num_change) {
       this.ques_notify_part_num_change = ques_notify_part_num_change;
       }
      }
      

      Part_Info.hbm.xml
      <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
      
      <hibernate-mapping default-access="field">
       <class name="org.jbpm.graph.def.Part_Info"
       table="JBPM_PART_INFO"
       discriminator-value="A">
       <cache usage="nonstrict-read-write"/>
       <id name="id" column="ID_"><generator class="native" /></id>
       <discriminator type="char" />
       <!-- A : org.jbpm.graph.def.Action -->
       <!-- S : org.jbpm.graph.action.Script -->
       <!-- C : org.jbpm.scheduler.def.CreateTimerAction -->
       <!-- I : org.jbpm.scheduler.def.CancelTimerAction -->
      
       <property name="part_name" column="PART_NAME_"/>
       <property name="part_number" column="PART_NUMBER_"/>
       <property name="rohs_status" column="ROHS_STATUS_"/>
       <property name="send_inquiry" column="SEND_INQUIRY_"/>
       <property name="new_part_name" column="NEW_PART_NAME_"/>
       <property name="new_part_number" column="NEW_PART_NUMBER_"/>
       <property name="new_part_vendor" column="NEW_PART_VENDOR_"/>
       <property name="ques_vendor_approval" column="QUES_VENDOR_APPROVAL_"/>
       <property name="ques_test_result" column="QUES_TEST_RESULT_"/>
       <property name="ques_notify_part_number_change" column="QUES_NOTIFY_PART_NUMBER_CHANGE_"/>
      
       </class>
      </hibernate-mapping>