Related to issue 29766: Retail Operations Buffer: store all transactions in operations table before processing
authorMartin Taal <martin.taal@openbravo.com>
Tue, 02 Jun 2015 12:46:43 +0200
changeset 26853 0e4febf32416
parent 26852 997f501a4674
child 26854 29517c0c206d
child 26855 4e1811fb5889
Related to issue 29766: Retail Operations Buffer: store all transactions in operations table before processing
- Don't queue complete entry but only needed id's to recreate obcontext and reload entry
- Only load maxBatchSize per type of data, handling each type of data separately makes them less influence eachother, the order of the type of data is based on sequence of list reference, order makes business sense also
- Added process to reprocess entries which are in error
- added several configuration parameters which allow controlling number of threads, queue size and task queue size from properties, sensible defaults have been set, also prevention mechanism for 'crazy' values has been implemented
- centralized the threadpool, so all processors share the same queue together with the main thread
- the main thread now uses a scroll method, importentries are removed from the session right after assigning to the processor to decrease memory foot print
- the main thread now processes entries by type of data, in order of the sequence number of the type of data, this gives better predictable results and also gives a better change that different types of data don't block eachother
- replaced the stored column with the created column, to make table smaller, revisited the index
- added role to the import entry table, so that it is stored with the entry, as it is needed to rebuild the obcontext when processing the entry, as the role of the user can have changed or the default role is not suited for the entry to be handled.
- made field length of json and errorinfo columns to 10 million, added testcase to proof that 10million characters can be saved in the json/errorinfo columns
- let the ImportEntryManager thread start when mobile core starts in the application, using a context listener
- when adding a new import entry check both in the import entry as well as in the import entry archive table if it was already passed in
- don't wait anymore after waking up from the managerWaitTime
- when saving import entry as error, make sure that the obcontext is only temporarily replaced with the admin context, restore the previous context
- set the thread name in the threadfactory
src-db/database/model/tables/C_IMPORT_ENTRY.xml
src-db/database/model/tables/C_IMPORT_ENTRY_ARCHIVE.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_PROCESS.xml
src-db/database/sourcedata/AD_TAB.xml
src-test/src/org/openbravo/test/AllAntTaskTests.java
src-test/src/org/openbravo/test/AllQuickAntTaskTests.java
src-test/src/org/openbravo/test/AntTaskTests.java
src-test/src/org/openbravo/test/system/ImportEntrySizeTest.java
src/org/openbravo/service/importprocess/ImportEntryArchiveManager.java
src/org/openbravo/service/importprocess/ImportEntryManager.java
src/org/openbravo/service/importprocess/ImportEntryProcessor.java
src/org/openbravo/service/importprocess/ImportProcessUtils.java
src/org/openbravo/service/importprocess/ImportReprocessErrorEntries.java
src/org/openbravo/service/importprocess/ProcessImportEntriesProcessActionHandler.java
--- a/src-db/database/model/tables/C_IMPORT_ENTRY.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/model/tables/C_IMPORT_ENTRY.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -33,10 +33,6 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="STORED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
-        <default><![CDATA[SYSDATE]]></default>
-        <onCreateDefault/>
-      </column>
       <column name="IMPORTED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
         <default><![CDATA[SYSDATE]]></default>
         <onCreateDefault/>
@@ -57,6 +53,13 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="AD_ROLE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="AD_ROLE" name="C_IMPORT_ENTRY_AD_ROLE">
+        <reference local="AD_ROLE_ID" foreign="AD_ROLE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="C_IMPORT_ENTRY_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -65,9 +68,7 @@
       </foreign-key>
       <index name="C_IMPORT_ENTRY_IDX" unique="false">
         <index-column name="IMPORTSTATUS"/>
-        <index-column name="STORED"/>
-        <index-column name="TYPEOFDATA"/>
-        <index-column name="AD_ORG_ID"/>
+        <index-column name="CREATED"/>
       </index>
     </table>
   </database>
--- a/src-db/database/model/tables/C_IMPORT_ENTRY_ARCHIVE.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/model/tables/C_IMPORT_ENTRY_ARCHIVE.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -33,10 +33,6 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="STORED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
-        <default><![CDATA[SYSDATE]]></default>
-        <onCreateDefault/>
-      </column>
       <column name="IMPORTED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
         <default><![CDATA[SYSDATE]]></default>
         <onCreateDefault/>
@@ -57,6 +53,13 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="AD_ROLE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="AD_ROLE" name="C_IMPORT_EA_AD_ROLE">
+        <reference local="AD_ROLE_ID" foreign="AD_ROLE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="C_IMPORT_EA_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -224267,6 +224267,41 @@
 <!--02EB43A0A82D41B88ECE38232D0E9636-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--02EB43A0A82D41B88ECE38232D0E9636--></AD_COLUMN>
 
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3--><AD_COLUMN>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_COLUMN_ID><![CDATA[02EDB5224DE54FBBA4DD9AA1C02CC5D3]]></AD_COLUMN_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <NAME><![CDATA[Role]]></NAME>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <DESCRIPTION><![CDATA[The profile of security for the user defining what windows and tabs they can see.]]></DESCRIPTION>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <HELP><![CDATA[The Role determines security and access a user who has this Role will have in the System.]]></HELP>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <COLUMNNAME><![CDATA[AD_Role_ID]]></COLUMNNAME>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_TABLE_ID><![CDATA[C2968EF014C146B99A0C136BA9D6331F]]></AD_TABLE_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <SEQNO><![CDATA[160]]></SEQNO>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_ELEMENT_ID><![CDATA[123]]></AD_ELEMENT_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <POSITION><![CDATA[16]]></POSITION>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--02EDB5224DE54FBBA4DD9AA1C02CC5D3--></AD_COLUMN>
+
 <!--02F5245E7C6B4829AD55F3760808027F--><AD_COLUMN>
 <!--02F5245E7C6B4829AD55F3760808027F-->  <AD_COLUMN_ID><![CDATA[02F5245E7C6B4829AD55F3760808027F]]></AD_COLUMN_ID>
 <!--02F5245E7C6B4829AD55F3760808027F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -236871,7 +236906,7 @@
 <!--393102FB4B954F58A9D8223E19453EC6-->  <COLUMNNAME><![CDATA[Jsoninfo]]></COLUMNNAME>
 <!--393102FB4B954F58A9D8223E19453EC6-->  <AD_TABLE_ID><![CDATA[1B19E761F8E24E00B5FBF2C22082A006]]></AD_TABLE_ID>
 <!--393102FB4B954F58A9D8223E19453EC6-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
-<!--393102FB4B954F58A9D8223E19453EC6-->  <FIELDLENGTH><![CDATA[1000000]]></FIELDLENGTH>
+<!--393102FB4B954F58A9D8223E19453EC6-->  <FIELDLENGTH><![CDATA[10000000]]></FIELDLENGTH>
 <!--393102FB4B954F58A9D8223E19453EC6-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--393102FB4B954F58A9D8223E19453EC6-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--393102FB4B954F58A9D8223E19453EC6-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
@@ -302350,7 +302385,7 @@
 <!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <COLUMNNAME><![CDATA[Jsoninfo]]></COLUMNNAME>
 <!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <AD_TABLE_ID><![CDATA[C2968EF014C146B99A0C136BA9D6331F]]></AD_TABLE_ID>
 <!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
-<!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <FIELDLENGTH><![CDATA[1000000]]></FIELDLENGTH>
+<!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <FIELDLENGTH><![CDATA[10000000]]></FIELDLENGTH>
 <!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--9FD5B3AAA35C42B39EC38CA5BDE5BF1F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
@@ -303891,40 +303926,6 @@
 <!--A437240FB0894CFFAA0C96A925D69141-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--A437240FB0894CFFAA0C96A925D69141--></AD_COLUMN>
 
