Fixes bug 0006150. Changed data type in AD_PROCESS_RUN and scheduling logic.
authorAnthony Wolski <anthony.wolski@openbravo.com>
Mon, 24 Nov 2008 12:04:24 +0000
changeset 2077 1a0d02e15999
parent 2076 62ae1adc952c
child 2078 cf88ca44cdd2
Fixes bug 0006150. Changed data type in AD_PROCESS_RUN and scheduling logic.
src-db/database/model/tables/AD_PROCESS_RUN.xml
src-db/database/sourcedata/AD_ALERTRULE.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODULE.xml
src-db/database/sourcedata/AD_PREFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/scheduling/DefaultJob.java
src/org/openbravo/scheduling/ProcessBundle.java
src/org/openbravo/scheduling/ProcessMonitor.java
--- a/src-db/database/model/tables/AD_PROCESS_RUN.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/model/tables/AD_PROCESS_RUN.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -45,7 +45,7 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="LOG" primaryKey="false" required="false" type="VARCHAR" size="4000" autoIncrement="false">
+      <column name="LOG" primaryKey="false" required="false" type="VARCHAR" size="0" autoIncrement="false">
         <default/>
         <onCreateDefault/>
       </column>
@@ -65,5 +65,8 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_PROCESS_REQUEST" name="PROCESSREQUEST_PROCESSRUN_FK" onDelete="cascade">
+        <reference local="AD_PROCESS_REQUEST_ID" foreign="AD_PROCESS_REQUEST_ID"/>
+      </foreign-key>
     </table>
   </database>
--- a/src-db/database/sourcedata/AD_ALERTRULE.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_ALERTRULE.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -866,7 +866,7 @@
 <!--FDA0D6B303CD4F289A04FA41844C4B0C CREATEDBY-->
 <!--FDA0D6B303CD4F289A04FA41844C4B0C-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
 <!--FDA0D6B303CD4F289A04FA41844C4B0C UPDATED-->
-<!--FDA0D6B303CD4F289A04FA41844C4B0C-->              <UPDATED><![CDATA[2008-10-27 11:05:37.0]]></UPDATED>
+<!--FDA0D6B303CD4F289A04FA41844C4B0C-->              <UPDATED><![CDATA[2008-11-24 12:45:26.0]]></UPDATED>
 <!--FDA0D6B303CD4F289A04FA41844C4B0C UPDATEDBY-->
 <!--FDA0D6B303CD4F289A04FA41844C4B0C-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--FDA0D6B303CD4F289A04FA41844C4B0C NAME-->
@@ -887,7 +887,7 @@
 	now() AS updated,
 	0 AS updatedBy, 
         r.log AS note
-FROM 	ad_process_run r, ad_process_request pr
+FROM 	ad_process_run_v r, ad_process_request pr
 WHERE	r.status = 'Error' 
 AND     r.ad_process_request_id = pr.ad_process_request_id]]></SQL>
 <!--FDA0D6B303CD4F289A04FA41844C4B0C TYPE-->
--- a/src-db/database/sourcedata/AD_FIELD.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -410136,7 +410136,7 @@
 <!--573FEC1BC12C5E8EE040007F01017CC8 CREATEDBY-->
 <!--573FEC1BC12C5E8EE040007F01017CC8-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--573FEC1BC12C5E8EE040007F01017CC8 UPDATED-->
-<!--573FEC1BC12C5E8EE040007F01017CC8-->              <UPDATED><![CDATA[2008-11-18 11:26:33.0]]></UPDATED>
+<!--573FEC1BC12C5E8EE040007F01017CC8-->              <UPDATED><![CDATA[2008-11-19 13:41:08.0]]></UPDATED>
 <!--573FEC1BC12C5E8EE040007F01017CC8 UPDATEDBY-->
 <!--573FEC1BC12C5E8EE040007F01017CC8-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--573FEC1BC12C5E8EE040007F01017CC8 NAME-->
@@ -410154,7 +410154,7 @@
 <!--573FEC1BC12C5E8EE040007F01017CC8 ISDISPLAYED-->
 <!--573FEC1BC12C5E8EE040007F01017CC8-->              <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--573FEC1BC12C5E8EE040007F01017CC8 DISPLAYLOGIC-->
-<!--573FEC1BC12C5E8EE040007F01017CC8-->              <DISPLAYLOGIC><![CDATA[@Status@!'Scheduled' & @Status@!'Complete' & @Status@!'Unscheduled']]></DISPLAYLOGIC>
+<!--573FEC1BC12C5E8EE040007F01017CC8-->              <DISPLAYLOGIC><![CDATA[@Status@!'SCH' & @Status@!'COM' & @Status@!'UNS']]></DISPLAYLOGIC>
 <!--573FEC1BC12C5E8EE040007F01017CC8 DISPLAYLENGTH-->
 <!--573FEC1BC12C5E8EE040007F01017CC8-->              <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--573FEC1BC12C5E8EE040007F01017CC8 ISREADONLY-->
@@ -410189,7 +410189,7 @@
 <!--573FEC1BC12D5E8EE040007F01017CC8 CREATEDBY-->
 <!--573FEC1BC12D5E8EE040007F01017CC8-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--573FEC1BC12D5E8EE040007F01017CC8 UPDATED-->
-<!--573FEC1BC12D5E8EE040007F01017CC8-->              <UPDATED><![CDATA[2008-11-18 11:26:42.0]]></UPDATED>
+<!--573FEC1BC12D5E8EE040007F01017CC8-->              <UPDATED><![CDATA[2008-11-19 13:41:44.0]]></UPDATED>
 <!--573FEC1BC12D5E8EE040007F01017CC8 UPDATEDBY-->
 <!--573FEC1BC12D5E8EE040007F01017CC8-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--573FEC1BC12D5E8EE040007F01017CC8 NAME-->
