This commit is contained in:
Paula Quispe
2018-08-02 08:00:09 -04:00
parent 47e49c8829
commit fa9cf69a54
3 changed files with 17 additions and 45 deletions

View File

@@ -151,21 +151,6 @@ EOT
CLI::taskOpt("workspace", "Select the workspace whose case folders will be migrated, if multiple workspaces are present in the server.\n Ex: -wworkflow. Ex: --workspace=workflow", "w:", "workspace="); CLI::taskOpt("workspace", "Select the workspace whose case folders will be migrated, if multiple workspaces are present in the server.\n Ex: -wworkflow. Ex: --workspace=workflow", "w:", "workspace=");
CLI::taskRun("runStructureDirectories"); CLI::taskRun("runStructureDirectories");
CLI::taskName("database-generate-self-service-by-value");
CLI::taskDescription(<<<EOT
Generate or upgrade the table "self-service by value".
This command populates the table "self-service by value" for cases whose
task is defined with "Self Service Value Based Assignment" in "Assignment
Rules".
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
EOT
);
CLI::taskArg("workspace-name", true, true);
CLI::taskRun("run_database_generate_self_service_by_value");
CLI::taskName('database-verify-consistency'); CLI::taskName('database-verify-consistency');
CLI::taskDescription(<<<EOT CLI::taskDescription(<<<EOT
Verify that the database data is consistent so any database-upgrade operation will be executed flawlessly. Verify that the database data is consistent so any database-upgrade operation will be executed flawlessly.
@@ -931,33 +916,6 @@ function runStructureDirectories($command, $args)
} }
} }
function run_database_generate_self_service_by_value($args, $opts)
{
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
try {
$arrayWorkspace = get_workspaces_from_args($args);
foreach ($arrayWorkspace as $value) {
$workspace = $value;
try {
G::outRes("Generating the table \"self-service by value\" for " . pakeColor::colorize($workspace->name, "INFO") . "\n");
$workspace->appAssignSelfServiceValueTableGenerateData();
} catch (Exception $e) {
G::outRes("Errors generating the table \"self-service by value\" of workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
}
echo "\n";
}
echo "Done!\n";
} catch (Exception $e) {
G::outRes(CLI::error($e->getMessage()) . "\n");
}
}
function run_database_verify_consistency($args, $opts) function run_database_verify_consistency($args, $opts)
{ {
verifyAppCacheConsistency($args); verifyAppCacheConsistency($args);

View File

@@ -2319,7 +2319,10 @@ class WorkspaceTools
/** /**
* Generate data for table APP_ASSIGN_SELF_SERVICE_VALUE * Generate data for table APP_ASSIGN_SELF_SERVICE_VALUE
* *
* return void * @return void
* @throws Exception
*
* @deprecated Method deprecated in Release 3.3.0
*/ */
public function appAssignSelfServiceValueTableGenerateData() public function appAssignSelfServiceValueTableGenerateData()
{ {

View File

@@ -94,7 +94,10 @@ class AppAssignSelfServiceValue extends BaseAppAssignSelfServiceValue
/** /**
* Generate data * Generate data
* *
* return void * @return void
* @throws Exception
*
* @deprecated Method deprecated in Release 3.3.0
*/ */
public function generateData() public function generateData()
{ {
@@ -133,7 +136,15 @@ class AppAssignSelfServiceValue extends BaseAppAssignSelfServiceValue
$dataVariable = (is_array($dataVariable))? $dataVariable : trim($dataVariable); $dataVariable = (is_array($dataVariable))? $dataVariable : trim($dataVariable);
if (!empty($dataVariable)) { if (!empty($dataVariable)) {
$this->create($row["APP_UID"], $row["DEL_INDEX"], array("PRO_UID" => $row["PRO_UID"], "TAS_UID" => $row["TAS_UID"], "GRP_UID" => serialize($dataVariable))); $this->create(
$row["APP_UID"],
$row["DEL_INDEX"],
[
"PRO_UID" => $row["PRO_UID"],
"TAS_UID" => $row["TAS_UID"],
"GRP_UID" => serialize($dataVariable)
]
);
} }
} }
} }