diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 52cfd8a41..247771ca4 100644 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -2600,34 +2600,91 @@ class workspaceTools CLI::logging("> Completed table LIST_PARTICIPATED_LAST\n"); } + /** + * This function overwrite the table LIST_PAUSED + * Get the principal information in the tables appDelay, appDelegation + * For the labels we use the tables user, process, task and application + * @return void + */ public function regenerateListPaused(){ - $delaycriteria = new Criteria("workflow"); - $delaycriteria->addSelectColumn(AppDelayPeer::APP_UID); - $delaycriteria->addSelectColumn(AppDelayPeer::PRO_UID); - $delaycriteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX); - $delaycriteria->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_DATE); - $delaycriteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER); - $delaycriteria->addSelectColumn(AppCacheViewPeer::USR_UID); - $delaycriteria->addSelectColumn(AppCacheViewPeer::APP_STATUS); - $delaycriteria->addSelectColumn(AppCacheViewPeer::TAS_UID); - $delaycriteria->addSelectColumn(AppCacheViewPeer::DEL_DELEGATE_DATE); - - $delaycriteria->addJoin( AppCacheViewPeer::APP_UID, AppDelayPeer::APP_UID . ' AND ' . AppCacheViewPeer::DEL_INDEX . ' = ' . AppDelayPeer::APP_DEL_INDEX, Criteria::INNER_JOIN ); - $delaycriteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, "0", CRITERIA::EQUAL); - $delaycriteria->add(AppDelayPeer::APP_TYPE, "PAUSE", CRITERIA::EQUAL); - $rsCriteria = AppDelayPeer::doSelectRS($delaycriteria); - $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); - - while ($rsCriteria->next()) { - $row = $rsCriteria->getRow(); - $data = $row; - $data["DEL_INDEX"] = $row["APP_DEL_INDEX"]; - $data["APP_RESTART_DATE"] = $row["APP_DISABLE_ACTION_DATE"]; - $listPaused = new ListPaused(); - $listPaused ->remove($row["APP_UID"],$row["APP_DEL_INDEX"],$data); - $listPaused->setDeleted(false); - $listPaused->create($data); - } + $this->initPropel(true); + $query = 'INSERT INTO '.$this->dbName.'.LIST_PAUSED + ( + APP_UID, + DEL_INDEX, + USR_UID, + TAS_UID, + PRO_UID, + APP_NUMBER, + APP_TITLE, + APP_PRO_TITLE, + APP_TAS_TITLE, + APP_PAUSED_DATE, + APP_RESTART_DATE, + DEL_PREVIOUS_USR_UID, + DEL_PREVIOUS_USR_USERNAME, + DEL_PREVIOUS_USR_FIRSTNAME, + DEL_PREVIOUS_USR_LASTNAME, + DEL_CURRENT_USR_USERNAME, + DEL_CURRENT_USR_FIRSTNAME, + DEL_CURRENT_USR_LASTNAME, + DEL_DELEGATE_DATE, + DEL_INIT_DATE, + DEL_DUE_DATE, + DEL_PRIORITY, + PRO_ID, + USR_ID, + TAS_ID + ) + SELECT + AD1.APP_UID, + AD1.DEL_INDEX, + AD1.USR_UID, + AD1.TAS_UID, + AD1.PRO_UID, + AD1.APP_NUMBER, + APPLICATION.APP_TITLE, + PROCESS.PRO_TITLE, + TASK.TAS_TITLE, + APP_DELAY.APP_ENABLE_ACTION_DATE AS APP_PAUSED_DATE , + APP_DELAY.APP_DISABLE_ACTION_DATE AS APP_RESTART_DATE, + AD2.USR_UID AS DEL_PREVIOUS_USR_UID, + PREVIOUS.USR_USERNAME AS DEL_PREVIOUS_USR_USERNAME, + PREVIOUS.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME, + PREVIOUS.USR_LASTNAME AS DEL_PREVIOUS_USR_LASTNAME, + USERS.USR_USERNAME AS DEL_CURRENT_USR_USERNAME, + USERS.USR_FIRSTNAME AS DEL_CURRENT_USR_FIRSTNAME, + USERS.USR_LASTNAME AS DEL_CURRENT_USR_LASTNAME, + AD1.DEL_DELEGATE_DATE AS DEL_DELEGATE_DATE, + AD1.DEL_INIT_DATE AS DEL_INIT_DATE, + AD1.DEL_TASK_DUE_DATE AS DEL_DUE_DATE, + AD1.DEL_PRIORITY AS DEL_PRIORITY, + PROCESS.PRO_ID, + USERS.USR_ID, + TASK.TAS_ID + FROM + '.$this->dbName.'.APP_DELAY + LEFT JOIN + '.$this->dbName.'.APP_DELEGATION AS AD1 ON (APP_DELAY.APP_NUMBER = AD1.APP_NUMBER AND AD1.DEL_INDEX = APP_DELAY.APP_DEL_INDEX) + LEFT JOIN + '.$this->dbName.'.APP_DELEGATION AS AD2 ON (AD1.APP_NUMBER = AD2.APP_NUMBER AND AD1.DEL_PREVIOUS = AD2.DEL_INDEX) + LEFT JOIN + '.$this->dbName.'.USERS ON (APP_DELAY.APP_DELEGATION_USR_ID = USERS.USR_ID) + LEFT JOIN + '.$this->dbName.'.USERS PREVIOUS ON (AD2.USR_ID = PREVIOUS.USR_ID) + LEFT JOIN + '.$this->dbName.'.APPLICATION ON (AD1.APP_NUMBER = APPLICATION.APP_NUMBER) + LEFT JOIN + '.$this->dbName.'.PROCESS ON (AD1.PRO_ID = PROCESS.PRO_ID) + LEFT JOIN + '.$this->dbName.'.TASK ON (AD1.TAS_ID = TASK.TAS_ID) + WHERE + APP_DELAY.APP_DISABLE_ACTION_USER = "0" AND + APP_DELAY.APP_TYPE = "PAUSE" + '; + $con = Propel::getConnection("workflow"); + $stmt = $con->createStatement(); + $stmt->executeQuery($query); CLI::logging("> Completed table LIST_PAUSED\n"); } @@ -3668,6 +3725,48 @@ class workspaceTools APP_STATUS_ID = 0"); $con->commit(); + // Populating APP_DELAY.USR_ID + CLI::logging("-> Populating APP_DELAY.USR_ID \n"); + $con->begin(); + $stmt = $con->createStatement(); + $rs = $stmt->executeQuery("UPDATE APP_DELAY AS AD + INNER JOIN ( + SELECT USERS.USR_UID, USERS.USR_ID + FROM USERS + ) AS USR + ON (AD.APP_DELEGATION_USER = USR.USR_UID) + SET AD.APP_DELEGATION_USR_ID = USR.USR_ID + WHERE AD.APP_DELEGATION_USR_ID = 0"); + $con->commit(); + + // Populating APP_DELAY.PRO_ID + CLI::logging("-> Populating APP_DELAY.PRO_ID \n"); + $con->begin(); + $stmt = $con->createStatement(); + $rs = $stmt->executeQuery("UPDATE APP_DELAY AS AD + INNER JOIN ( + SELECT PROCESS.PRO_UID, PROCESS.PRO_ID + FROM PROCESS + ) AS PRO + ON (AD.PRO_UID = PRO.PRO_UID) + SET AD.PRO_ID = PRO.PRO_ID + WHERE AD.PRO_ID = 0"); + $con->commit(); + + // Populating APP_DELAY.APP_NUMBER + CLI::logging("-> Populating APP_DELAY.APP_NUMBER \n"); + $con->begin(); + $stmt = $con->createStatement(); + $rs = $stmt->executeQuery("UPDATE APP_DELAY AS AD + INNER JOIN ( + SELECT APPLICATION.APP_UID, APPLICATION.APP_NUMBER + FROM APPLICATION + ) AS APP + ON (AD.APP_UID = APP.APP_UID) + SET AD.APP_NUMBER = APP.APP_NUMBER + WHERE AD.APP_NUMBER = 0"); + $con->commit(); + CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n"); // Populating PRO_ID, USR_ID diff --git a/workflow/engine/classes/model/map/AppDelayMapBuilder.php b/workflow/engine/classes/model/map/AppDelayMapBuilder.php index a30b96bcf..5584bd03a 100644 --- a/workflow/engine/classes/model/map/AppDelayMapBuilder.php +++ b/workflow/engine/classes/model/map/AppDelayMapBuilder.php @@ -71,6 +71,8 @@ class AppDelayMapBuilder $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); + $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null); + $tMap->addColumn('APP_THREAD_INDEX', 'AppThreadIndex', 'int', CreoleTypes::INTEGER, true, null); $tMap->addColumn('APP_DEL_INDEX', 'AppDelIndex', 'int', CreoleTypes::INTEGER, true, null); @@ -93,6 +95,10 @@ class AppDelayMapBuilder $tMap->addColumn('APP_AUTOMATIC_DISABLED_DATE', 'AppAutomaticDisabledDate', 'int', CreoleTypes::TIMESTAMP, false, null); + $tMap->addColumn('APP_DELEGATION_USR_ID', 'AppDelegationUsrId', 'int', CreoleTypes::INTEGER, false, null); + + $tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null); + } // doBuild() } // AppDelayMapBuilder diff --git a/workflow/engine/classes/model/om/BaseAppDelay.php b/workflow/engine/classes/model/om/BaseAppDelay.php index 3b8ba2e14..1957d235c 100644 --- a/workflow/engine/classes/model/om/BaseAppDelay.php +++ b/workflow/engine/classes/model/om/BaseAppDelay.php @@ -45,6 +45,12 @@ abstract class BaseAppDelay extends BaseObject implements Persistent */ protected $app_uid = '0'; + /** + * The value for the app_number field. + * @var int + */ + protected $app_number = 0; + /** * The value for the app_thread_index field. * @var int @@ -111,6 +117,18 @@ abstract class BaseAppDelay extends BaseObject implements Persistent */ protected $app_automatic_disabled_date; + /** + * The value for the app_delegation_usr_id field. + * @var int + */ + protected $app_delegation_usr_id = 0; + + /** + * The value for the pro_id field. + * @var int + */ + protected $pro_id = 0; + /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -158,6 +176,17 @@ abstract class BaseAppDelay extends BaseObject implements Persistent return $this->app_uid; } + /** + * Get the [app_number] column value. + * + * @return int + */ + public function getAppNumber() + { + + return $this->app_number; + } + /** * Get the [app_thread_index] column value. * @@ -342,6 +371,28 @@ abstract class BaseAppDelay extends BaseObject implements Persistent } } + /** + * Get the [app_delegation_usr_id] column value. + * + * @return int + */ + public function getAppDelegationUsrId() + { + + return $this->app_delegation_usr_id; + } + + /** + * Get the [pro_id] column value. + * + * @return int + */ + public function getProId() + { + + return $this->pro_id; + } + /** * Set the value of [app_delay_uid] column. * @@ -408,6 +459,28 @@ abstract class BaseAppDelay extends BaseObject implements Persistent } // setAppUid() + /** + * Set the value of [app_number] column. + * + * @param int $v new value + * @return void + */ + public function setAppNumber($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->app_number !== $v || $v === 0) { + $this->app_number = $v; + $this->modifiedColumns[] = AppDelayPeer::APP_NUMBER; + } + + } // setAppNumber() + /** * Set the value of [app_thread_index] column. * @@ -671,6 +744,50 @@ abstract class BaseAppDelay extends BaseObject implements Persistent } // setAppAutomaticDisabledDate() + /** + * Set the value of [app_delegation_usr_id] column. + * + * @param int $v new value + * @return void + */ + public function setAppDelegationUsrId($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->app_delegation_usr_id !== $v || $v === 0) { + $this->app_delegation_usr_id = $v; + $this->modifiedColumns[] = AppDelayPeer::APP_DELEGATION_USR_ID; + } + + } // setAppDelegationUsrId() + + /** + * Set the value of [pro_id] column. + * + * @param int $v new value + * @return void + */ + public function setProId($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->pro_id !== $v || $v === 0) { + $this->pro_id = $v; + $this->modifiedColumns[] = AppDelayPeer::PRO_ID; + } + + } // setProId() + /** * Hydrates (populates) the object variables with values from the database resultset. * @@ -694,34 +811,40 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $this->app_uid = $rs->getString($startcol + 2); - $this->app_thread_index = $rs->getInt($startcol + 3); + $this->app_number = $rs->getInt($startcol + 3); - $this->app_del_index = $rs->getInt($startcol + 4); + $this->app_thread_index = $rs->getInt($startcol + 4); - $this->app_type = $rs->getString($startcol + 5); + $this->app_del_index = $rs->getInt($startcol + 5); - $this->app_status = $rs->getString($startcol + 6); + $this->app_type = $rs->getString($startcol + 6); - $this->app_next_task = $rs->getString($startcol + 7); + $this->app_status = $rs->getString($startcol + 7); - $this->app_delegation_user = $rs->getString($startcol + 8); + $this->app_next_task = $rs->getString($startcol + 8); - $this->app_enable_action_user = $rs->getString($startcol + 9); + $this->app_delegation_user = $rs->getString($startcol + 9); - $this->app_enable_action_date = $rs->getTimestamp($startcol + 10, null); + $this->app_enable_action_user = $rs->getString($startcol + 10); - $this->app_disable_action_user = $rs->getString($startcol + 11); + $this->app_enable_action_date = $rs->getTimestamp($startcol + 11, null); - $this->app_disable_action_date = $rs->getTimestamp($startcol + 12, null); + $this->app_disable_action_user = $rs->getString($startcol + 12); - $this->app_automatic_disabled_date = $rs->getTimestamp($startcol + 13, null); + $this->app_disable_action_date = $rs->getTimestamp($startcol + 13, null); + + $this->app_automatic_disabled_date = $rs->getTimestamp($startcol + 14, null); + + $this->app_delegation_usr_id = $rs->getInt($startcol + 15); + + $this->pro_id = $rs->getInt($startcol + 16); $this->resetModified(); $this->setNew(false); // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 14; // 14 = AppDelayPeer::NUM_COLUMNS - AppDelayPeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 17; // 17 = AppDelayPeer::NUM_COLUMNS - AppDelayPeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating AppDelay object", $e); @@ -935,38 +1058,47 @@ abstract class BaseAppDelay extends BaseObject implements Persistent return $this->getAppUid(); break; case 3: - return $this->getAppThreadIndex(); + return $this->getAppNumber(); break; case 4: - return $this->getAppDelIndex(); + return $this->getAppThreadIndex(); break; case 5: - return $this->getAppType(); + return $this->getAppDelIndex(); break; case 6: - return $this->getAppStatus(); + return $this->getAppType(); break; case 7: - return $this->getAppNextTask(); + return $this->getAppStatus(); break; case 8: - return $this->getAppDelegationUser(); + return $this->getAppNextTask(); break; case 9: - return $this->getAppEnableActionUser(); + return $this->getAppDelegationUser(); break; case 10: - return $this->getAppEnableActionDate(); + return $this->getAppEnableActionUser(); break; case 11: - return $this->getAppDisableActionUser(); + return $this->getAppEnableActionDate(); break; case 12: - return $this->getAppDisableActionDate(); + return $this->getAppDisableActionUser(); break; case 13: + return $this->getAppDisableActionDate(); + break; + case 14: return $this->getAppAutomaticDisabledDate(); break; + case 15: + return $this->getAppDelegationUsrId(); + break; + case 16: + return $this->getProId(); + break; default: return null; break; @@ -990,17 +1122,20 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $keys[0] => $this->getAppDelayUid(), $keys[1] => $this->getProUid(), $keys[2] => $this->getAppUid(), - $keys[3] => $this->getAppThreadIndex(), - $keys[4] => $this->getAppDelIndex(), - $keys[5] => $this->getAppType(), - $keys[6] => $this->getAppStatus(), - $keys[7] => $this->getAppNextTask(), - $keys[8] => $this->getAppDelegationUser(), - $keys[9] => $this->getAppEnableActionUser(), - $keys[10] => $this->getAppEnableActionDate(), - $keys[11] => $this->getAppDisableActionUser(), - $keys[12] => $this->getAppDisableActionDate(), - $keys[13] => $this->getAppAutomaticDisabledDate(), + $keys[3] => $this->getAppNumber(), + $keys[4] => $this->getAppThreadIndex(), + $keys[5] => $this->getAppDelIndex(), + $keys[6] => $this->getAppType(), + $keys[7] => $this->getAppStatus(), + $keys[8] => $this->getAppNextTask(), + $keys[9] => $this->getAppDelegationUser(), + $keys[10] => $this->getAppEnableActionUser(), + $keys[11] => $this->getAppEnableActionDate(), + $keys[12] => $this->getAppDisableActionUser(), + $keys[13] => $this->getAppDisableActionDate(), + $keys[14] => $this->getAppAutomaticDisabledDate(), + $keys[15] => $this->getAppDelegationUsrId(), + $keys[16] => $this->getProId(), ); return $result; } @@ -1042,38 +1177,47 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $this->setAppUid($value); break; case 3: - $this->setAppThreadIndex($value); + $this->setAppNumber($value); break; case 4: - $this->setAppDelIndex($value); + $this->setAppThreadIndex($value); break; case 5: - $this->setAppType($value); + $this->setAppDelIndex($value); break; case 6: - $this->setAppStatus($value); + $this->setAppType($value); break; case 7: - $this->setAppNextTask($value); + $this->setAppStatus($value); break; case 8: - $this->setAppDelegationUser($value); + $this->setAppNextTask($value); break; case 9: - $this->setAppEnableActionUser($value); + $this->setAppDelegationUser($value); break; case 10: - $this->setAppEnableActionDate($value); + $this->setAppEnableActionUser($value); break; case 11: - $this->setAppDisableActionUser($value); + $this->setAppEnableActionDate($value); break; case 12: - $this->setAppDisableActionDate($value); + $this->setAppDisableActionUser($value); break; case 13: + $this->setAppDisableActionDate($value); + break; + case 14: $this->setAppAutomaticDisabledDate($value); break; + case 15: + $this->setAppDelegationUsrId($value); + break; + case 16: + $this->setProId($value); + break; } // switch() } @@ -1110,47 +1254,59 @@ abstract class BaseAppDelay extends BaseObject implements Persistent } if (array_key_exists($keys[3], $arr)) { - $this->setAppThreadIndex($arr[$keys[3]]); + $this->setAppNumber($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { - $this->setAppDelIndex($arr[$keys[4]]); + $this->setAppThreadIndex($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { - $this->setAppType($arr[$keys[5]]); + $this->setAppDelIndex($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { - $this->setAppStatus($arr[$keys[6]]); + $this->setAppType($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { - $this->setAppNextTask($arr[$keys[7]]); + $this->setAppStatus($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { - $this->setAppDelegationUser($arr[$keys[8]]); + $this->setAppNextTask($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { - $this->setAppEnableActionUser($arr[$keys[9]]); + $this->setAppDelegationUser($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { - $this->setAppEnableActionDate($arr[$keys[10]]); + $this->setAppEnableActionUser($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { - $this->setAppDisableActionUser($arr[$keys[11]]); + $this->setAppEnableActionDate($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { - $this->setAppDisableActionDate($arr[$keys[12]]); + $this->setAppDisableActionUser($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { - $this->setAppAutomaticDisabledDate($arr[$keys[13]]); + $this->setAppDisableActionDate($arr[$keys[13]]); + } + + if (array_key_exists($keys[14], $arr)) { + $this->setAppAutomaticDisabledDate($arr[$keys[14]]); + } + + if (array_key_exists($keys[15], $arr)) { + $this->setAppDelegationUsrId($arr[$keys[15]]); + } + + if (array_key_exists($keys[16], $arr)) { + $this->setProId($arr[$keys[16]]); } } @@ -1176,6 +1332,10 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $criteria->add(AppDelayPeer::APP_UID, $this->app_uid); } + if ($this->isColumnModified(AppDelayPeer::APP_NUMBER)) { + $criteria->add(AppDelayPeer::APP_NUMBER, $this->app_number); + } + if ($this->isColumnModified(AppDelayPeer::APP_THREAD_INDEX)) { $criteria->add(AppDelayPeer::APP_THREAD_INDEX, $this->app_thread_index); } @@ -1220,6 +1380,14 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $criteria->add(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, $this->app_automatic_disabled_date); } + if ($this->isColumnModified(AppDelayPeer::APP_DELEGATION_USR_ID)) { + $criteria->add(AppDelayPeer::APP_DELEGATION_USR_ID, $this->app_delegation_usr_id); + } + + if ($this->isColumnModified(AppDelayPeer::PRO_ID)) { + $criteria->add(AppDelayPeer::PRO_ID, $this->pro_id); + } + return $criteria; } @@ -1278,6 +1446,8 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $copyObj->setAppUid($this->app_uid); + $copyObj->setAppNumber($this->app_number); + $copyObj->setAppThreadIndex($this->app_thread_index); $copyObj->setAppDelIndex($this->app_del_index); @@ -1300,6 +1470,10 @@ abstract class BaseAppDelay extends BaseObject implements Persistent $copyObj->setAppAutomaticDisabledDate($this->app_automatic_disabled_date); + $copyObj->setAppDelegationUsrId($this->app_delegation_usr_id); + + $copyObj->setProId($this->pro_id); + $copyObj->setNew(true); diff --git a/workflow/engine/classes/model/om/BaseAppDelayPeer.php b/workflow/engine/classes/model/om/BaseAppDelayPeer.php index 1d12e7b6c..887bafeda 100644 --- a/workflow/engine/classes/model/om/BaseAppDelayPeer.php +++ b/workflow/engine/classes/model/om/BaseAppDelayPeer.php @@ -25,7 +25,7 @@ abstract class BaseAppDelayPeer const CLASS_DEFAULT = 'classes.model.AppDelay'; /** The total number of columns. */ - const NUM_COLUMNS = 14; + const NUM_COLUMNS = 17; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -40,6 +40,9 @@ abstract class BaseAppDelayPeer /** the column name for the APP_UID field */ const APP_UID = 'APP_DELAY.APP_UID'; + /** the column name for the APP_NUMBER field */ + const APP_NUMBER = 'APP_DELAY.APP_NUMBER'; + /** the column name for the APP_THREAD_INDEX field */ const APP_THREAD_INDEX = 'APP_DELAY.APP_THREAD_INDEX'; @@ -73,6 +76,12 @@ abstract class BaseAppDelayPeer /** the column name for the APP_AUTOMATIC_DISABLED_DATE field */ const APP_AUTOMATIC_DISABLED_DATE = 'APP_DELAY.APP_AUTOMATIC_DISABLED_DATE'; + /** the column name for the APP_DELEGATION_USR_ID field */ + const APP_DELEGATION_USR_ID = 'APP_DELAY.APP_DELEGATION_USR_ID'; + + /** the column name for the PRO_ID field */ + const PRO_ID = 'APP_DELAY.PRO_ID'; + /** The PHP to DB Name Mapping */ private static $phpNameMap = null; @@ -84,10 +93,10 @@ abstract class BaseAppDelayPeer * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('AppDelayUid', 'ProUid', 'AppUid', 'AppThreadIndex', 'AppDelIndex', 'AppType', 'AppStatus', 'AppNextTask', 'AppDelegationUser', 'AppEnableActionUser', 'AppEnableActionDate', 'AppDisableActionUser', 'AppDisableActionDate', 'AppAutomaticDisabledDate', ), - BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID, AppDelayPeer::PRO_UID, AppDelayPeer::APP_UID, AppDelayPeer::APP_THREAD_INDEX, AppDelayPeer::APP_DEL_INDEX, AppDelayPeer::APP_TYPE, AppDelayPeer::APP_STATUS, AppDelayPeer::APP_NEXT_TASK, AppDelayPeer::APP_DELEGATION_USER, AppDelayPeer::APP_ENABLE_ACTION_USER, AppDelayPeer::APP_ENABLE_ACTION_DATE, AppDelayPeer::APP_DISABLE_ACTION_USER, AppDelayPeer::APP_DISABLE_ACTION_DATE, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, ), - BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID', 'PRO_UID', 'APP_UID', 'APP_THREAD_INDEX', 'APP_DEL_INDEX', 'APP_TYPE', 'APP_STATUS', 'APP_NEXT_TASK', 'APP_DELEGATION_USER', 'APP_ENABLE_ACTION_USER', 'APP_ENABLE_ACTION_DATE', 'APP_DISABLE_ACTION_USER', 'APP_DISABLE_ACTION_DATE', 'APP_AUTOMATIC_DISABLED_DATE', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) + BasePeer::TYPE_PHPNAME => array ('AppDelayUid', 'ProUid', 'AppUid', 'AppNumber', 'AppThreadIndex', 'AppDelIndex', 'AppType', 'AppStatus', 'AppNextTask', 'AppDelegationUser', 'AppEnableActionUser', 'AppEnableActionDate', 'AppDisableActionUser', 'AppDisableActionDate', 'AppAutomaticDisabledDate', 'AppDelegationUsrId', 'ProId', ), + BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID, AppDelayPeer::PRO_UID, AppDelayPeer::APP_UID, AppDelayPeer::APP_NUMBER, AppDelayPeer::APP_THREAD_INDEX, AppDelayPeer::APP_DEL_INDEX, AppDelayPeer::APP_TYPE, AppDelayPeer::APP_STATUS, AppDelayPeer::APP_NEXT_TASK, AppDelayPeer::APP_DELEGATION_USER, AppDelayPeer::APP_ENABLE_ACTION_USER, AppDelayPeer::APP_ENABLE_ACTION_DATE, AppDelayPeer::APP_DISABLE_ACTION_USER, AppDelayPeer::APP_DISABLE_ACTION_DATE, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, AppDelayPeer::APP_DELEGATION_USR_ID, AppDelayPeer::PRO_ID, ), + BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID', 'PRO_UID', 'APP_UID', 'APP_NUMBER', 'APP_THREAD_INDEX', 'APP_DEL_INDEX', 'APP_TYPE', 'APP_STATUS', 'APP_NEXT_TASK', 'APP_DELEGATION_USER', 'APP_ENABLE_ACTION_USER', 'APP_ENABLE_ACTION_DATE', 'APP_DISABLE_ACTION_USER', 'APP_DISABLE_ACTION_DATE', 'APP_AUTOMATIC_DISABLED_DATE', 'APP_DELEGATION_USR_ID', 'PRO_ID', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ) ); /** @@ -97,10 +106,10 @@ abstract class BaseAppDelayPeer * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('AppDelayUid' => 0, 'ProUid' => 1, 'AppUid' => 2, 'AppThreadIndex' => 3, 'AppDelIndex' => 4, 'AppType' => 5, 'AppStatus' => 6, 'AppNextTask' => 7, 'AppDelegationUser' => 8, 'AppEnableActionUser' => 9, 'AppEnableActionDate' => 10, 'AppDisableActionUser' => 11, 'AppDisableActionDate' => 12, 'AppAutomaticDisabledDate' => 13, ), - BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID => 0, AppDelayPeer::PRO_UID => 1, AppDelayPeer::APP_UID => 2, AppDelayPeer::APP_THREAD_INDEX => 3, AppDelayPeer::APP_DEL_INDEX => 4, AppDelayPeer::APP_TYPE => 5, AppDelayPeer::APP_STATUS => 6, AppDelayPeer::APP_NEXT_TASK => 7, AppDelayPeer::APP_DELEGATION_USER => 8, AppDelayPeer::APP_ENABLE_ACTION_USER => 9, AppDelayPeer::APP_ENABLE_ACTION_DATE => 10, AppDelayPeer::APP_DISABLE_ACTION_USER => 11, AppDelayPeer::APP_DISABLE_ACTION_DATE => 12, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE => 13, ), - BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID' => 0, 'PRO_UID' => 1, 'APP_UID' => 2, 'APP_THREAD_INDEX' => 3, 'APP_DEL_INDEX' => 4, 'APP_TYPE' => 5, 'APP_STATUS' => 6, 'APP_NEXT_TASK' => 7, 'APP_DELEGATION_USER' => 8, 'APP_ENABLE_ACTION_USER' => 9, 'APP_ENABLE_ACTION_DATE' => 10, 'APP_DISABLE_ACTION_USER' => 11, 'APP_DISABLE_ACTION_DATE' => 12, 'APP_AUTOMATIC_DISABLED_DATE' => 13, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) + BasePeer::TYPE_PHPNAME => array ('AppDelayUid' => 0, 'ProUid' => 1, 'AppUid' => 2, 'AppNumber' => 3, 'AppThreadIndex' => 4, 'AppDelIndex' => 5, 'AppType' => 6, 'AppStatus' => 7, 'AppNextTask' => 8, 'AppDelegationUser' => 9, 'AppEnableActionUser' => 10, 'AppEnableActionDate' => 11, 'AppDisableActionUser' => 12, 'AppDisableActionDate' => 13, 'AppAutomaticDisabledDate' => 14, 'AppDelegationUsrId' => 15, 'ProId' => 16, ), + BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID => 0, AppDelayPeer::PRO_UID => 1, AppDelayPeer::APP_UID => 2, AppDelayPeer::APP_NUMBER => 3, AppDelayPeer::APP_THREAD_INDEX => 4, AppDelayPeer::APP_DEL_INDEX => 5, AppDelayPeer::APP_TYPE => 6, AppDelayPeer::APP_STATUS => 7, AppDelayPeer::APP_NEXT_TASK => 8, AppDelayPeer::APP_DELEGATION_USER => 9, AppDelayPeer::APP_ENABLE_ACTION_USER => 10, AppDelayPeer::APP_ENABLE_ACTION_DATE => 11, AppDelayPeer::APP_DISABLE_ACTION_USER => 12, AppDelayPeer::APP_DISABLE_ACTION_DATE => 13, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE => 14, AppDelayPeer::APP_DELEGATION_USR_ID => 15, AppDelayPeer::PRO_ID => 16, ), + BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID' => 0, 'PRO_UID' => 1, 'APP_UID' => 2, 'APP_NUMBER' => 3, 'APP_THREAD_INDEX' => 4, 'APP_DEL_INDEX' => 5, 'APP_TYPE' => 6, 'APP_STATUS' => 7, 'APP_NEXT_TASK' => 8, 'APP_DELEGATION_USER' => 9, 'APP_ENABLE_ACTION_USER' => 10, 'APP_ENABLE_ACTION_DATE' => 11, 'APP_DISABLE_ACTION_USER' => 12, 'APP_DISABLE_ACTION_DATE' => 13, 'APP_AUTOMATIC_DISABLED_DATE' => 14, 'APP_DELEGATION_USR_ID' => 15, 'PRO_ID' => 16, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ) ); /** @@ -207,6 +216,8 @@ abstract class BaseAppDelayPeer $criteria->addSelectColumn(AppDelayPeer::APP_UID); + $criteria->addSelectColumn(AppDelayPeer::APP_NUMBER); + $criteria->addSelectColumn(AppDelayPeer::APP_THREAD_INDEX); $criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX); @@ -229,6 +240,10 @@ abstract class BaseAppDelayPeer $criteria->addSelectColumn(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE); + $criteria->addSelectColumn(AppDelayPeer::APP_DELEGATION_USR_ID); + + $criteria->addSelectColumn(AppDelayPeer::PRO_ID); + } const COUNT = 'COUNT(APP_DELAY.APP_DELAY_UID)'; diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index 07c3b44d4..7fd1547d8 100644 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -1689,6 +1689,7 @@ + @@ -1700,6 +1701,17 @@ + + + + + + + + + + + diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index d3b7af603..3d2a47cbe 100644 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -828,6 +828,7 @@ CREATE TABLE `APP_DELAY` `APP_DELAY_UID` VARCHAR(32) default '' NOT NULL, `PRO_UID` VARCHAR(32) default '0' NOT NULL, `APP_UID` VARCHAR(32) default '0' NOT NULL, + `APP_NUMBER` INTEGER default 0, `APP_THREAD_INDEX` INTEGER default 0 NOT NULL, `APP_DEL_INDEX` INTEGER default 0 NOT NULL, `APP_TYPE` VARCHAR(20) default '0' NOT NULL, @@ -839,7 +840,12 @@ CREATE TABLE `APP_DELAY` `APP_DISABLE_ACTION_USER` VARCHAR(32) default '0', `APP_DISABLE_ACTION_DATE` DATETIME, `APP_AUTOMATIC_DISABLED_DATE` DATETIME, + `APP_DELEGATION_USR_ID` INTEGER default 0, + `PRO_ID` INTEGER default 0, PRIMARY KEY (`APP_DELAY_UID`), + KEY `INDEX_APP_NUMBER`(`APP_NUMBER`), + KEY `INDEX_USR_ID`(`APP_DELEGATION_USR_ID`), + KEY `INDEX_PRO_ID`(`PRO_ID`), KEY `indexAppDelay`(`PRO_UID`, `APP_UID`, `APP_THREAD_INDEX`, `APP_DEL_INDEX`, `APP_NEXT_TASK`, `APP_DELEGATION_USER`, `APP_DISABLE_ACTION_USER`), KEY `indexAppUid`(`APP_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='APP_DELAY';