@@ -410203,7 +410203,7 @@
 <!--573FEC1BC12D5E8EE040007F01017CC8 ISDISPLAYED-->
 <!--573FEC1BC12D5E8EE040007F01017CC8-->              <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--573FEC1BC12D5E8EE040007F01017CC8 DISPLAYLOGIC-->
-<!--573FEC1BC12D5E8EE040007F01017CC8-->              <DISPLAYLOGIC><![CDATA[@Status@='Scheduled']]></DISPLAYLOGIC>
+<!--573FEC1BC12D5E8EE040007F01017CC8-->              <DISPLAYLOGIC><![CDATA[@Status@='SCH']]></DISPLAYLOGIC>
 <!--573FEC1BC12D5E8EE040007F01017CC8 DISPLAYLENGTH-->
 <!--573FEC1BC12D5E8EE040007F01017CC8-->              <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--573FEC1BC12D5E8EE040007F01017CC8 ISREADONLY-->
@@ -410501,7 +410501,7 @@
 <!--57A2B365BDC69F57E040007F010171B4 CREATEDBY-->
 <!--57A2B365BDC69F57E040007F010171B4-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57A2B365BDC69F57E040007F010171B4 UPDATED-->
-<!--57A2B365BDC69F57E040007F010171B4-->              <UPDATED><![CDATA[2008-11-18 11:26:37.0]]></UPDATED>
+<!--57A2B365BDC69F57E040007F010171B4-->              <UPDATED><![CDATA[2008-11-19 13:41:30.0]]></UPDATED>
 <!--57A2B365BDC69F57E040007F010171B4 UPDATEDBY-->
 <!--57A2B365BDC69F57E040007F010171B4-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57A2B365BDC69F57E040007F010171B4 NAME-->
@@ -410515,7 +410515,7 @@
 <!--57A2B365BDC69F57E040007F010171B4 ISDISPLAYED-->
 <!--57A2B365BDC69F57E040007F010171B4-->              <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--57A2B365BDC69F57E040007F010171B4 DISPLAYLOGIC-->
-<!--57A2B365BDC69F57E040007F010171B4-->              <DISPLAYLOGIC><![CDATA[@Status@='Complete' | @Status@='Unscheduled']]></DISPLAYLOGIC>
+<!--57A2B365BDC69F57E040007F010171B4-->              <DISPLAYLOGIC><![CDATA[@Status@='COM' | @Status@='UNS']]></DISPLAYLOGIC>
 <!--57A2B365BDC69F57E040007F010171B4 DISPLAYLENGTH-->
 <!--57A2B365BDC69F57E040007F010171B4-->              <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--57A2B365BDC69F57E040007F010171B4 ISREADONLY-->
@@ -411727,7 +411727,7 @@
 <!--57B98D87941EA967E040007F01013153 CREATEDBY-->
 <!--57B98D87941EA967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D87941EA967E040007F01013153 UPDATED-->
-<!--57B98D87941EA967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D87941EA967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D87941EA967E040007F01013153 UPDATEDBY-->
 <!--57B98D87941EA967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D87941EA967E040007F01013153 NAME-->
@@ -411778,7 +411778,7 @@
 <!--57B98D87941FA967E040007F01013153 CREATEDBY-->
 <!--57B98D87941FA967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D87941FA967E040007F01013153 UPDATED-->
-<!--57B98D87941FA967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D87941FA967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D87941FA967E040007F01013153 UPDATEDBY-->
 <!--57B98D87941FA967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D87941FA967E040007F01013153 NAME-->
@@ -411829,7 +411829,7 @@
 <!--57B98D879420A967E040007F01013153 CREATEDBY-->
 <!--57B98D879420A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879420A967E040007F01013153 UPDATED-->
-<!--57B98D879420A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879420A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879420A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879420A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879420A967E040007F01013153 NAME-->
@@ -411857,7 +411857,7 @@
 <!--57B98D879420A967E040007F01013153 ISENCRYPTED-->
 <!--57B98D879420A967E040007F01013153-->              <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--57B98D879420A967E040007F01013153 SHOWINRELATION-->
-<!--57B98D879420A967E040007F01013153-->              <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--57B98D879420A967E040007F01013153-->              <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--57B98D879420A967E040007F01013153 ISFIRSTFOCUSEDFIELD-->
 <!--57B98D879420A967E040007F01013153-->              <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--57B98D879420A967E040007F01013153 AD_MODULE_ID-->
@@ -411878,7 +411878,7 @@
 <!--57B98D879421A967E040007F01013153 CREATEDBY-->
 <!--57B98D879421A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879421A967E040007F01013153 UPDATED-->
-<!--57B98D879421A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879421A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879421A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879421A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879421A967E040007F01013153 NAME-->
@@ -411927,7 +411927,7 @@
 <!--57B98D879423A967E040007F01013153 CREATEDBY-->
 <!--57B98D879423A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879423A967E040007F01013153 UPDATED-->
-<!--57B98D879423A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879423A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879423A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879423A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879423A967E040007F01013153 NAME-->
@@ -411978,7 +411978,7 @@
 <!--57B98D879424A967E040007F01013153 CREATEDBY-->
 <!--57B98D879424A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879424A967E040007F01013153 UPDATED-->
-<!--57B98D879424A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879424A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879424A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879424A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879424A967E040007F01013153 NAME-->
@@ -412029,7 +412029,7 @@
 <!--57B98D879425A967E040007F01013153 CREATEDBY-->
 <!--57B98D879425A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879425A967E040007F01013153 UPDATED-->
