Example #1
0
    public function addTask(array $arrayTaskData)
    {
        try {
            //Task
            $taskUid = parent::addTask($arrayTaskData);

            //BPMN
            //Activity
            $arrayActivityType = array(
                "NORMAL"     => "TASK",
                "ADHOC"      => "TASK",
                "SUBPROCESS" => "SUB_PROCESS"
            );

            $activityBouX = (int)($arrayTaskData["TAS_POSX"]);
            $activityBouY = (int)($arrayTaskData["TAS_POSY"]);
            $activityBouWidth  = (int)($arrayTaskData["TAS_WIDTH"]);
            $activityBouHeight = (int)($arrayTaskData["TAS_HEIGHT"]);

            $arrayData = array(
                "ACT_UID"    => $taskUid,
                "ACT_NAME"   => $arrayTaskData["TAS_TITLE"],
                "ACT_TYPE"   => $arrayActivityType[$arrayTaskData["TAS_TYPE"]],
                "BOU_X"      => $activityBouX,
                "BOU_Y"      => $activityBouY,
                "BOU_WIDTH"  => $activityBouWidth,
                "BOU_HEIGHT" => $activityBouHeight
            );

            $activityUid = $this->bp->addActivity($arrayData);

            if ($arrayTaskData["TAS_START"] == "TRUE") {
                $eventUid = $this->startTaskEndProcessToBpmnEvent(
                    "bpmnActivity",
                    $activityUid,
                    $activityBouX,
                    $activityBouY,
                    $activityBouWidth,
                    $activityBouHeight,
                    "",
                    "START"
                );
            }

            //Return
            return $taskUid;
        } catch (\Exception $e) {
            throw $e;
        }
    }
Example #2
0
    public function addActivity($data)
    {
        $taskData = array();

        $actUid = parent::addActivity($data);
        $taskData["TAS_UID"] = $actUid;

        if (array_key_exists("ACT_NAME", $data)) {
            $taskData["TAS_TITLE"] = $data["ACT_NAME"];
        }
        if (array_key_exists("ACT_NAME", $data)) {
            $taskData["TAS_POSX"] = $data["BOU_X"];
        }
        if (array_key_exists("ACT_NAME", $data)) {
            $taskData["TAS_POSY"] = $data["BOU_Y"];
        }
        if (array_key_exists("ACT_TYPE", $data)) {
            if ($data["ACT_TYPE"] == "SUB_PROCESS") {
                $taskData["TAS_TYPE"] = "SUBPROCESS";
            } else {
                $taskData["TAS_TYPE"] = "NORMAL";
            }
        }

        $activityCurrent = \BpmnActivityPeer::retrieveByPK($actUid);

        if ($activityCurrent->getActType() == "TASK" && $activityCurrent->getActTaskType() == "SCRIPTTASK") {
            $taskData["TAS_TYPE"] = "SCRIPT-TASK";
            $taskData["TAS_ASSIGN_TYPE"] = "BALANCED";
        }

        $this->wp->addTask($taskData);

        return $actUid;
    }
Example #3
0
    public function addActivity($data)
    {
        $taskData = array();

        $actUid = parent::addActivity($data);
        $taskData["TAS_UID"] = $actUid;

        if (array_key_exists("ACT_NAME", $data)) {
            $taskData["TAS_TITLE"] = $data["ACT_NAME"];
        }
        if (array_key_exists("ACT_NAME", $data)) {
            $taskData["TAS_POSX"] = $data["BOU_X"];
        }
        if (array_key_exists("ACT_NAME", $data)) {
            $taskData["TAS_POSY"] = $data["BOU_Y"];
        }
        if (array_key_exists("ACT_TYPE", $data)) {
            if ($data["ACT_TYPE"] == "SUB_PROCESS") {
                $taskData["TAS_TYPE"] = "SUBPROCESS";
            } else {
                $taskData["TAS_TYPE"] = "NORMAL";
            }
        }

        $this->wp->addTask($taskData);

        return $actUid;
    }