27 include_once(__DIR__ .
"/../../lib/php/common-job.php");
59 public function rerunBulkAndDeciderOnUpload($uploadId, $groupId, $userId, $bulkId, $dependency)
64 $uploadDao =
$GLOBALS[
'container']->get(
'dao.upload');
65 $topItem = $uploadDao->getUploadParent($uploadId);
70 $dependecies = array();
71 $sql =
"INSERT INTO license_ref_bulk (user_fk,group_fk,rf_text,upload_fk,uploadtree_fk) " 72 .
"SELECT $1 AS user_fk, $2 AS group_fk,rf_text,$3 AS upload_fk, $4 as uploadtree_fk 73 FROM license_ref_bulk WHERE lrb_pk=$5 RETURNING lrb_pk, $5 as lrb_origin";
74 $sqlLic =
"INSERT INTO license_set_bulk (lrb_fk, rf_fk, removing, comment, reportinfo, acknowledgement) " 75 .
"SELECT $1 as lrb_fk, rf_fk, removing, comment, reportinfo, acknowledgement FROM license_set_bulk WHERE lrb_fk=$2";
76 $this->
dbManager->prepare($stmt=__METHOD__.
'cloneBulk', $sql);
77 $this->
dbManager->prepare($stmtLic=__METHOD__.
'cloneBulkLic', $sqlLic);
78 $res = $this->
dbManager->execute($stmt,array($userId,$groupId,$uploadId,$topItem, $bulkId));
79 $row = $this->
dbManager->fetchArray($res);
81 $resLic = $this->
dbManager->execute($stmtLic,array($row[
'lrb_pk'],$row[
'lrb_origin']));
83 $upload = $uploadDao->getUpload($uploadId);
84 $uploadName = $upload->getFilename();
85 $job_pk = \JobAddJob($userId, $groupId, $uploadName, $uploadId);
86 $dependecies = array(array(
'name' =>
'agent_monk_bulk',
'args' => $row[
'lrb_pk']));
88 $jqId =
$deciderPlugin->AgentAdd($job_pk, $uploadId, $errorMsg, $dependecies);
90 if (!empty($errorMsg)) {
91 throw new Exception(str_replace(
'<br>',
"\n", $errorMsg));
__construct()
Get Database Manager from containers.
Namespace for decider agent.
plugin_find($x)
Mock function to get decider plugin required by BulkReuser.
$GLOBALS['xyyzzzDeciderJob']
fo_dbManager * dbManager
fo_dbManager object
Prepares bulk licenses for an upload and run DeciderJob on it.