-<!--57B98D879425A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879425A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879425A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879425A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879425A967E040007F01013153 NAME-->
@@ -412082,7 +412082,7 @@
 <!--57B98D879426A967E040007F01013153 CREATEDBY-->
 <!--57B98D879426A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879426A967E040007F01013153 UPDATED-->
-<!--57B98D879426A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879426A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879426A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879426A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879426A967E040007F01013153 NAME-->
@@ -412133,7 +412133,7 @@
 <!--57B98D879428A967E040007F01013153 CREATEDBY-->
 <!--57B98D879428A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879428A967E040007F01013153 UPDATED-->
-<!--57B98D879428A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--57B98D879428A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879428A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879428A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879428A967E040007F01013153 NAME-->
@@ -412184,7 +412184,7 @@
 <!--57B98D879429A967E040007F01013153 CREATEDBY-->
 <!--57B98D879429A967E040007F01013153-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--57B98D879429A967E040007F01013153 UPDATED-->
-<!--57B98D879429A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-14 17:54:37.0]]></UPDATED>
+<!--57B98D879429A967E040007F01013153-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--57B98D879429A967E040007F01013153 UPDATEDBY-->
 <!--57B98D879429A967E040007F01013153-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--57B98D879429A967E040007F01013153 NAME-->
@@ -414473,7 +414473,7 @@
 <!--588907857EA2E0C2E040007F010120BD CREATEDBY-->
 <!--588907857EA2E0C2E040007F010120BD-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--588907857EA2E0C2E040007F010120BD UPDATED-->
-<!--588907857EA2E0C2E040007F010120BD-->              <UPDATED><![CDATA[2008-11-14 17:01:56.0]]></UPDATED>
+<!--588907857EA2E0C2E040007F010120BD-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--588907857EA2E0C2E040007F010120BD UPDATEDBY-->
 <!--588907857EA2E0C2E040007F010120BD-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--588907857EA2E0C2E040007F010120BD NAME-->
@@ -418625,7 +418625,7 @@
 <!--59FFF002FF943779E040007F01013B24 CREATEDBY-->
 <!--59FFF002FF943779E040007F01013B24-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--59FFF002FF943779E040007F01013B24 UPDATED-->
-<!--59FFF002FF943779E040007F01013B24-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--59FFF002FF943779E040007F01013B24-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--59FFF002FF943779E040007F01013B24 UPDATEDBY-->
 <!--59FFF002FF943779E040007F01013B24-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--59FFF002FF943779E040007F01013B24 NAME-->
@@ -418670,7 +418670,7 @@
 <!--59FFF002FF953779E040007F01013B24 CREATEDBY-->
 <!--59FFF002FF953779E040007F01013B24-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--59FFF002FF953779E040007F01013B24 UPDATED-->
-<!--59FFF002FF953779E040007F01013B24-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--59FFF002FF953779E040007F01013B24-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--59FFF002FF953779E040007F01013B24 UPDATEDBY-->
 <!--59FFF002FF953779E040007F01013B24-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--59FFF002FF953779E040007F01013B24 NAME-->
@@ -418919,7 +418919,7 @@
 <!--5BA7C07A878C0A98E040007F01017DB3 CREATEDBY-->
 <!--5BA7C07A878C0A98E040007F01017DB3-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--5BA7C07A878C0A98E040007F01017DB3 UPDATED-->
-<!--5BA7C07A878C0A98E040007F01017DB3-->              <UPDATED><![CDATA[2008-11-14 17:01:28.0]]></UPDATED>
+<!--5BA7C07A878C0A98E040007F01017DB3-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--5BA7C07A878C0A98E040007F01017DB3 UPDATEDBY-->
 <!--5BA7C07A878C0A98E040007F01017DB3-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--5BA7C07A878C0A98E040007F01017DB3 NAME-->
@@ -418970,7 +418970,7 @@
 <!--5BA7C07A878D0A98E040007F01017DB3 CREATEDBY-->
 <!--5BA7C07A878D0A98E040007F01017DB3-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--5BA7C07A878D0A98E040007F01017DB3 UPDATED-->
-<!--5BA7C07A878D0A98E040007F01017DB3-->              <UPDATED><![CDATA[2008-11-14 17:54:47.0]]></UPDATED>
+<!--5BA7C07A878D0A98E040007F01017DB3-->              <UPDATED><![CDATA[2008-11-24 11:36:56.0]]></UPDATED>
 <!--5BA7C07A878D0A98E040007F01017DB3 UPDATEDBY-->
 <!--5BA7C07A878D0A98E040007F01017DB3-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--5BA7C07A878D0A98E040007F01017DB3 NAME-->
@@ -419021,7 +419021,7 @@
 <!--5BA951974878BDB2E040007F01011671 CREATEDBY-->
 <!--5BA951974878BDB2E040007F01011671-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--5BA951974878BDB2E040007F01011671 UPDATED-->
-<!--5BA951974878BDB2E040007F01011671-->              <UPDATED><![CDATA[2008-11-18 17:21:42.0]]></UPDATED>
+<!--5BA951974878BDB2E040007F01011671-->              <UPDATED><![CDATA[2008-11-24 11:36:43.0]]></UPDATED>
 <!--5BA951974878BDB2E040007F01011671 UPDATEDBY-->
 <!--5BA951974878BDB2E040007F01011671-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--5BA951974878BDB2E040007F01011671 NAME-->
--- a/src-db/database/sourcedata/AD_MODULE.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -14,7 +14,7 @@
 <!--0 CREATEDBY-->
 <!--0-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--0 UPDATED-->
