HOR-3282
update
This commit is contained in:
@@ -1894,6 +1894,11 @@ class Task
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method verify if an activity has cases
|
||||
* @param $data
|
||||
* @return \stdclass
|
||||
*/
|
||||
public function hasPendingCases($data)
|
||||
{
|
||||
$paused = false;
|
||||
|
||||
@@ -31,7 +31,8 @@ use \BpmnLanePeer as LanePeer;
|
||||
use \BasePeer;
|
||||
use \Criteria as Criteria;
|
||||
use \ResultSet as ResultSet;
|
||||
|
||||
use \BpmnFlow;
|
||||
use \G;
|
||||
use ProcessMaker\Util\Common;
|
||||
use ProcessMaker\Exception;
|
||||
|
||||
@@ -430,10 +431,10 @@ class Bpmn extends Handler
|
||||
$activity = ActivityPeer::retrieveByPK($actUid);
|
||||
if (isset($activity)) {
|
||||
$activity->delete();
|
||||
\BpmnFlow::removeAllRelated($actUid);
|
||||
BpmnFlow::removeAllRelated($actUid);
|
||||
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ACTIVITY_DOES_NOT_EXIST", array("act_uid", $actUid)));
|
||||
throw new \Exception(G::LoadTranslation("ID_ACTIVITY_DOES_NOT_EXIST", array("act_uid", $actUid)));
|
||||
}
|
||||
self::log("Remove Activity Success!");
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -139,8 +139,6 @@ class Activity extends Api
|
||||
* This method remove an activity and all related components
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $act_uid {@min 32} {@max 32}
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return array
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
@@ -154,7 +152,7 @@ class Activity extends Api
|
||||
$task->setArrayParamException(array("taskUid" => "act_uid"));
|
||||
|
||||
$response = $task->hasPendingCases(array("act_uid" => $act_uid, "case_type" => "assigned"));
|
||||
if ($response->result != false) {
|
||||
if ($response->result !== false) {
|
||||
$project = new \ProcessMaker\Project\Adapter\BpmnWorkflow();
|
||||
$prj = $project->load($prj_uid);
|
||||
$prj->removeActivity($act_uid);
|
||||
|
||||
Reference in New Issue
Block a user