Solving conflicts merginf with last merge in develop branch

This commit is contained in:
Julio Cesar Laura Avendaño
2020-11-25 13:18:20 +00:00
34 changed files with 2288 additions and 680 deletions

View File

@@ -365,6 +365,11 @@ class WorkspaceTools
$start = microtime(true);
$this->updateTriggers(true, $lang);
CLI::logging("* End updating MySQL triggers...(" . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start adding +async option to scheduler commands...\n");
$start = microtime(true);
$this->addAsyncOptionToSchedulerCommands(true);
CLI::logging("* End adding +async option to scheduler commands...(Completed on " . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start Converting Web Entries v1.0 to v2.0 for BPMN processes...\n");
$start = microtime(true);
@@ -2218,6 +2223,11 @@ class WorkspaceTools
$workspace->updateTriggers(true, $lang);
CLI::logging("* End updating MySQL triggers...(" . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start adding +async option to scheduler commands...\n");
$start = microtime(true);
$workspace->addAsyncOptionToSchedulerCommands(false);
CLI::logging("* End adding +async option to scheduler commands...(Completed on " . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start Converting Web Entries v1.0 to v2.0 for BPMN processes...\n");
$start = microtime(true);
Bootstrap::setConstantsRelatedWs($workspace);
@@ -5084,4 +5094,37 @@ class WorkspaceTools
$database = $this->getDatabase($rbac);
$database->executeQuery($query, true);
}
/**
* Add +async option to scheduler commands in table SCHEDULER.
* @param boolean $force
*/
public function addAsyncOptionToSchedulerCommands($force = false)
{
//read update status
$this->initPropel(true);
$conf = new Configurations();
$exist = $conf->exists('ADDED_ASYNC_OPTION_TO_SCHEDULER', 'scheduler');
if ($exist === true && $force === false) {
$config = (object) $conf->load('ADDED_ASYNC_OPTION_TO_SCHEDULER', 'scheduler');
if ($config->updated) {
CLI::logging("-> This was previously updated.\n");
return;
}
}
//update process
$updateQuery = ""
. "UPDATE {$this->dbName}.SCHEDULER SET body = REPLACE(body, '+force\"', '+force +async\"') "
. "WHERE body NOT LIKE '%+async%'"
. "";
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
$stmt->executeQuery($updateQuery);
CLI::logging("-> Adding +async option to scheduler commands in table {$this->dbName}.SCHEDULER\n");
//save update status
$conf->aConfig = ['updated' => true];
$conf->saveConfig('ADDED_ASYNC_OPTION_TO_SCHEDULER', 'scheduler');
}
}

View File

@@ -302,6 +302,9 @@ class PMScript
case 'SCRIPT_TASK':
$executedOn = self::SCRIPT_TASK;
break;
case 'SELF_SERVICE_TIMEOUT':
$executedOn = self::SELF_SERVICE_TIMEOUT;
break;
default:
$executedOn = self::UNDEFINED_ORIGIN;
break;

View File

@@ -67,7 +67,7 @@ class AppTimeoutActionExecutedMapBuilder
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('EXECUTION_DATE', 'ExecutionDate', 'int', CreoleTypes::TIMESTAMP, false, null);

View File

@@ -565,28 +565,40 @@ abstract class BaseAppTimeoutActionExecuted extends BaseObject implements Persis
$criteria = new Criteria(AppTimeoutActionExecutedPeer::DATABASE_NAME);
$criteria->add(AppTimeoutActionExecutedPeer::APP_UID, $this->app_uid);
$criteria->add(AppTimeoutActionExecutedPeer::DEL_INDEX, $this->del_index);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return string
* Returns the composite primary key for this object.
* The array elements will be in same order as specified in XML.
* @return array
*/
public function getPrimaryKey()
{
return $this->getAppUid();
$pks = array();
$pks[0] = $this->getAppUid();
$pks[1] = $this->getDelIndex();
return $pks;
}
/**
* Generic method to set the primary key (app_uid column).
* Set the [composite] primary key.
*
* @param string $key Primary key.
* @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void
*/
public function setPrimaryKey($key)
public function setPrimaryKey($keys)
{
$this->setAppUid($key);
$this->setAppUid($keys[0]);
$this->setDelIndex($keys[1]);
}
/**
@@ -602,8 +614,6 @@ abstract class BaseAppTimeoutActionExecuted extends BaseObject implements Persis
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setDelIndex($this->del_index);
$copyObj->setExecutionDate($this->execution_date);
@@ -611,6 +621,8 @@ abstract class BaseAppTimeoutActionExecuted extends BaseObject implements Persis
$copyObj->setAppUid(''); // this is a pkey column, so set to default value
$copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
}
/**

View File

@@ -389,6 +389,9 @@ abstract class BaseAppTimeoutActionExecutedPeer
$comparison = $criteria->getComparison(AppTimeoutActionExecutedPeer::APP_UID);
$selectCriteria->add(AppTimeoutActionExecutedPeer::APP_UID, $criteria->remove(AppTimeoutActionExecutedPeer::APP_UID), $comparison);
$comparison = $criteria->getComparison(AppTimeoutActionExecutedPeer::DEL_INDEX);
$selectCriteria->add(AppTimeoutActionExecutedPeer::DEL_INDEX, $criteria->remove(AppTimeoutActionExecutedPeer::DEL_INDEX), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
@@ -450,7 +453,22 @@ abstract class BaseAppTimeoutActionExecutedPeer
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(AppTimeoutActionExecutedPeer::APP_UID, (array) $values, Criteria::IN);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach ($values as $value) {
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(AppTimeoutActionExecutedPeer::APP_UID, $vals[0], Criteria::IN);
$criteria->add(AppTimeoutActionExecutedPeer::DEL_INDEX, $vals[1], Criteria::IN);
}
// Set the correct dbName
@@ -510,51 +528,23 @@ abstract class BaseAppTimeoutActionExecutedPeer
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* Retrieve object using using composite pkey values.
* @param string $app_uid
* @param int $del_index
* @param Connection $con
* @return AppTimeoutActionExecuted
*/
public static function retrieveByPK($pk, $con = null)
public static function retrieveByPK($app_uid, $del_index, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(AppTimeoutActionExecutedPeer::DATABASE_NAME);
$criteria->add(AppTimeoutActionExecutedPeer::APP_UID, $pk);
$criteria = new Criteria();
$criteria->add(AppTimeoutActionExecutedPeer::APP_UID, $app_uid);
$criteria->add(AppTimeoutActionExecutedPeer::DEL_INDEX, $del_index);
$v = AppTimeoutActionExecutedPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(AppTimeoutActionExecutedPeer::APP_UID, $pks, Criteria::IN);
$objs = AppTimeoutActionExecutedPeer::doSelect($criteria, $con);
}
return $objs;
return !empty($v) ? $v[0] : null;
}
}