-<!--A442A53BD7A54C618FB7FCA289FA114D--><AD_COLUMN>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_COLUMN_ID><![CDATA[A442A53BD7A54C618FB7FCA289FA114D]]></AD_COLUMN_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <NAME><![CDATA[Stored]]></NAME>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <COLUMNNAME><![CDATA[Stored]]></COLUMNNAME>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_TABLE_ID><![CDATA[1B19E761F8E24E00B5FBF2C22082A006]]></AD_TABLE_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <DEFAULTVALUE><![CDATA[@#Date@]]></DEFAULTVALUE>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISKEY><![CDATA[N]]></ISKEY>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISPARENT><![CDATA[N]]></ISPARENT>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <SEQNO><![CDATA[90]]></SEQNO>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_ELEMENT_ID><![CDATA[0F7DEEB13D924F28BFBA3AD34079C231]]></AD_ELEMENT_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <POSITION><![CDATA[9]]></POSITION>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
-<!--A442A53BD7A54C618FB7FCA289FA114D-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
-<!--A442A53BD7A54C618FB7FCA289FA114D--></AD_COLUMN>
-
 <!--A474A30DFC524BDFA5D17CE7F4D317A1--><AD_COLUMN>
 <!--A474A30DFC524BDFA5D17CE7F4D317A1-->  <AD_COLUMN_ID><![CDATA[A474A30DFC524BDFA5D17CE7F4D317A1]]></AD_COLUMN_ID>
 <!--A474A30DFC524BDFA5D17CE7F4D317A1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -304464,40 +304465,6 @@
 <!--A61D7183726147BA82B75A3339BC6D21-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--A61D7183726147BA82B75A3339BC6D21--></AD_COLUMN>
 
-<!--A655AE8B366D4FE1A52BA9F10510457F--><AD_COLUMN>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_COLUMN_ID><![CDATA[A655AE8B366D4FE1A52BA9F10510457F]]></AD_COLUMN_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <NAME><![CDATA[Stored]]></NAME>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <COLUMNNAME><![CDATA[Stored]]></COLUMNNAME>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_TABLE_ID><![CDATA[C2968EF014C146B99A0C136BA9D6331F]]></AD_TABLE_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <DEFAULTVALUE><![CDATA[@#Date@]]></DEFAULTVALUE>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISKEY><![CDATA[N]]></ISKEY>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISPARENT><![CDATA[N]]></ISPARENT>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <SEQNO><![CDATA[90]]></SEQNO>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_ELEMENT_ID><![CDATA[0F7DEEB13D924F28BFBA3AD34079C231]]></AD_ELEMENT_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <POSITION><![CDATA[9]]></POSITION>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
-<!--A655AE8B366D4FE1A52BA9F10510457F-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
-<!--A655AE8B366D4FE1A52BA9F10510457F--></AD_COLUMN>
-
 <!--A6730B8F9A5F4EADA0976C1FF09CF66F--><AD_COLUMN>
 <!--A6730B8F9A5F4EADA0976C1FF09CF66F-->  <AD_COLUMN_ID><![CDATA[A6730B8F9A5F4EADA0976C1FF09CF66F]]></AD_COLUMN_ID>
 <!--A6730B8F9A5F4EADA0976C1FF09CF66F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -325887,6 +325854,41 @@
 <!--D4F7FC47E23A499CA0445FFD58BC5A81-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--D4F7FC47E23A499CA0445FFD58BC5A81--></AD_COLUMN>
 
+<!--D51CD55DE2D441ED99283A396909336F--><AD_COLUMN>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_COLUMN_ID><![CDATA[D51CD55DE2D441ED99283A396909336F]]></AD_COLUMN_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D51CD55DE2D441ED99283A396909336F-->  <NAME><![CDATA[Role]]></NAME>
+<!--D51CD55DE2D441ED99283A396909336F-->  <DESCRIPTION><![CDATA[The profile of security for the user defining what windows and tabs they can see.]]></DESCRIPTION>
+<!--D51CD55DE2D441ED99283A396909336F-->  <HELP><![CDATA[The Role determines security and access a user who has this Role will have in the System.]]></HELP>
+<!--D51CD55DE2D441ED99283A396909336F-->  <COLUMNNAME><![CDATA[AD_Role_ID]]></COLUMNNAME>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_TABLE_ID><![CDATA[1B19E761F8E24E00B5FBF2C22082A006]]></AD_TABLE_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--D51CD55DE2D441ED99283A396909336F-->  <SEQNO><![CDATA[170]]></SEQNO>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_ELEMENT_ID><![CDATA[123]]></AD_ELEMENT_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--D51CD55DE2D441ED99283A396909336F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--D51CD55DE2D441ED99283A396909336F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D51CD55DE2D441ED99283A396909336F-->  <POSITION><![CDATA[16]]></POSITION>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--D51CD55DE2D441ED99283A396909336F-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--D51CD55DE2D441ED99283A396909336F-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--D51CD55DE2D441ED99283A396909336F-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--D51CD55DE2D441ED99283A396909336F--></AD_COLUMN>
+
 <!--D5B00732731F427381C26651F24F2B66--><AD_COLUMN>
 <!--D5B00732731F427381C26651F24F2B66-->  <AD_COLUMN_ID><![CDATA[D5B00732731F427381C26651F24F2B66]]></AD_COLUMN_ID>
 <!--D5B00732731F427381C26651F24F2B66-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -329519,7 +329521,7 @@
 <!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <COLUMNNAME><![CDATA[Errorinfo]]></COLUMNNAME>
 <!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <AD_TABLE_ID><![CDATA[C2968EF014C146B99A0C136BA9D6331F]]></AD_TABLE_ID>
 <!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
-<!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <FIELDLENGTH><![CDATA[1000000]]></FIELDLENGTH>
+<!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <FIELDLENGTH><![CDATA[10000000]]></FIELDLENGTH>
 <!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--D9A9BEACE89C41AE8035A4F7D892E5CC-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
@@ -331068,7 +331070,7 @@
 <!--DD072B18A9034797933D9A21E46A2D62-->  <COLUMNNAME><![CDATA[Errorinfo]]></COLUMNNAME>
 <!--DD072B18A9034797933D9A21E46A2D62-->  <AD_TABLE_ID><![CDATA[1B19E761F8E24E00B5FBF2C22082A006]]></AD_TABLE_ID>
 <!--DD072B18A9034797933D9A21E46A2D62-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
-<!--DD072B18A9034797933D9A21E46A2D62-->  <FIELDLENGTH><![CDATA[1000000]]></FIELDLENGTH>
+<!--DD072B18A9034797933D9A21E46A2D62-->  <FIELDLENGTH><![CDATA[10000000]]></FIELDLENGTH>
 <!--DD072B18A9034797933D9A21E46A2D62-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--DD072B18A9034797933D9A21E46A2D62-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--DD072B18A9034797933D9A21E46A2D62-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -21334,18 +21334,6 @@
 <!--0F34BE626A044A1BA104160398FBF53A-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--0F34BE626A044A1BA104160398FBF53A--></AD_ELEMENT>
 
-<!--0F7DEEB13D924F28BFBA3AD34079C231--><AD_ELEMENT>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <AD_ELEMENT_ID><![CDATA[0F7DEEB13D924F28BFBA3AD34079C231]]></AD_ELEMENT_ID>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <COLUMNNAME><![CDATA[Stored]]></COLUMNNAME>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <NAME><![CDATA[Stored]]></NAME>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <PRINTNAME><![CDATA[Stored]]></PRINTNAME>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--0F7DEEB13D924F28BFBA3AD34079C231-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
-<!--0F7DEEB13D924F28BFBA3AD34079C231--></AD_ELEMENT>
-
 <!--0FF8F04EC4204CA3AC8F003F38C0502A--><AD_ELEMENT>
 <!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <AD_ELEMENT_ID><![CDATA[0FF8F04EC4204CA3AC8F003F38C0502A]]></AD_ELEMENT_ID>
 <!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -190077,7 +190077,7 @@
 <!--20EF8A3435D240F4A347BDF73FE24F53-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--20EF8A3435D240F4A347BDF73FE24F53-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
 <!--20EF8A3435D240F4A347BDF73FE24F53-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--20EF8A3435D240F4A347BDF73FE24F53-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--20EF8A3435D240F4A347BDF73FE24F53-->  <SEQNO><![CDATA[60]]></SEQNO>
 <!--20EF8A3435D240F4A347BDF73FE24F53-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--20EF8A3435D240F4A347BDF73FE24F53-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--20EF8A3435D240F4A347BDF73FE24F53-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -212491,7 +212491,7 @@
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <DISPLAYLENGTH><![CDATA[1000000]]></DISPLAYLENGTH>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--56D76EBD13CB41BEBC870277FE864DC8-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--56D76EBD13CB41BEBC870277FE864DC8-->  <SEQNO><![CDATA[70]]></SEQNO>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -212503,7 +212503,7 @@
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <EM_OBUIAPP_COLSPAN><![CDATA[2]]></EM_OBUIAPP_COLSPAN>
-<!--56D76EBD13CB41BEBC870277FE864DC8-->  <EM_OBUIAPP_ROWSPAN><![CDATA[2]]></EM_OBUIAPP_ROWSPAN>
+<!--56D76EBD13CB41BEBC870277FE864DC8-->  <EM_OBUIAPP_ROWSPAN><![CDATA[4]]></EM_OBUIAPP_ROWSPAN>
 <!--56D76EBD13CB41BEBC870277FE864DC8-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--56D76EBD13CB41BEBC870277FE864DC8--></AD_FIELD>
 
@@ -219131,7 +219131,7 @@
 <!--5A1DA518A757487F9DE177777CDD937B-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--5A1DA518A757487F9DE177777CDD937B-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--5A1DA518A757487F9DE177777CDD937B-->  <EM_OBUIAPP_COLSPAN><![CDATA[2]]></EM_OBUIAPP_COLSPAN>
-<!--5A1DA518A757487F9DE177777CDD937B-->  <EM_OBUIAPP_ROWSPAN><![CDATA[2]]></EM_OBUIAPP_ROWSPAN>
+<!--5A1DA518A757487F9DE177777CDD937B-->  <EM_OBUIAPP_ROWSPAN><![CDATA[4]]></EM_OBUIAPP_ROWSPAN>
 <!--5A1DA518A757487F9DE177777CDD937B-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--5A1DA518A757487F9DE177777CDD937B--></AD_FIELD>
 
@@ -225397,7 +225397,7 @@
 <!--64C5ADAB2D624FC8B57285D62C8B2722-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--64C5ADAB2D624FC8B57285D62C8B2722-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--64C5ADAB2D624FC8B57285D62C8B2722-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--64C5ADAB2D624FC8B57285D62C8B2722-->  <GRID_SEQNO><![CDATA[50]]></GRID_SEQNO>
+<!--64C5ADAB2D624FC8B57285D62C8B2722-->  <GRID_SEQNO><![CDATA[75]]></GRID_SEQNO>
 <!--64C5ADAB2D624FC8B57285D62C8B2722-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--64C5ADAB2D624FC8B57285D62C8B2722-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--64C5ADAB2D624FC8B57285D62C8B2722-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
@@ -238497,6 +238497,35 @@
 <!--7EDE8C56308A4941873AA44A0CC87317-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--7EDE8C56308A4941873AA44A0CC87317--></AD_FIELD>
 
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1--><AD_FIELD>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <AD_FIELD_ID><![CDATA[7EF5F3926EF245EC8B9A70FCDD100BC1]]></AD_FIELD_ID>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <NAME><![CDATA[Creation Date]]></NAME>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <DESCRIPTION><![CDATA[The date that this record is completed.]]></DESCRIPTION>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <HELP><![CDATA[The Created field indicates the date that this record was created.]]></HELP>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <AD_TAB_ID><![CDATA[A55C6E2F874F4CD0B7AEDE4362701EA2]]></AD_TAB_ID>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <AD_COLUMN_ID><![CDATA[E2C69E0F8EC34C6788EC0ED377C8C2CC]]></AD_COLUMN_ID>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <GRID_SEQNO><![CDATA[30]]></GRID_SEQNO>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--7EF5F3926EF245EC8B9A70FCDD100BC1--></AD_FIELD>
+
 <!--7F1FA06CE26E4FE4A376744C330A98FC--><AD_FIELD>
 <!--7F1FA06CE26E4FE4A376744C330A98FC-->  <AD_FIELD_ID><![CDATA[7F1FA06CE26E4FE4A376744C330A98FC]]></AD_FIELD_ID>
 <!--7F1FA06CE26E4FE4A376744C330A98FC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -247165,33 +247194,6 @@
 <!--8A15A9AFEE7E4E0199B0E91292049B44-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--8A15A9AFEE7E4E0199B0E91292049B44--></AD_FIELD>
 
-<!--8A2832092DBF47BAACB2D24CD2CC2F38--><AD_FIELD>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <AD_FIELD_ID><![CDATA[8A2832092DBF47BAACB2D24CD2CC2F38]]></AD_FIELD_ID>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <NAME><![CDATA[Stored]]></NAME>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <AD_TAB_ID><![CDATA[DA845735FBB34548B04F1908E2089CEC]]></AD_TAB_ID>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <AD_COLUMN_ID><![CDATA[A655AE8B366D4FE1A52BA9F10510457F]]></AD_COLUMN_ID>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <SEQNO><![CDATA[50]]></SEQNO>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <GRID_SEQNO><![CDATA[60]]></GRID_SEQNO>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--8A2832092DBF47BAACB2D24CD2CC2F38--></AD_FIELD>
-
 <!--8A2DEDD6E4A94D0090C6238BE68E38FD--><AD_FIELD>
 <!--8A2DEDD6E4A94D0090C6238BE68E38FD-->  <AD_FIELD_ID><![CDATA[8A2DEDD6E4A94D0090C6238BE68E38FD]]></AD_FIELD_ID>
 <!--8A2DEDD6E4A94D0090C6238BE68E38FD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -253370,6 +253372,35 @@
 <!--96C44F2E2B7A41B092E09E5F4F243B74-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--96C44F2E2B7A41B092E09E5F4F243B74--></AD_FIELD>
 
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8--><AD_FIELD>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <AD_FIELD_ID><![CDATA[96E39E8A5CA244B8A1D8BBE8A74AAEB8]]></AD_FIELD_ID>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <NAME><![CDATA[Role]]></NAME>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <DESCRIPTION><![CDATA[The profile of security for the user defining what windows and tabs they can see.]]></DESCRIPTION>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <HELP><![CDATA[The Role determines security and access a user who has this Role will have in the System.]]></HELP>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <AD_TAB_ID><![CDATA[DA845735FBB34548B04F1908E2089CEC]]></AD_TAB_ID>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <AD_COLUMN_ID><![CDATA[02EDB5224DE54FBBA4DD9AA1C02CC5D3]]></AD_COLUMN_ID>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <SEQNO><![CDATA[15]]></SEQNO>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <GRID_SEQNO><![CDATA[15]]></GRID_SEQNO>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--96E39E8A5CA244B8A1D8BBE8A74AAEB8--></AD_FIELD>
+
 <!--97045257D2E8419786C52DD8702193DA--><AD_FIELD>
 <!--97045257D2E8419786C52DD8702193DA-->  <AD_FIELD_ID><![CDATA[97045257D2E8419786C52DD8702193DA]]></AD_FIELD_ID>
 <!--97045257D2E8419786C52DD8702193DA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -270694,6 +270725,35 @@
 <!--B2A0F24559EE449CBB44C0EB1DAAC75F-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--B2A0F24559EE449CBB44C0EB1DAAC75F--></AD_FIELD>
 
+<!--B2BE151C512F4057B5711E12963A0256--><AD_FIELD>
+<!--B2BE151C512F4057B5711E12963A0256-->  <AD_FIELD_ID><![CDATA[B2BE151C512F4057B5711E12963A0256]]></AD_FIELD_ID>
+<!--B2BE151C512F4057B5711E12963A0256-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B2BE151C512F4057B5711E12963A0256-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B2BE151C512F4057B5711E12963A0256-->  <NAME><![CDATA[Role]]></NAME>
+<!--B2BE151C512F4057B5711E12963A0256-->  <DESCRIPTION><![CDATA[The profile of security for the user defining what windows and tabs they can see.]]></DESCRIPTION>
+<!--B2BE151C512F4057B5711E12963A0256-->  <HELP><![CDATA[The Role determines security and access a user who has this Role will have in the System.]]></HELP>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B2BE151C512F4057B5711E12963A0256-->  <AD_TAB_ID><![CDATA[A55C6E2F874F4CD0B7AEDE4362701EA2]]></AD_TAB_ID>
+<!--B2BE151C512F4057B5711E12963A0256-->  <AD_COLUMN_ID><![CDATA[D51CD55DE2D441ED99283A396909336F]]></AD_COLUMN_ID>
+<!--B2BE151C512F4057B5711E12963A0256-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--B2BE151C512F4057B5711E12963A0256-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--B2BE151C512F4057B5711E12963A0256-->  <SEQNO><![CDATA[15]]></SEQNO>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B2BE151C512F4057B5711E12963A0256-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--B2BE151C512F4057B5711E12963A0256-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B2BE151C512F4057B5711E12963A0256-->  <GRID_SEQNO><![CDATA[15]]></GRID_SEQNO>
+<!--B2BE151C512F4057B5711E12963A0256-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--B2BE151C512F4057B5711E12963A0256-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--B2BE151C512F4057B5711E12963A0256-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--B2BE151C512F4057B5711E12963A0256-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B2BE151C512F4057B5711E12963A0256--></AD_FIELD>
+
 <!--B2CAF17F8D704FBEBE68F769C14F1055--><AD_FIELD>
 <!--B2CAF17F8D704FBEBE68F769C14F1055-->  <AD_FIELD_ID><![CDATA[B2CAF17F8D704FBEBE68F769C14F1055]]></AD_FIELD_ID>
 <!--B2CAF17F8D704FBEBE68F769C14F1055-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -276847,6 +276907,35 @@
 <!--BE72ECFB2E8C4C568C9AD6D93AFF146E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--BE72ECFB2E8C4C568C9AD6D93AFF146E--></AD_FIELD>
 
+<!--BE7BCC6594514A3A9343B453BB62945F--><AD_FIELD>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <AD_FIELD_ID><![CDATA[BE7BCC6594514A3A9343B453BB62945F]]></AD_FIELD_ID>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <NAME><![CDATA[Creation Date]]></NAME>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <DESCRIPTION><![CDATA[The date that this record is completed.]]></DESCRIPTION>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <HELP><![CDATA[The Created field indicates the date that this record was created.]]></HELP>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <AD_TAB_ID><![CDATA[DA845735FBB34548B04F1908E2089CEC]]></AD_TAB_ID>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <AD_COLUMN_ID><![CDATA[BD8F659DEF86433D93BD93858D223732]]></AD_COLUMN_ID>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <GRID_SEQNO><![CDATA[60]]></GRID_SEQNO>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--BE7BCC6594514A3A9343B453BB62945F-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--BE7BCC6594514A3A9343B453BB62945F--></AD_FIELD>
+
 <!--BE7E52451C394C038D875B914A12C150--><AD_FIELD>
 <!--BE7E52451C394C038D875B914A12C150-->  <AD_FIELD_ID><![CDATA[BE7E52451C394C038D875B914A12C150]]></AD_FIELD_ID>
 <!--BE7E52451C394C038D875B914A12C150-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -276917,7 +277006,7 @@
 <!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
 <!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--BEB0D785211B4CF8BE7C249EA81C13F7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -294229,7 +294318,7 @@
 <!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <SEQNO><![CDATA[90]]></SEQNO>
 <!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--DFAD5A49692B4291BCCDB5E47E6791F9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -295220,33 +295309,6 @@
 <!--E08B7961A1894624A25918204633568E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E08B7961A1894624A25918204633568E--></AD_FIELD>
 
-<!--E08C0628B19E4EE8BC34448F4946930E--><AD_FIELD>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <AD_FIELD_ID><![CDATA[E08C0628B19E4EE8BC34448F4946930E]]></AD_FIELD_ID>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <NAME><![CDATA[Stored]]></NAME>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <AD_TAB_ID><![CDATA[A55C6E2F874F4CD0B7AEDE4362701EA2]]></AD_TAB_ID>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <AD_COLUMN_ID><![CDATA[A442A53BD7A54C618FB7FCA289FA114D]]></AD_COLUMN_ID>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <SEQNO><![CDATA[40]]></SEQNO>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <GRID_SEQNO><![CDATA[30]]></GRID_SEQNO>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <STARTNEWLINE><![CDATA[Y]]></STARTNEWLINE>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--E08C0628B19E4EE8BC34448F4946930E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--E08C0628B19E4EE8BC34448F4946930E--></AD_FIELD>
-
 <!--E0B9705EA3F64E78ACBFB1E7284A4BB3--><AD_FIELD>
 <!--E0B9705EA3F64E78ACBFB1E7284A4BB3-->  <AD_FIELD_ID><![CDATA[E0B9705EA3F64E78ACBFB1E7284A4BB3]]></AD_FIELD_ID>
 <!--E0B9705EA3F64E78ACBFB1E7284A4BB3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -6988,6 +6988,30 @@
 <!--BDB3B6FCA0AB453DB4E83503BAB82470-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--BDB3B6FCA0AB453DB4E83503BAB82470--></AD_PROCESS>
 
+<!--CD10460DF4C14232801DD5C6A14575DD--><AD_PROCESS>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <AD_PROCESS_ID><![CDATA[CD10460DF4C14232801DD5C6A14575DD]]></AD_PROCESS_ID>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <VALUE><![CDATA[ReprocessErrorImportEntries]]></VALUE>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <NAME><![CDATA[Reprocess Error Import Entries]]></NAME>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <DESCRIPTION><![CDATA[Reset all Error Import Entries back to Initial to be reprocessed]]></DESCRIPTION>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <CLASSNAME><![CDATA[org.openbravo.service.importprocess.ImportReprocessErrorEntries]]></CLASSNAME>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISBACKGROUND><![CDATA[Y]]></ISBACKGROUND>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--CD10460DF4C14232801DD5C6A14575DD-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
+<!--CD10460DF4C14232801DD5C6A14575DD--></AD_PROCESS>
+
 <!--CD7283DF804B449C97DA09446669EEEF--><AD_PROCESS>
 <!--CD7283DF804B449C97DA09446669EEEF-->  <AD_PROCESS_ID><![CDATA[CD7283DF804B449C97DA09446669EEEF]]></AD_PROCESS_ID>
 <!--CD7283DF804B449C97DA09446669EEEF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-db/database/sourcedata/AD_TAB.xml	Tue Jun 02 12:46:43 2015 +0200
@@ -17449,7 +17449,7 @@
 <!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
 <!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
-<!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <HQLORDERBYCLAUSE><![CDATA[stored desc]]></HQLORDERBYCLAUSE>
+<!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <HQLORDERBYCLAUSE><![CDATA[creationDate desc]]></HQLORDERBYCLAUSE>
 <!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
 <!--A55C6E2F874F4CD0B7AEDE4362701EA2-->  <ISREADONLYTREE><![CDATA[N]]></ISREADONLYTREE>
@@ -18899,7 +18899,7 @@
 <!--DA845735FBB34548B04F1908E2089CEC-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
 <!--DA845735FBB34548B04F1908E2089CEC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--DA845735FBB34548B04F1908E2089CEC-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
-<!--DA845735FBB34548B04F1908E2089CEC-->  <HQLORDERBYCLAUSE><![CDATA[stored desc]]></HQLORDERBYCLAUSE>
+<!--DA845735FBB34548B04F1908E2089CEC-->  <HQLORDERBYCLAUSE><![CDATA[creationDate desc]]></HQLORDERBYCLAUSE>
 <!--DA845735FBB34548B04F1908E2089CEC-->  <HQLFILTERCLAUSE><![CDATA[importStatus='Initial' or importStatus='Error' ]]></HQLFILTERCLAUSE>
 <!--DA845735FBB34548B04F1908E2089CEC-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--DA845735FBB34548B04F1908E2089CEC-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
--- a/src-test/src/org/openbravo/test/AllAntTaskTests.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-test/src/org/openbravo/test/AllAntTaskTests.java	Tue Jun 02 12:46:43 2015 +0200
@@ -63,6 +63,7 @@
 import org.openbravo.test.security.EntityAccessTest;
 import org.openbravo.test.security.WritableReadableOrganizationClientTest;
 import org.openbravo.test.system.ErrorTextParserTest;
+import org.openbravo.test.system.ImportEntrySizeTest;
 import org.openbravo.test.system.Issue29934Test;
 import org.openbravo.test.system.SystemServiceTest;
 import org.openbravo.test.system.SystemValidatorTest;
@@ -139,6 +140,7 @@
     ErrorTextParserTest.class, //
     TestInfrastructure.class, //
     Issue29934Test.class, //
+    ImportEntrySizeTest.class, //
 
     // xml
     ClientExportImportTest.class, //
--- a/src-test/src/org/openbravo/test/AllQuickAntTaskTests.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-test/src/org/openbravo/test/AllQuickAntTaskTests.java	Tue Jun 02 12:46:43 2015 +0200
@@ -40,6 +40,7 @@
 import org.openbravo.test.security.EntityAccessTest;
 import org.openbravo.test.security.WritableReadableOrganizationClientTest;
 import org.openbravo.test.system.ErrorTextParserTest;
+import org.openbravo.test.system.ImportEntrySizeTest;
 import org.openbravo.test.system.Issue29934Test;
 import org.openbravo.test.system.SystemServiceTest;
 import org.openbravo.test.system.SystemValidatorTest;
@@ -93,6 +94,7 @@
     ErrorTextParserTest.class, //
     TestInfrastructure.class, //
     Issue29934Test.class, //
+    ImportEntrySizeTest.class, //
 
     // xml
     EntityXMLImportTestBusinessObject.class, //
--- a/src-test/src/org/openbravo/test/AntTaskTests.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src-test/src/org/openbravo/test/AntTaskTests.java	Tue Jun 02 12:46:43 2015 +0200
@@ -54,6 +54,7 @@
 import org.openbravo.test.security.EntityAccessTest;
 import org.openbravo.test.security.WritableReadableOrganizationClientTest;
 import org.openbravo.test.system.ErrorTextParserTest;
+import org.openbravo.test.system.ImportEntrySizeTest;
 import org.openbravo.test.system.Issue29934Test;
 import org.openbravo.test.system.SystemServiceTest;
 import org.openbravo.test.system.SystemValidatorTest;
@@ -126,6 +127,7 @@
     ErrorTextParserTest.class, //
     TestInfrastructure.class, //
     Issue29934Test.class, //
+    ImportEntrySizeTest.class, //
 
     // xml
     EntityXMLImportTestBusinessObject.class, //
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/src/org/openbravo/test/system/ImportEntrySizeTest.java	Tue Jun 02 12:46:43 2015 +0200
@@ -0,0 +1,114 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2015 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.system;
+
+import java.util.Date;
+import java.util.UUID;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.utility.DataSet;
+import org.openbravo.service.dataset.DataSetService;
+import org.openbravo.service.importprocess.ImportEntry;
+import org.openbravo.service.importprocess.ImportEntryArchive;
+import org.openbravo.test.base.OBBaseTest;
+
+/**
+ * Test the {@link ImportEntry} and {@link ImportEntryArchive} tables to see that large text fit in
+ * there.
+ * 
+ * @author mtaal
+ */
+
+public class ImportEntrySizeTest extends OBBaseTest {
+  private static final long SIZE = 1000 * 1000 * 10;
+
+  /**
+   * Test the {@link DataSetService#hasChanged(DataSet, Date)} method.
+   */
+  @Test
+  public void testChangedDataSet() {
+    setTestAdminContext();
+
+    // create a random string
+    StringBuilder sb = new StringBuilder();
+    // do -100 as the new UUID will maybe get it over the max length which is 10 million
+    while (sb.length() <= (SIZE - 100)) {
+      sb.append(UUID.randomUUID().toString());
+    }
+    String json = sb.toString();
+
+    StringBuilder sb2 = new StringBuilder();
+    // do -100 as the new UUID will maybe get it over the max length which is 10 million
+    while (sb2.length() <= (SIZE - 100)) {
+      sb2.append(UUID.randomUUID().toString());
+    }
+    String error = sb2.toString();
+
+    String importEntryId = null;
+    {
+      final ImportEntry importEntry = OBProvider.getInstance().get(ImportEntry.class);
+      importEntry.setJsonInfo(json);
+      importEntry.setErrorinfo(error);
+      importEntry.setImported(new Date());
+      importEntry.setImportStatus("Initial");
+      importEntry.setTypeofdata("Order");
+      OBDal.getInstance().save(importEntry);
+      importEntryId = importEntry.getId();
+
+      final ImportEntryArchive importEntryArchive = OBProvider.getInstance().get(
+          ImportEntryArchive.class);
+      importEntryArchive.setId(importEntry.getId());
+      importEntryArchive.setNewOBObject(true);
+      importEntryArchive.setJsonInfo(json);
+      importEntryArchive.setErrorinfo(error);
+      importEntryArchive.setImported(new Date());
+      importEntryArchive.setImportStatus("Initial");
+      importEntryArchive.setTypeofdata("Order");
+      OBDal.getInstance().save(importEntryArchive);
+      OBDal.getInstance().commitAndClose();
+    }
+
+    // read and check
+    ImportEntry importEntry = OBDal.getInstance().get(ImportEntry.class, importEntryId);
+    ImportEntryArchive importEntryArchive = OBDal.getInstance().get(ImportEntryArchive.class,
+        importEntryId);
+
+    // remove to clean the db before checking
+    OBDal.getInstance().remove(importEntryArchive);
+    OBDal.getInstance().remove(importEntry);
+    OBDal.getInstance().commitAndClose();
+
+    // check the result
+    Assert.assertEquals(json, importEntry.getJsonInfo());
+    Assert.assertEquals(error, importEntry.getErrorinfo());
+
+    Assert.assertEquals(json, importEntryArchive.getJsonInfo());
+    Assert.assertEquals(error, importEntryArchive.getErrorinfo());
+
+    // and check that we actually checked big sizes
+    Assert.assertTrue(importEntry.getJsonInfo().length() > (SIZE - 100));
+    Assert.assertTrue(importEntry.getErrorinfo().length() > (SIZE - 100));
+    Assert.assertTrue(importEntryArchive.getJsonInfo().length() > (SIZE - 100));
+    Assert.assertTrue(importEntryArchive.getErrorinfo().length() > (SIZE - 100));
+  }
+}
\ No newline at end of file
--- a/src/org/openbravo/service/importprocess/ImportEntryArchiveManager.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src/org/openbravo/service/importprocess/ImportEntryArchiveManager.java	Tue Jun 02 12:46:43 2015 +0200
@@ -99,6 +99,8 @@
     @Override
     public void run() {
 
+      Thread.currentThread().setName("Import Entry Archiver");
+
       // don't start right away at startup, give the system time to
       // really start
       log.debug("Started, first sleep " + ARCHIVE_INTERVAL);
@@ -110,7 +112,7 @@
 
       // make ourselves an admin
       OBContext.setOBContext("0", "0", "0", "0");
-      Date lastStored = null;
+      Date lastCreated = null;
       while (true) {
         try {
           boolean dataProcessed = false;
@@ -119,17 +121,17 @@
             // processing next records if there is one failing or giving issues, so the failing
             // is skipped in the next cycle
             String additionalClause = "";
-            if (lastStored != null) {
-              additionalClause = " AND " + ImportEntry.PROPERTY_STORED + ">:stored";
+            if (lastCreated != null) {
+              additionalClause = " AND " + ImportEntry.PROPERTY_CREATIONDATE + ">:created";
             }
             OBQuery<ImportEntry> entriesQry = OBDal.getInstance().createQuery(
                 ImportEntry.class,
                 ImportEntry.PROPERTY_IMPORTSTATUS + "='Processed' " + additionalClause
-                    + " order by " + ImportEntry.PROPERTY_STORED);
+                    + " order by " + ImportEntry.PROPERTY_CREATIONDATE);
             entriesQry.setFilterOnReadableClients(false);
             entriesQry.setFilterOnReadableOrganization(false);
-            if (lastStored != null) {
-              entriesQry.setNamedParameter("stored", lastStored);
+            if (lastCreated != null) {
+              entriesQry.setNamedParameter("created", lastCreated);
             }
             entriesQry.setMaxResult(1000);
 
@@ -140,7 +142,7 @@
             log.debug("Found " + entries.size() + " import entries");
             for (ImportEntry importEntry : entries) {
               dataProcessed = true;
-              lastStored = importEntry.getStored();
+              lastCreated = importEntry.getCreationDate();
 
               ImportEntryArchive archiveEntry = createArchiveEntry(importEntry);
 
@@ -166,7 +168,7 @@
           // nothing to do in last cycle wait one hour
           if (!dataProcessed) {
             log.debug("waiting");
-            lastStored = null;
+            lastCreated = null;
             try {
               Thread.sleep(ARCHIVE_INTERVAL);
             } catch (Exception ignored) {
--- a/src/org/openbravo/service/importprocess/ImportEntryManager.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src/org/openbravo/service/importprocess/ImportEntryManager.java	Tue Jun 02 12:46:43 2015 +0200
@@ -27,9 +27,12 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.Any;
@@ -39,11 +42,14 @@
 
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.core.SessionHandler;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
+import org.openbravo.model.ad.access.Role;
 
 /**
  * This class is the main manager for performing multi-threaded and parallel import of data from the
@@ -56,6 +62,10 @@
 public class ImportEntryManager {
 
   /*
+   * For an overview of the technical layer, first view this presentation:
+   * http://wiki.openbravo.com/
+   * wiki/Projects:Retail_Operations_Buffer#Presentation_on_Technical_Structure (note: hyperlink
+   * maybe cut by line-break)
    * 
    * {@link ImportEntry} records are created by for example data synchronization processes. For
    * creating a new {@link ImportEntry} preferably the {@link #createImportEntry(String, String,
@@ -125,7 +135,7 @@
   private ImportEntryArchiveManager importEntryArchiveManager;
 
   private ImportEntryManagerThread managerThread;
-  private ExecutorService executorService;
+  private ThreadPoolExecutor executorService;
 
   private Map<String, ImportEntryProcessor> importEntryProcessors = new HashMap<String, ImportEntryProcessor>();
 
@@ -137,8 +147,26 @@
   private long initialWaitTime = 10000;
   private long managerWaitTime = 60000;
 
+  // default to number of processors plus some additionals for the main threads
+  private int numberOfThreads = Runtime.getRuntime().availableProcessors() + 3;
+
+  // defines the batch size of reading and processing import entries by the
+  // main thread, for each type of data the batch size is being read
+  private int importBatchSize = 5000;
+
+  // task queue limit in the executorservice, sufficiently large
+  // to allow large sets of tasks but small enough to limit an implementing
+  // subclass of ImportEntryProcessor going wild
+  private int maxTaskQueueSize = 1000;
+
   public ImportEntryManager() {
     instance = this;
+    importBatchSize = ImportProcessUtils.getCheckIntProperty(log, "import.batch.size",
+        importBatchSize, 1000);
+    numberOfThreads = ImportProcessUtils.getCheckIntProperty(log, "import.number.of.threads",
+        numberOfThreads, 4);
+    maxTaskQueueSize = ImportProcessUtils.getCheckIntProperty(log, "import.max.task.queue.size",
+        maxTaskQueueSize, 1000);
   }
 
   public synchronized void start() {
@@ -147,16 +175,37 @@
     }
     threadsStarted = true;
     log.debug("Starting Import Entry Framework");
-    executorService = Executors.newSingleThreadExecutor(new DaemonThreadFactory());
 
-    // passing ourselves as we have the Weld injected code
+    // same as fixed threadpool, will only stop accepting new tasks (throw an exception)
+    // if there are maxTaskQueueSize in the queue, see the catch exception in submitRunnable.
+    // http://www.nurkiewicz.com/2014/11/executorservice-10-tips-and-tricks.html
+    final BlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(maxTaskQueueSize);
+    executorService = new ThreadPoolExecutor(numberOfThreads, numberOfThreads, 0L,
+        TimeUnit.MILLISECONDS, queue, new DaemonThreadFactory());
+
+    // create, start the manager thread
     managerThread = new ImportEntryManagerThread(this);
-    executorService.execute(managerThread);
+    executorService.submit(managerThread);
     importEntryArchiveManager.start();
   }
 
   /**
-   * Shutdown all the threads being by the import framework
+   * Is called by the {@link ImportEntryProcessor} objects to submit a
+   * {@link ImportEntryProcessor.ImportEntryProcessRunnable}. for execution.
+   */
+  public void submitRunnable(Runnable runnable) {
+    try {
+      executorService.submit(runnable);
+    } catch (Exception e) {
+      // except for logging we can ignore the exception
+      // as the import entry will be offered again for reprocessing later anyway
+      log.warn("Exception while trying to add runnable " + runnable
+          + " to the list of tasks to run", e);
+    }
+  }
+
+  /**
+   * Shutdown all the threads being used by the import framework
    */
   public void shutdown() {
     log.debug("Shutting down Import Entry Framework");
@@ -173,27 +222,41 @@
    * {@link ImportEntryPreProcessor} instances.
    * 
    * Note will commit the session/connection using {@link OBDal#commitAndClose()}
-   * 
-   * @param json
    */
   public void createImportEntry(String id, String typeOfData, String json) {
     OBDal.getInstance().flush();
     OBContext.setAdminMode(false);
     try {
-      // check if it is not there already
-      final Query qry = SessionHandler.getInstance().getSession()
-          .createQuery("select id from " + ImportEntry.ENTITY_NAME + " where id=:id");
-      qry.setParameter("id", id);
-      if (!qry.list().isEmpty()) {
-        // already exists, ignore
-        return;
+      // check if it is not there already or already archived
+      {
+        final Query qry = SessionHandler.getInstance().getSession()
+            .createQuery("select count(*) from " + ImportEntry.ENTITY_NAME + " where id=:id");
+        qry.setParameter("id", id);
+        if (((Number) qry.uniqueResult()).intValue() > 0) {
+          log.debug("Entry already exists, ignoring it, id/typeofdata " + id + "/" + typeOfData
+              + " json " + json);
+          return;
+        }
+      }
+      {
+        final Query qry = SessionHandler
+            .getInstance()
+            .getSession()
+            .createQuery("select count(*) from " + ImportEntryArchive.ENTITY_NAME + " where id=:id");
+        qry.setParameter("id", id);
+        if (((Number) qry.uniqueResult()).intValue() > 0) {
+          log.debug("Entry already archived, ignoring it, id/typeofdata " + id + "/" + typeOfData
+              + " json " + json);
+          return;
+        }
       }
 
       ImportEntry importEntry = OBProvider.getInstance().get(ImportEntry.class);
       importEntry.setId(id);
+      importEntry.setRole(OBDal.getInstance().get(Role.class,
+          OBContext.getOBContext().getRole().getId()));
       importEntry.setNewOBObject(true);
       importEntry.setImportStatus("Initial");
-      importEntry.setStored(new Date());
       importEntry.setImported(null);
       importEntry.setTypeofdata(typeOfData);
       importEntry.setJsonInfo(json);
@@ -258,7 +321,10 @@
         entryProcessor.handleImportEntry(importEntry);
       }
     } catch (Throwable t) {
-      handleImportError(importEntry, t);
+      log.error(
+          "Error while saving import message " + importEntry + " " + importEntry.getJsonInfo()
+              + "  message: " + t.getMessage(), t);
+      setImportEntryErrorIndependent(importEntry.getId(), t);
     }
   }
 
@@ -316,6 +382,7 @@
    */
   public void setImportEntryErrorIndependent(String importEntryId, Throwable t) {
     OBDal.getInstance().rollbackAndClose();
+    final OBContext prevOBContext = OBContext.getOBContext();
     OBContext.setOBContext("0", "0", "0", "0");
     try {
       OBContext.setAdminMode();
@@ -328,7 +395,7 @@
       }
     } finally {
       OBContext.restorePreviousMode();
-      OBContext.setOBContext((OBContext) null);
+      OBContext.setOBContext(prevOBContext);
     }
   }
 
@@ -370,6 +437,8 @@
     @Override
     public void run() {
 
+      Thread.currentThread().setName("Import Entry Manager Main");
+
       // don't start right away at startup, give the system time to
       // really start
       log.debug("Started, first sleep " + manager.initialWaitTime);
@@ -379,47 +448,91 @@
       }
       log.debug("Run loop started");
 
-      // make ourselves an admin
-      OBContext.setOBContext("0", "0", "0", "0");
       while (true) {
+        // obcontext cleared or wrong obcontext, repair
+        if (OBContext.getOBContext() == null
+            || !"0".equals(OBContext.getOBContext().getUser().getId())) {
+          // make ourselves an admin
+          OBContext.setOBContext("0", "0", "0", "0");
+        }
         try {
-          boolean dataPresent = false;
+
+          // too busy, don't process, but wait
+          if (manager.executorService.getQueue().size() > (manager.maxTaskQueueSize - 1)) {
+            doWait();
+            // woken, re-start from beginning of loop
+            continue;
+          }
+
+          List<String> typesOfData = null;
+          if (typesOfData == null) {
+            typesOfData = ImportProcessUtils.getOrderedTypesOfData();
+          }
+
+          int entryCount = 0;
           try {
-            OBQuery<ImportEntry> entriesQry = OBDal.getInstance().createQuery(
-                ImportEntry.class,
-                ImportEntry.PROPERTY_IMPORTSTATUS + "='Initial' order by "
-                    + ImportEntry.PROPERTY_STORED);
-            entriesQry.setFilterOnReadableClients(false);
-            entriesQry.setFilterOnReadableOrganization(false);
 
-            // do a try catch block here
-            try {
-              // will be processing, so ignore any subsequent notifications
-              wasNotifiedInParallel = false;
+            // start processing, so ignore any notifications happening before
+            wasNotifiedInParallel = false;
 
-              final List<ImportEntry> entries = entriesQry.list();
-              dataPresent = !entries.isEmpty();
-              log.debug("Found " + entries.size() + " import entries");
-              for (ImportEntry importEntry : entries) {
-                manager.handleImportEntry(importEntry);
+            // read the types of data one by one in a specific order, so that they
+            // don't block eachother with the limited batch size
+            // being read
+            for (String typeOfData : typesOfData) {
+              OBQuery<ImportEntry> entriesQry = OBDal.getInstance().createQuery(
+                  ImportEntry.class,
+                  ImportEntry.PROPERTY_TYPEOFDATA + "='" + typeOfData + "' and "
+                      + ImportEntry.PROPERTY_IMPORTSTATUS + "='Initial' order by "
+                      + ImportEntry.PROPERTY_CREATIONDATE);
+              entriesQry.setFilterOnReadableClients(false);
+              entriesQry.setFilterOnReadableOrganization(false);
+              entriesQry.setMaxResult(manager.importBatchSize);
+
+              final ScrollableResults entries = entriesQry.scroll(ScrollMode.FORWARD_ONLY);
+              while (entries.next()) {
+                entryCount++;
+                final ImportEntry importEntry = (ImportEntry) entries.get()[0];
+                try {
+                  manager.handleImportEntry(importEntry);
+                } catch (Throwable t) {
+                  // ImportEntryProcessors are custom implementations which can cause
+                  // errors, so always catch them to prevent other import entries
+                  // from not getting processed
+                  manager.setImportEntryError(importEntry.getId(), t);
+                  OBDal.getInstance().flush();
+                }
+                // get rid of it to keep the session small
+                OBDal.getInstance().getSession().evict(importEntry);
               }
-            } catch (Throwable t) {
-              ImportProcessUtils.logError(log, t);
             }
+
+          } catch (Throwable t) {
+            ImportProcessUtils.logError(log, t);
           } finally {
             OBDal.getInstance().commitAndClose();
           }
 
-          // now wait for new ones to arrive or check after a certain
-          // amount of time
-          if (!dataPresent) {
+          if (entryCount > 0) {
+            // if there was data then just wait some time
+            // give the threads time to process it all before trying
+            // a next batch of entries
+            try {
+              // wait one second per 50 records, somewhat arbitrary
+              // but high enough for most cases
+              Thread.sleep(1000 * (entryCount / 50));
+            } catch (Exception ignored) {
+            }
+          } else {
+            // else wait for new ones to arrive or check after a certain
+            // amount of time
             doWait();
           }
 
         } catch (Throwable t) {
           ImportProcessUtils.logError(log, t);
 
-          // wait otherwise the loop goes wild
+          // wait otherwise the loop goes wild in case of really severe
+          // system errors like full disk
           try {
             Thread.sleep(5 * manager.managerWaitTime);
           } catch (Exception ignored) {
@@ -472,8 +585,6 @@
 
     public synchronized void log() {
       log.info("Timings for " + typeOfData + " cnt: " + cnt + " avg millis: " + (totalTime / cnt));
-      System.err.println("Timings for " + typeOfData + " cnt: " + cnt + " avg millis: "
-          + (totalTime / cnt));
     }
   }
 
@@ -481,11 +592,27 @@
    * Creates threads which have deamon set to true.
    */
   public static class DaemonThreadFactory implements ThreadFactory {
+    private AtomicInteger threadNumber = new AtomicInteger(0);
+    private final ThreadGroup group;
+
+    public DaemonThreadFactory() {
+      SecurityManager s = System.getSecurityManager();
+      group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
+    }
+
     @Override
     public Thread newThread(Runnable runnable) {
-      Thread thread = Executors.defaultThreadFactory().newThread(runnable);
+
+      final Thread thread = new Thread(group, runnable, "Import Entry - "
+          + threadNumber.getAndIncrement(), 0);
+
+      if (thread.getPriority() != Thread.NORM_PRIORITY) {
+        thread.setPriority(Thread.NORM_PRIORITY);
+      }
+
       thread.setDaemon(true);
       return thread;
     }
+
   }
 }
--- a/src/org/openbravo/service/importprocess/ImportEntryProcessor.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src/org/openbravo/service/importprocess/ImportEntryProcessor.java	Tue Jun 02 12:46:43 2015 +0200
@@ -18,14 +18,15 @@
  */
 package org.openbravo.service.importprocess;
 
+import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Queue;
+import java.util.Set;
 import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
@@ -35,9 +36,9 @@
 import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.core.SessionHandler;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.enterprise.Organization;
-import org.openbravo.service.importprocess.ImportEntryManager.DaemonThreadFactory;
 
 /**
  * The {@link ImportEntryProcessor} is responsible for importing/processing {@link ImportEntry}
@@ -76,12 +77,12 @@
  * The default/base implementation of the {@link ImportEntryProcessRunnable} provides standard
  * features related to caching of {@link OBContext}, error handling and transaction handling.
  * 
- * Note: this implementation uses the java {@link ExecutorService} to create a threadpool with a
- * fixed size. Threads are started by using the {@link ExecutorService#submit(Runnable)} method. Any
- * exceptions inside the {@link Runnable#run()} method are swallowed and won't directly show up in
- * the console. Therefore the default implementation in the {@link ImportEntryProcessRunnable#run()}
- * has different mechanisms to correctly log/record the error (in the
- * {@link ImportEntry#getErrorinfo()}).
+ * Note: this implementation uses the executorService in the {@link ImportEntryManager}. Threads are
+ * started by using the {@link ExecutorService#submit(Runnable)} method, see
+ * {@link ImportEntryManager#submitRunnable(Runnable)}. Any exceptions inside the
+ * {@link Runnable#run()} method are swallowed and won't directly show up in the console. Therefore
+ * the default implementation in the {@link ImportEntryProcessRunnable#run()} has different
+ * mechanisms to correctly log/record the error (in the {@link ImportEntry#getErrorinfo()}).
  * 
  * Note: the {@link ImportEntryProcessor} should be aware that the same {@link ImportEntry} can be
  * passed multiple times to it. Also after the {@link ImportEntryProcessor} has already processed
@@ -100,48 +101,21 @@
 @ApplicationScoped
 public abstract class ImportEntryProcessor {
 
+  // a sufficient large number still preventing OOM and signaling strange situation
+  private static final int MAX_QUEUE_SIZE = 50000;
+
   // not static to create a Logger for each subclass
   private Logger log;
 
-  private boolean initialized = false;
-
   // multiple threads access this map, its access is handled through
   // synchronized methods
   private Map<String, ImportEntryProcessRunnable> runnables = new HashMap<String, ImportEntryProcessRunnable>();
-  private ExecutorService executorService;
 
   @Inject
   private ImportEntryManager importEntryManager;
 
-  // create executor service which manages the threads
-  private synchronized void initialize() {
-    if (initialized) {
-      return;
-    }
-
+  public ImportEntryProcessor() {
     log = Logger.getLogger(this.getClass());
-
-    // TODO: make number of threads configurable through a preference
-    // threads are created on demand, so if not needed then it is not
-    // used
-    executorService = Executors.newFixedThreadPool(Math.max(1, getMaxNumberOfThreads()),
-        new DaemonThreadFactory());
-
-    initialized = true;
-  }
-
-  /**
-   * The max number of threads to be started by the {@link ExecutorService} to process
-   * {@link ImportEntry} objects. Default is 2.
-   * 
-   * For high-load-volume data consider setting this equal to half or a quarter of the number of
-   * cores/processors (this to leave 'room' for other threads and processes).
-   * 
-   * @see Runtime#availableProcessors()
-   */
-  // TODO: consider making the number of threads configurable through a preference
-  protected int getMaxNumberOfThreads() {
-    return 2;
   }
 
   /**
@@ -149,9 +123,6 @@
    * {@link ImportEntryManager#shutdown()}.
    */
   public void shutdown() {
-    if (executorService != null) {
-      executorService.shutdownNow();
-    }
   }
 
   /**
@@ -167,8 +138,6 @@
    */
   public void handleImportEntry(ImportEntry importEntry) {
 
-    initialize();
-
     if (!canHandleImportEntry(importEntry)) {
       return;
     }
@@ -219,7 +188,7 @@
     runnables.put(key, runnable);
 
     // and give it to the executorServer to run
-    executorService.submit(runnable);
+    importEntryManager.submitRunnable(runnable);
   }
 
   /**
@@ -284,11 +253,13 @@
    *
    */
   public static abstract class ImportEntryProcessRunnable implements Runnable {
-    private Queue<ImportEntry> importEntries = new ConcurrentLinkedQueue<ImportEntry>();
+    private Queue<QueuedEntry> importEntries = new ConcurrentLinkedQueue<QueuedEntry>();
 
     private Logger logger;
 
-    private HashSet<String> importEntryIds = new HashSet<String>();
+    // create concurrent hashset using util method
+    private Set<String> importEntryIds = Collections
+        .newSetFromMap(new ConcurrentHashMap<String, Boolean>());
 
     private ImportEntryManager importEntryManager;
     private ImportEntryProcessor importEntryProcessor;
@@ -299,28 +270,27 @@
 
     @Override
     public void run() {
+
       logger = Logger.getLogger(this.getClass());
       try {
         int cnt = 0;
         long totalT = 0;
-        ImportEntry importEntry;
-        while ((importEntry = importEntries.poll()) != null) {
+        QueuedEntry queuedImportEntry;
+        while ((queuedImportEntry = importEntries.poll()) != null) {
           try {
             final long t0 = System.currentTimeMillis();
 
-            // start from scratch
-            OBDal.getInstance().rollbackAndClose();
-
             // set the same obcontext as was being used for the original
             // entry
-            setOBContext(importEntry);
+            setOBContext(queuedImportEntry);
 
             try {
               OBContext.setAdminMode();
               ImportEntry localImportEntry;
               try {
                 // reload the importEntry
-                localImportEntry = OBDal.getInstance().get(ImportEntry.class, importEntry.getId());
+                localImportEntry = OBDal.getInstance().get(ImportEntry.class,
+                    queuedImportEntry.importEntryId);
 
                 // check if already processed, if so skip it
                 if (localImportEntry == null
@@ -334,20 +304,32 @@
               // not changed, process
               processEntry(localImportEntry);
 
+              // processed so can be removed
+              importEntryIds.remove(queuedImportEntry.importEntryId);
+
+              // keep some stats
+              cnt++;
+              final long timeForEntry = (System.currentTimeMillis() - t0);
+              totalT += timeForEntry;
+              importEntryManager.reportStats(localImportEntry.getTypeofdata(), timeForEntry);
+              if ((cnt % 100) == 0 && logger.isDebugEnabled()) {
+                logger.debug("Runnable: " + key + ", processed " + cnt + " import entries in "
+                    + totalT + " millis, " + (totalT / cnt)
+                    + " per import entry, current queue size: " + importEntries.size());
+              }
+
+              // the import entry processEntry calls should not leave an open active session
+              if (SessionHandler.isSessionHandlerPresent()) {
+                // change to warning if the code in the subclasses really works correctly
+                logger
+                    .debug("Session handler present after processing import entry, this indicates that the processing code "
+                        + "does not correctly clean/close the session after its last actions. This should be fixed.");
+                OBDal.getInstance().commitAndClose();
+              }
+
             } finally {
               cleanUpThreadForNextCycle();
             }
-
-            // keep some stats
-            cnt++;
-            final long timeForEntry = (System.currentTimeMillis() - t0);
-            totalT += timeForEntry;
-            importEntryManager.reportStats(importEntry.getTypeofdata(), timeForEntry);
-            if ((cnt % 100) == 0 && logger.isDebugEnabled()) {
-              logger.debug("Runnable: " + key + ", processed " + cnt + " import entries in "
-                  + totalT + " millis, " + (totalT / cnt)
-                  + " per import entry, current queue size: " + importEntries.size());
-            }
           } catch (Throwable t) {
             // bit rough but ensures that the connection is released/closed
             try {
@@ -356,7 +338,7 @@
             }
 
             // store the error
-            importEntryManager.setImportEntryErrorIndependent(importEntry.getId(), t);
+            importEntryManager.setImportEntryErrorIndependent(queuedImportEntry.importEntryId, t);
           }
         }
         if (logger.isDebugEnabled()) {
@@ -383,20 +365,21 @@
       }
     }
 
-    protected Queue<ImportEntry> getImportEntryQueue() {
+    protected Queue<QueuedEntry> getImportEntryQueue() {
       return importEntries;
     }
 
-    protected void setOBContext(ImportEntry importEntry) {
-      final String userId = (String) DalUtil.getId(importEntry.getCreatedBy());
-      final String orgId = (String) DalUtil.getId(importEntry.getOrganization());
-      final String cacheKey = userId + "_" + orgId;
+    protected void setOBContext(QueuedEntry queuedEntry) {
+      final String userId = queuedEntry.userId;
+      final String orgId = queuedEntry.orgId;
+      final String roleId = queuedEntry.roleId;
+      final String cacheKey = userId + "_" + orgId + "_" + roleId;
       OBContext obContext = cachedOBContexts.get(cacheKey);
       if (obContext != null) {
         OBContext.setOBContext(obContext);
       } else {
-        final String clientId = (String) DalUtil.getId(importEntry.getClient());
-        OBContext.setOBContext(userId, null, clientId, orgId);
+        final String clientId = queuedEntry.clientId;
+        OBContext.setOBContext(userId, roleId, clientId, orgId);
         cachedOBContexts.put(cacheKey, OBContext.getOBContext());
         obContext = OBContext.getOBContext();
 
@@ -410,7 +393,6 @@
     }
 
     protected void setVariablesSecureApp(OBContext obContext) {
-
       OBContext.setAdminMode();
       try {
         final VariablesSecureApp variablesSecureApp = new VariablesSecureApp(obContext.getUser()
@@ -420,7 +402,6 @@
       } finally {
         OBContext.restorePreviousMode();
       }
-
     }
 
     protected void cleanUpThreadForNextCycle() {
@@ -429,8 +410,12 @@
     }
 
     /**
-     * Must be implemented by a subclass. Note subclass implementation must do its own commit of a
-     * transaction or setting admin mode.
+     * Must be implemented by a subclass. Note subclass implementation must perform a commit and
+     * close ({@link OBDal#commitAndClose()}) at the end of the processEntry, before it returns.
+     * 
+     * So that at the end of processing there should not an active Session anymore the implementor
+     * is responsible for correctly closing any open session/transaction. A warning will be logged
+     * if this is somehow forgotten.
      */
     protected abstract void processEntry(ImportEntry importEntry) throws Exception;
 
@@ -442,17 +427,23 @@
       this.key = key;
     }
 
+    // is called by the processor in the main EntityManagerThread
     private void addEntry(ImportEntry importEntry) {
+
+      // ignore the entry, queue is too large
+      // prevents memory problems
+      if (importEntries.size() > MAX_QUEUE_SIZE) {
+        // set to level debug until other changes have been made in subclassing code
+        logger.debug("Ignoring import entry, will be reprocessed later, too many queue entries "
+            + importEntries.size());
+        return;
+      }
+
       if (!importEntryIds.contains(importEntry.getId())) {
-
-        // hardcoded way of not letting the mem usage to get out of hand
-        // duplicates are also handled above in the code
-        if (importEntryIds.size() > 10000) {
-          importEntryIds.clear();
-        }
-
         importEntryIds.add(importEntry.getId());
-        importEntries.add(importEntry);
+        // cache a queued entry as it has a much lower mem foot print than the import
+        // entry itself
+        importEntries.add(new QueuedEntry(importEntry));
       }
     }
 
@@ -463,6 +454,25 @@
     public String getKey() {
       return key;
     }
+
+    // Local cache to make sure that there is a much lower mem foot print in the queue
+    // of entries, so only keep the needed info to create an obcontext
+    private static class QueuedEntry {
+      final String importEntryId;
+      final String orgId;
+      final String userId;
+      final String clientId;
+      final String roleId;
+
+      QueuedEntry(ImportEntry importEntry) {
+        importEntryId = importEntry.getId();
+        userId = (String) DalUtil.getId(importEntry.getCreatedBy());
+        orgId = (String) DalUtil.getId(importEntry.getOrganization());
+        roleId = importEntry.getRole() == null ? null : (String) DalUtil.getId(importEntry
+            .getRole());
+        clientId = (String) DalUtil.getId(importEntry.getClient());
+      }
+    }
   }
 
 }
--- a/src/org/openbravo/service/importprocess/ImportProcessUtils.java	Tue Jun 02 10:46:21 2015 +0200
+++ b/src/org/openbravo/service/importprocess/ImportProcessUtils.java	Tue Jun 02 12:46:43 2015 +0200
@@ -21,12 +21,19 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.sql.BatchUpdateException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
+import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.domain.Reference;
 
 /**
  * Utility methods used in the import process.
@@ -35,6 +42,61 @@
  */
 public class ImportProcessUtils {
 
+  public static List<String> getOrderedTypesOfData() {
+    final Reference reference = OBDal.getInstance().get(Reference.class,
+        "11F86B630ECB4A57B28927193F8AB99D");
+
+    List<org.openbravo.model.ad.domain.List> refList = new ArrayList<org.openbravo.model.ad.domain.List>(
+        reference.getADListList());
+    Collections.sort(refList, new Comparator<org.openbravo.model.ad.domain.List>() {
+
+      @Override
+      public int compare(org.openbravo.model.ad.domain.List o1,
+          org.openbravo.model.ad.domain.List o2) {
+        Long l1 = o1.getSequenceNumber();
+        Long l2 = o2.getSequenceNumber();
+        if (l1 == null) {
+          l1 = new Long(50);
+        }
+        if (l2 == null) {
+          l2 = new Long(50);
+        }
+        return l1.compareTo(l2);
+      }
+    });
+
+    final List<String> typesOfData = new ArrayList<String>();
+    for (org.openbravo.model.ad.domain.List ref : refList) {
+      typesOfData.add(ref.getSearchKey());
+    }
+
+    return typesOfData;
+  }
+
+  // get a property but prevent someone from putting a crazy value in properties
+  public static int getCheckIntProperty(Logger log, String property, int defaultValue, int minValue) {
+    final int value = ImportProcessUtils.getIntOpenbravoProperty(property, defaultValue);
+    if (value < minValue) {
+      log.warn("Value of property " + property + " is set too low (" + value
+          + "), using valid minValue instead " + minValue);
+      return minValue;
+    }
+    return value;
+  }
+
+  public static int getIntOpenbravoProperty(String propName, int defaultValue) {
+    final String val = OBPropertiesProvider.getInstance().getOpenbravoProperties()
+        .getProperty(propName);
+    if (val == null) {
+      return defaultValue;
+    }
+    try {
+      return Integer.parseInt(val);
+    } catch (NumberFormatException ignore) {
+      return defaultValue;
+    }
+  }
+
   public static void logError(Logger log, Throwable t) {
     Throwable toReport = t;
     if (t.getCause() instanceof BatchUpdateException) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/service/importprocess/ImportReprocessErrorEntries.java	Tue Jun 02 12:46:43 2015 +0200
@@ -0,0 +1,65 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.service.importprocess;
+
+import org.hibernate.Query;
+import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.scheduling.ProcessBundle;
+import org.openbravo.scheduling.ProcessLogger;
+import org.openbravo.service.db.DalBaseProcess;
+
+/**
+ * For all {@link ImportEntry} with importstatus Error sets it back to Initial and notifies the
+ * ImportEntryManager to process them.
+ * 
+ * @author mtaal
+ */
+public class ImportReprocessErrorEntries extends DalBaseProcess {
+  private ProcessLogger logger;
+
+  @Override
+  protected void doExecute(ProcessBundle bundle) throws Exception {
+    super.setDoCommit(false);
+    logger = bundle.getLogger();
+    OBContext.setAdminMode();
+    try {
+      final Query qry = OBDal
+          .getInstance()
+          .getSession()
+          .createQuery(
+              "update " + ImportEntry.ENTITY_NAME + " e set e." + ImportEntry.PROPERTY_IMPORTSTATUS
+                  + "='Initial' where e." + ImportEntry.PROPERTY_IMPORTSTATUS + "='Error'");
+      final int count = qry.executeUpdate();
+      logger.logln(count
+          + " import entries are set back to initialized, notifying import thread to process them");
+      logger.logln(OBMessageUtils.messageBD("Success"));
+    } catch (Exception e) {// won't' happen
+      logger.logln(OBMessageUtils.messageBD("Error"));
+    } finally {
+      OBDal.getInstance().commitAndClose();
+      ImportEntryManager entryManager = WeldUtils
+          .getInstanceFromStaticBeanManager(ImportEntryManager.class);
+
+      entryManager.notifyNewImportEntryCreated();
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/service/importprocess/ProcessImportEntriesProcessActionHandler.java	Tue Jun 02 12:46:43 2015 +0200
@@ -0,0 +1,65 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.service.importprocess;
+
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+
+/**
+ * Will trigger the import process.
+ * 
+ * @author mtaal
+ */
+public class ProcessImportEntriesProcessActionHandler extends BaseProcessActionHandler {
+  private static final Logger log = Logger
+      .getLogger(ProcessImportEntriesProcessActionHandler.class);
+
+  protected JSONObject doExecute(Map<String, Object> parameters, String content) {
+    try {
+      ImportEntryManager entryManager = WeldUtils
+          .getInstanceFromStaticBeanManager(ImportEntryManager.class);
+
+      entryManager.notifyNewImportEntryCreated();
+
+      JSONObject result = new JSONObject();
+      JSONObject msgTotal = new JSONObject();
+      JSONArray actions = new JSONArray();
+      msgTotal.put("msgType", "info");
+      msgTotal.put("msgTitle", "Import Process");
+      msgTotal.put("msgText", "Import process has been triggered");
+
+      JSONObject msgTotalAction = new JSONObject();
+      msgTotalAction.put("showMsgInProcessView", msgTotal);
+      actions.put(msgTotalAction);
+      result.put("responseActions", actions);
+
+      return result;
+    } catch (JSONException e) {
+      log.error("Error in process", e);
+      return new JSONObject();
+    }
+  }
+
+}