-<!--0-->              <UPDATED><![CDATA[2008-11-14 16:16:57.0]]></UPDATED>
+<!--0-->              <UPDATED><![CDATA[2008-11-24 10:26:58.0]]></UPDATED>
 <!--0 UPDATEDBY-->
 <!--0-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--0 NAME-->
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -300,50 +300,4 @@
 <!--1000100000-->              <VALUE><![CDATA[N]]></VALUE>
 <!--1000100000**************--></AD_PREFERENCE>
 
-<!--343ABBA439F74F9EAE2CAE54B1959101**************--><AD_PREFERENCE>
-<!--343ABBA439F74F9EAE2CAE54B1959101 AD_PREFERENCE_ID-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <AD_PREFERENCE_ID><![CDATA[343ABBA439F74F9EAE2CAE54B1959101]]></AD_PREFERENCE_ID>
-<!--343ABBA439F74F9EAE2CAE54B1959101 AD_CLIENT_ID-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--343ABBA439F74F9EAE2CAE54B1959101 AD_ORG_ID-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--343ABBA439F74F9EAE2CAE54B1959101 ISACTIVE-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--343ABBA439F74F9EAE2CAE54B1959101 CREATED-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <CREATED><![CDATA[2008-10-04 12:00:00.0]]></CREATED>
-<!--343ABBA439F74F9EAE2CAE54B1959101 CREATEDBY-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
-<!--343ABBA439F74F9EAE2CAE54B1959101 UPDATED-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <UPDATED><![CDATA[2008-10-04 12:00:00.0]]></UPDATED>
-<!--343ABBA439F74F9EAE2CAE54B1959101 UPDATEDBY-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
-<!--343ABBA439F74F9EAE2CAE54B1959101 ATTRIBUTE-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <ATTRIBUTE><![CDATA[ShowConfirmationDefault]]></ATTRIBUTE>
-<!--343ABBA439F74F9EAE2CAE54B1959101 VALUE-->
-<!--343ABBA439F74F9EAE2CAE54B1959101-->              <VALUE><![CDATA[N]]></VALUE>
-<!--343ABBA439F74F9EAE2CAE54B1959101**************--></AD_PREFERENCE>
-
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B**************--><AD_PREFERENCE>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B AD_PREFERENCE_ID-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <AD_PREFERENCE_ID><![CDATA[DE5F76C490CD4199AB2A621B5BA7DF8B]]></AD_PREFERENCE_ID>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B AD_CLIENT_ID-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B AD_ORG_ID-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B ISACTIVE-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B CREATED-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <CREATED><![CDATA[2008-11-07 11:18:46.0]]></CREATED>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B CREATEDBY-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B UPDATED-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <UPDATED><![CDATA[2008-11-07 11:45:37.0]]></UPDATED>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B UPDATEDBY-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B ATTRIBUTE-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <ATTRIBUTE><![CDATA[Autosave]]></ATTRIBUTE>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B VALUE-->
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B-->              <VALUE><![CDATA[Y]]></VALUE>
-<!--DE5F76C490CD4199AB2A621B5BA7DF8B**************--></AD_PREFERENCE>
-
 </data>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -18822,6 +18822,33 @@
 <!--238ABDA9172247D98DC8D2080CD26CAD-->              <AD_REFERENCE_ID><![CDATA[665CE68BB382425BB43057256767B5DE]]></AD_REFERENCE_ID>
 <!--238ABDA9172247D98DC8D2080CD26CAD**************--></AD_REF_LIST>
 
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D**************--><AD_REF_LIST>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D AD_REF_LIST_ID-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <AD_REF_LIST_ID><![CDATA[2480D7F5BF7C4D9E997C6D8C259BB48D]]></AD_REF_LIST_ID>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D AD_CLIENT_ID-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D AD_ORG_ID-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D ISACTIVE-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D CREATED-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <CREATED><![CDATA[2008-11-19 13:44:01.0]]></CREATED>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D CREATEDBY-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D UPDATED-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <UPDATED><![CDATA[2008-11-19 13:44:01.0]]></UPDATED>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D UPDATEDBY-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D VALUE-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <VALUE><![CDATA[UNS]]></VALUE>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D NAME-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <NAME><![CDATA[Unscheduled]]></NAME>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D DESCRIPTION-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <DESCRIPTION><![CDATA[The process has been unscheduled (status of Process Request).]]></DESCRIPTION>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D AD_REFERENCE_ID-->
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D-->              <AD_REFERENCE_ID><![CDATA[7DB6D4792CDC4ED297C70A4F4282A52E]]></AD_REFERENCE_ID>
+<!--2480D7F5BF7C4D9E997C6D8C259BB48D**************--></AD_REF_LIST>
+
 <!--297E89663206449C92A875D1060A0734**************--><AD_REF_LIST>
 <!--297E89663206449C92A875D1060A0734 AD_REF_LIST_ID-->
 <!--297E89663206449C92A875D1060A0734-->              <AD_REF_LIST_ID><![CDATA[297E89663206449C92A875D1060A0734]]></AD_REF_LIST_ID>
@@ -19753,6 +19780,33 @@
 <!--CE695204DC3D46D9825878014FDF6118-->              <AD_REFERENCE_ID><![CDATA[6C11958E975D4DF8A38E7F4A119A3077]]></AD_REFERENCE_ID>
 <!--CE695204DC3D46D9825878014FDF6118**************--></AD_REF_LIST>
 
