update
This commit is contained in:
hjonathan
2017-08-08 08:35:43 -04:00
parent 901b826b9e
commit d861a22244
3 changed files with 10 additions and 6 deletions

View File

@@ -1894,6 +1894,11 @@ class Task
}
}
/**
* This method verify if an activity has cases
* @param $data
* @return \stdclass
*/
public function hasPendingCases($data)
{
$paused = false;

View File

@@ -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) {

View File

@@ -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);