Entpoint /project: enabling update/new activities for PUT method

This commit is contained in:
Erik Amaru Ortiz
2014-02-06 11:29:45 -04:00
parent e4bacb3ce6
commit 187ad19c84
2 changed files with 30 additions and 4 deletions

View File

@@ -206,8 +206,8 @@ class Bpmn extends Handler
public function addActivity($data)
{
if (empty($this->diagram)) {
throw new \Exception("Error: There is not an initialized diagram.");
if (! ($process = $this->getProcess("object"))) {
throw new \Exception(sprintf("Error: There is not an initialized diagram for Project with prj_uid: %s.", $this->getUid()));
}
// setting defaults
@@ -215,8 +215,8 @@ class Bpmn extends Handler
$activity = new Activity();
$activity->fromArray($data);
$activity->setPrjUid($this->project->getPrjUid());
$activity->setProUid($this->getProcess("object")->getProUid());
$activity->setPrjUid($this->getUid());
$activity->setProUid($process->getProUid());
$activity->save();
return $activity->getActUid();