+<!--CF529073015540A1B6A03678F8C3C010**************--><AD_REF_LIST>
+<!--CF529073015540A1B6A03678F8C3C010 AD_REF_LIST_ID-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <AD_REF_LIST_ID><![CDATA[CF529073015540A1B6A03678F8C3C010]]></AD_REF_LIST_ID>
+<!--CF529073015540A1B6A03678F8C3C010 AD_CLIENT_ID-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CF529073015540A1B6A03678F8C3C010 AD_ORG_ID-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CF529073015540A1B6A03678F8C3C010 ISACTIVE-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CF529073015540A1B6A03678F8C3C010 CREATED-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <CREATED><![CDATA[2008-11-19 13:43:12.0]]></CREATED>
+<!--CF529073015540A1B6A03678F8C3C010 CREATEDBY-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--CF529073015540A1B6A03678F8C3C010 UPDATED-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <UPDATED><![CDATA[2008-11-19 13:43:12.0]]></UPDATED>
+<!--CF529073015540A1B6A03678F8C3C010 UPDATEDBY-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--CF529073015540A1B6A03678F8C3C010 VALUE-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <VALUE><![CDATA[COM]]></VALUE>
+<!--CF529073015540A1B6A03678F8C3C010 NAME-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <NAME><![CDATA[Complete]]></NAME>
+<!--CF529073015540A1B6A03678F8C3C010 DESCRIPTION-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <DESCRIPTION><![CDATA[The process is complete (status of the request).]]></DESCRIPTION>
+<!--CF529073015540A1B6A03678F8C3C010 AD_REFERENCE_ID-->
+<!--CF529073015540A1B6A03678F8C3C010-->              <AD_REFERENCE_ID><![CDATA[7DB6D4792CDC4ED297C70A4F4282A52E]]></AD_REFERENCE_ID>
+<!--CF529073015540A1B6A03678F8C3C010**************--></AD_REF_LIST>
+
 <!--D5B1463700014A8EBAA47501A2203DC9**************--><AD_REF_LIST>
 <!--D5B1463700014A8EBAA47501A2203DC9 AD_REF_LIST_ID-->
 <!--D5B1463700014A8EBAA47501A2203DC9-->              <AD_REF_LIST_ID><![CDATA[D5B1463700014A8EBAA47501A2203DC9]]></AD_REF_LIST_ID>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -23371,7 +23371,7 @@
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 ISDEFAULTACCT-->
 <!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 SQL_RECORD_IDENTIFIER-->
-<!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <SQL_RECORD_IDENTIFIER><![CDATA[SELECT  AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, C_Year_V T WHERE AD_Org_ID=':c_ID']]></SQL_RECORD_IDENTIFIER>
+<!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <SQL_RECORD_IDENTIFIER><![CDATA[SELECT  AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, C_Year_V T WHERE C_Year_ID=':c_ID']]></SQL_RECORD_IDENTIFIER>
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 DEVELOPMENTSTATUS-->
 <!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 AD_PACKAGE_ID-->
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Nov 24 11:19:06 2008 +0000
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Nov 24 12:04:24 2008 +0000
@@ -58448,7 +58448,7 @@
 <!--5B801A78E8DA8F68E040007F010052FC FILENAME-->
 <!--5B801A78E8DA8F68E040007F010052FC-->              <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html]]></FILENAME>
 <!--5B801A78E8DA8F68E040007F010052FC ISUSED-->
-<!--5B801A78E8DA8F68E040007F010052FC-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--5B801A78E8DA8F68E040007F010052FC-->              <ISUSED><![CDATA[N]]></ISUSED>
 <!--5B801A78E8DA8F68E040007F010052FC AD_MODULE_ID-->
 <!--5B801A78E8DA8F68E040007F010052FC-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5B801A78E8DA8F68E040007F010052FC**************--></AD_TEXTINTERFACES>
--- a/src/org/openbravo/scheduling/DefaultJob.java	Mon Nov 24 11:19:06 2008 +0000
+++ b/src/org/openbravo/scheduling/DefaultJob.java	Mon Nov 24 12:04:24 2008 +0000
@@ -18,6 +18,8 @@
  */
 package org.openbravo.scheduling;
 
+import org.openbravo.base.ConfigParameters;
+import org.openbravo.database.ConnectionProvider;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
@@ -32,6 +34,9 @@
                 .get(ProcessBundle.KEY);
         try {
             final Process process = bundle.getProcessClass().newInstance();
+            bundle.setConnection((ConnectionProvider) jec.get(ProcessBundle.CONNECTION));
+            bundle.setConfig((ConfigParameters) jec.get(ProcessBundle.CONFIG_PARAMS));
+            bundle.setLog(new ProcessLogger(bundle.getConnection()));
             process.execute(bundle);
 
         } catch (final Exception e) {
--- a/src/org/openbravo/scheduling/ProcessBundle.java	Mon Nov 24 11:19:06 2008 +0000
+++ b/src/org/openbravo/scheduling/ProcessBundle.java	Mon Nov 24 12:04:24 2008 +0000
@@ -29,8 +29,6 @@
 import org.openbravo.erpCommon.ad_process.JasperProcess;
 import org.openbravo.erpCommon.ad_process.PinstanceProcedure;
 import org.openbravo.erpCommon.ad_process.ProcedureProcess;
-import org.openbravo.scheduling.PinstanceData;
-import org.openbravo.scheduling.ProcessRequestData;
 
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
@@ -45,6 +43,10 @@
   
   public static final String PINSTANCE = "process.param.pinstance";
   
+  public static final String CONNECTION = "process.param.connection";
+  
+  public static final String CONFIG_PARAMS = "process.param.configParams";
+  
   private String processId;
   
   private String impl;
@@ -106,7 +108,7 @@
    * @return
    */
   public String getParamsDefalated() {
-    XStream xstream = new XStream(new JettisonMappedXmlDriver());
+    final XStream xstream = new XStream(new JettisonMappedXmlDriver());
     return xstream.toXML(getParams());
   }
 
@@ -183,11 +185,11 @@
     if (processId == null) {
       throw new ServletException("Process Id cannot be null");
     }
-    ProcessData data = ProcessData.select(conn, processId);
+    final ProcessData data = ProcessData.select(conn, processId);
     if (data.isbackground != null && data.isbackground.equals("Y")) {
       try {
         setProcessClass(Class.forName(data.classname).asSubclass(Process.class));
-      } catch (ClassNotFoundException e) {
+      } catch (final ClassNotFoundException e) {
         e.printStackTrace();
         throw new ServletException(e.getMessage(), e);
       }
@@ -220,9 +222,9 @@
    */
   public static final ProcessBundle pinstance(String pinstanceId, 
       VariablesSecureApp vars, ConnectionProvider conn) throws ServletException {
-    String processId = PinstanceData.select(conn, pinstanceId).adProcessId;
+    final String processId = PinstanceData.select(conn, pinstanceId).adProcessId;
     
-    ProcessBundle bundle = new ProcessBundle(processId, vars).init(conn);
+    final ProcessBundle bundle = new ProcessBundle(processId, vars).init(conn);
     bundle.setProcessClass(PinstanceProcedure.class);
     bundle.getParams().put(PINSTANCE, pinstanceId);
     
@@ -238,17 +240,17 @@
    */
   public static final ProcessBundle request(String requestId, 
       VariablesSecureApp vars, ConnectionProvider conn) throws ServletException {
-    ProcessRequestData data = ProcessRequestData.select(conn, requestId);
+    final ProcessRequestData data = ProcessRequestData.select(conn, requestId);
     
-    String processId = data.processId;
-    ProcessBundle bundle = new ProcessBundle(processId, vars, Channel.SCHEDULED).init(conn);
+    final String processId = data.processId;
+    final ProcessBundle bundle = new ProcessBundle(processId, vars, Channel.SCHEDULED).init(conn);
     bundle.setContext(new ProcessContext(vars));
     
-    String paramString = data.params;
+    final String paramString = data.params;
     if (paramString == null || paramString.trim().equals("")) {
       bundle.setParams(new HashMap<String, Object>());
     } else {
-      XStream xstream = new XStream(new JettisonMappedXmlDriver());
+      final XStream xstream = new XStream(new JettisonMappedXmlDriver());
       bundle.setParams((HashMap<String, Object>) xstream.fromXML(paramString));
     }
     
@@ -261,22 +263,26 @@
    */
   public enum Channel {
     DIRECT {
-      public String toString() {
+      @Override
+    public String toString() {
         return "Direct";
       }
     },
     BACKGROUND {
-      public String toString() {
+      @Override
+    public String toString() {
         return "Background";
       }
     },
     SCHEDULED {
-      public String toString() {
+      @Override
+    public String toString() {
         return "Process Scheduler";
       }
     },
     WEBSERVICE {
-      public String toString() {
+      @Override
+    public String toString() {
         return "Webservice";
       }
     },
--- a/src/org/openbravo/scheduling/ProcessMonitor.java	Mon Nov 24 11:19:06 2008 +0000
+++ b/src/org/openbravo/scheduling/ProcessMonitor.java	Mon Nov 24 12:04:24 2008 +0000
@@ -15,7 +15,7 @@
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
-*/
+ */
 package org.openbravo.scheduling;
 
 import static org.openbravo.scheduling.Process.COMPLETE;
@@ -32,6 +32,7 @@
 
 import javax.servlet.ServletException;
 
+import org.apache.log4j.Logger;
 import org.openbravo.base.ConfigParameters;
 import org.openbravo.base.ConnectionProviderContextListener;
 import org.openbravo.database.ConnectionProvider;
@@ -47,218 +48,226 @@
 
 /**
  * @author awolski
- *
+ * 
  */
-public class ProcessMonitor implements SchedulerListener, JobListener, TriggerListener {
+public class ProcessMonitor implements SchedulerListener, JobListener,
+        TriggerListener {
 
-  public static final String KEY = "org.openbravo.scheduling.ProcessMonitor.KEY";
-  
-  private String name;
-  
-  private SchedulerContext context;
-  
-  public ProcessMonitor(String name, SchedulerContext context) {
-    this.name = name;
-    this.context = context;
-  }
-  
-  public void jobScheduled(Trigger trigger) {
-    final ProcessBundle bundle = (ProcessBundle) trigger.getJobDataMap().get(ProcessBundle.KEY);
-    final ProcessContext ctx = bundle.getContext();
-    try {
-      ProcessRequestData.update(getConnection(), ctx.getUser(), ctx.getUser(), 
-          SCHEDULED, bundle.getChannel().toString(), null, null, null,
-           ctx.toString(), trigger.getName());
+    static final Logger log = Logger.getLogger(ProcessMonitor.class);
     
-    } catch (final ServletException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
+    public static final String KEY = "org.openbravo.scheduling.ProcessMonitor.KEY";
+
+    private String name;
+
+    private SchedulerContext context;
+
+    public ProcessMonitor(String name, SchedulerContext context) {
+        this.name = name;
+        this.context = context;
     }
-  }
 
-  public void jobUnscheduled(String triggerName, String triggerGroup) {
-    try {
-      ProcessRequestData.update(getConnection(), UNSCHEDULED, null, null, triggerName);
-    
-    } catch (final ServletException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-  }
+    public void jobScheduled(Trigger trigger) {
+        final ProcessBundle bundle = (ProcessBundle) trigger.getJobDataMap()
+                .get(ProcessBundle.KEY);
+        final ProcessContext ctx = bundle.getContext();
+        try {
+            ProcessRequestData.update(getConnection(), ctx.getUser(), ctx
+                    .getUser(), SCHEDULED, bundle.getChannel().toString(),
+                    null, null, null, ctx.toString(), trigger.getName());
 
-  public void jobsPaused(String jobName, String jobGroup) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void jobsResumed(String jobName, String jobGroup) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void schedulerError(String msg, SchedulerException e) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void schedulerShutdown() {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void triggerFinalized(Trigger trigger) {
-    try {
-      ProcessRequestData.update(getConnection(), COMPLETE, trigger.getName());
-    
-    } catch (final ServletException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-  }
-
-  public void triggersPaused(String triggerName, String triggerGroup) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void triggersResumed(String triggerName, String triggerGroup) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void jobExecutionVetoed(JobExecutionContext jec) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void jobToBeExecuted(JobExecutionContext jec) {
-    final ProcessBundle bundle = (ProcessBundle) jec.getMergedJobDataMap().get(ProcessBundle.KEY);
-    if (bundle == null) {
-        return;
-    }
-    final ProcessContext ctx = bundle.getContext();
-    final String executionId = SequenceIdData.getUUID();
-    try {
-      ProcessRunData.insert(getConnection(), ctx.getOrganization(), ctx.getClient(), 
-          ctx.getUser(), ctx.getUser(), executionId, PROCESSING, format(jec.getFireTime()), 
-          null, null, jec.getJobDetail().getName());
-      
-          jec.put(EXECUTION_ID, executionId);
-          
-          bundle.setConnection(getConnection());
-          bundle.setConfig(getConfigParameters());
-    
-    } catch (final ServletException e){
-      // TODO Auto-generated method stub
-      e.printStackTrace();
-    }
-  }
-
-  public void jobWasExecuted(JobExecutionContext jec, JobExecutionException jee) {
-    final ProcessBundle bundle = (ProcessBundle) jec.getMergedJobDataMap().get(ProcessBundle.KEY);
-    if (bundle == null) {
-        return;
-    }
-    final ProcessContext ctx = bundle.getContext();
-    try {
-      final String executionId = (String) jec.get(EXECUTION_ID);
-      if (jee == null) {
-        ProcessRunData.update(getConnection(), ctx.getUser(), SUCCESS, format(new Date()),
-            getDuration(jec.getJobRunTime()), bundle.getLog().toString(), executionId);
-      } else {
-        ProcessRunData.update(getConnection(), ctx.getUser(), ERROR, format(new Date()),
-            getDuration(jec.getJobRunTime()), bundle.getLog().toString(), executionId);
-      }
-    
-    } catch (final ServletException e) {
-      // TODO Auto-generated method stub
-      e.printStackTrace();
-    }
-  }
-
-  public void triggerComplete(Trigger trigger, JobExecutionContext jec, 
-      int triggerInstructionCode) {
-    // TODO Auto-generated method stub
-    
-  }
-
-  public void triggerFired(Trigger trigger, JobExecutionContext jec) {
-    final ProcessBundle bundle = (ProcessBundle) jec.getMergedJobDataMap().get(ProcessBundle.KEY);
-    final ProcessContext ctx = bundle.getContext();
-    try {
-      ProcessRequestData.update(getConnection(), ctx.getUser(), ctx.getUser(), 
-          SCHEDULED, bundle.getChannel().toString(), 
-          format(trigger.getPreviousFireTime()), format(trigger.getNextFireTime()), 
-          format(trigger.getFinalFireTime()), ctx.toString(), trigger.getName());
-    
-    } catch (final ServletException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-  }
-
-  public void triggerMisfired(Trigger trigger) {
-    try {
-      ProcessRequestData.update(getConnection(), MISFIRED, trigger.getName());
-    
-    } catch (final ServletException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
     }
     
-  }
+    public void triggerFired(Trigger trigger, JobExecutionContext jec) {
+        final ProcessBundle bundle = (ProcessBundle) jec.getMergedJobDataMap()
+                .get(ProcessBundle.KEY);
+        final ProcessContext ctx = bundle.getContext();
+        try {
+            ProcessRequestData.update(getConnection(), ctx.getUser(), ctx
+                    .getUser(), SCHEDULED, bundle.getChannel().toString(),
+                    format(trigger.getPreviousFireTime()), format(trigger
+                            .getNextFireTime()), format(trigger
+                            .getFinalFireTime()), ctx.toString(), trigger
+                            .getName());
 
-  public boolean vetoJobExecution(Trigger trigger, JobExecutionContext jec) {
-    // TODO Auto-generated method stub
-    return false;
-  }
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
 
-  /**
-   * @return
-   */
-  public ConnectionProvider getConnection() {
-    return (ConnectionProvider) context.get(ConnectionProviderContextListener.POOL_ATTRIBUTE);
-  }
-  
-  /**
-   * @return
-   */
-  public ConfigParameters getConfigParameters() {
-    return (ConfigParameters) context.get(ConfigParameters.CONFIG_ATTRIBUTE);
-  }
-  
-  /**
-   * @param date
-   * @return
-   */
-  public final String format(Date date) {
-    final String dateTimeFormat = getConfigParameters().getJavaDateTimeFormat();
-    return date == null ? null : new SimpleDateFormat(dateTimeFormat).format(date);
-  }
-  
-  /**
-   * @param duration
-   * @return
-   */
-  public static String getDuration(long duration) {
+    public void jobToBeExecuted(JobExecutionContext jec) {
+        final ProcessBundle bundle = (ProcessBundle) jec.getMergedJobDataMap()
+                .get(ProcessBundle.KEY);
+        if (bundle == null) {
+            return;
+        }
+        final ProcessContext ctx = bundle.getContext();
+        final String executionId = SequenceIdData.getUUID();
+        try {
+            ProcessRunData.insert(getConnection(), ctx.getOrganization(), ctx
+                    .getClient(), ctx.getUser(), ctx.getUser(), executionId,
+                    PROCESSING, format(jec.getFireTime()), null, null, jec
+                            .getJobDetail().getName());
+
+            jec.put(EXECUTION_ID, executionId);
+            jec.put(ProcessBundle.CONNECTION, getConnection());
+            jec.put(ProcessBundle.CONFIG_PARAMS, getConfigParameters());
+
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    public void jobWasExecuted(JobExecutionContext jec,
+            JobExecutionException jee) {
+        final ProcessBundle bundle = (ProcessBundle) jec.getMergedJobDataMap()
+                .get(ProcessBundle.KEY);
+        if (bundle == null) {
+            return;
+        }
+        final ProcessContext ctx = bundle.getContext();
+        try {
+            final String executionId = (String) jec.get(EXECUTION_ID);
+            if (jee == null) {
+                ProcessRunData.update(getConnection(), ctx.getUser(), SUCCESS,
+                        format(new Date()), getDuration(jec.getJobRunTime()),
+                        bundle.getLog().toString(), executionId);
+            } else {
+                ProcessRunData.update(getConnection(), ctx.getUser(), ERROR,
+                        format(new Date()), getDuration(jec.getJobRunTime()),
+                        bundle.getLog().toString(), executionId);
+            }
+
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
     
-    final int milliseconds = (int) (duration % 1000);
-    final int seconds = (int) ((duration / 1000) % 60);
-    final int minutes = (int) ((duration / 60000) % 60);
-    final int hours = (int) ((duration / 3600000) % 24);
+    public void triggerFinalized(Trigger trigger) {
+        try {
+            ProcessRequestData.update(getConnection(), COMPLETE, trigger
+                    .getName());
+
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    public void jobUnscheduled(String triggerName, String triggerGroup) {
+        try {
+            ProcessRequestData.update(getConnection(), UNSCHEDULED, null, null,
+                    triggerName);
+
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
     
-    final String m = (milliseconds < 10 ? "00" : (milliseconds<100 ? "0" : "")) + milliseconds;
-    final String sec = (seconds < 10 ? "0" : "") + seconds;
-    final String min = (minutes < 10 ? "0" : "") + minutes;
-    final String hr = (hours < 10 ? "0" : "") + hours;
+    public void triggerMisfired(Trigger trigger) {
+        try {
+            ProcessRequestData.update(getConnection(), MISFIRED, trigger
+                    .getName());
 
-    return hr + ":" + min + ":" + sec + "." + m;
-  }
+        } catch (final ServletException e) {
+            log.error(e.getMessage(), e);
+        }
 
-  /* (non-Javadoc)
-   * @see org.quartz.JobListener#getName()
-   */
-  public String getName() {
-    return name;
-  }
+    }
+
+    public void jobsPaused(String jobName, String jobGroup) {
+        // Not implemented
+    }
+
+    public void jobsResumed(String jobName, String jobGroup) {
+        // Not implemented
+    }
+
+    public void schedulerError(String msg, SchedulerException e) {
+        // Not implemented
+    }
+
+    public void schedulerShutdown() {
+        // Not implemented
+    }
+
+    public void triggersPaused(String triggerName, String triggerGroup) {
+        // Not implemented
+    }
+
+    public void triggersResumed(String triggerName, String triggerGroup) {
+        // Not implemented
+    }
+
+    public void jobExecutionVetoed(JobExecutionContext jec) {
+        // Not implemented
+    }
+
+    public void triggerComplete(Trigger trigger, JobExecutionContext jec,
+            int triggerInstructionCode) {
+        // Not implemented
+    }
+
+    public boolean vetoJobExecution(Trigger trigger, JobExecutionContext jec) {
+        // Not implemented
+        return false;
+    }
+
+    /**
+     * @return
+     */
+    public ConnectionProvider getConnection() {
+        return (ConnectionProvider) context
+                .get(ConnectionProviderContextListener.POOL_ATTRIBUTE);
+    }
+
+    /**
+     * @return
+     */
+    public ConfigParameters getConfigParameters() {
+        return (ConfigParameters) context
+                .get(ConfigParameters.CONFIG_ATTRIBUTE);
+    }
+
+    /**
+     * @param date
+     * @return
+     */
+    public final String format(Date date) {
+        final String dateTimeFormat = getConfigParameters()
+                .getJavaDateTimeFormat();
+        return date == null ? null : new SimpleDateFormat(dateTimeFormat)
+                .format(date);
+    }
+
+    /**
+     * @param duration
+     * @return
+     */
+    public static String getDuration(long duration) {
+
+        final int milliseconds = (int) (duration % 1000);
+        final int seconds = (int) ((duration / 1000) % 60);
+        final int minutes = (int) ((duration / 60000) % 60);
+        final int hours = (int) ((duration / 3600000) % 24);
+
+        final String m = (milliseconds < 10 ? "00" : (milliseconds < 100 ? "0"
+                : ""))
+                + milliseconds;
+        final String sec = (seconds < 10 ? "0" : "") + seconds;
+        final String min = (minutes < 10 ? "0" : "") + minutes;
+        final String hr = (hours < 10 ? "0" : "") + hours;
+
+        return hr + ":" + min + ":" + sec + "." + m;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.quartz.JobListener#getName()
+     */
+    public String getName() {
+        return name;
+    }
 }