Controller/TaskController.php
public function transitionAction(Request $request)
    {
        $id = $request->get('id');
        $assignedUserId = $request->get('recipient');
        $name = $request->get('name');
        $comment = $request->get('comment');

        if ($comment) {
            $comment = urldecode($comment);
        }

        $taskManager = $this->get('phlexible_task.task_manager');
        $userManager = $this->get('phlexible_user.user_manager');

        $assignUser = null;
        if ($assignedUserId) {
            $assignUser = $userManager->find($assignedUserId);
        }

        $task = $taskManager->find($id);
        $taskManager->updateTask($task, $this->getUser(), $name, $assignUser, $comment);

        return new ResultResponse(true, 'Task transition created.', array('task' => $this->serializeTask($task)));
    }
public function transitionAction(Request $request)
    {
        $id = $request->get('id');
        $assignedUserId = $request->get('recipient');
        $name = $request->get('name');
        $comment = $request->get('comment');

        if ($comment) {
            $comment = urldecode($comment);
        }

        $taskManager = $this->get('phlexible_task.task_manager');
        $userManager = $this->get('phlexible_user.user_manager');

        $assignUser = null;
        if ($assignedUserId) {
            $assignUser = $userManager->find($assignedUserId);
        }

        $task = $taskManager->find($id);
        $taskManager->updateTask($task, $this->getUser(), $name, $assignUser, $comment);

        return new ResultResponse(true, 'Task transition created.', array('task' => $this->serializeTask($task)));
    }
public function transitionAction ( Request $ request ) { $ id = $ request -> get ( 'id' ) ; $ assignedUserId = $ request -> get ( 'recipient' ) ; $ name = $ request -> get ( 'name' ) ; $ comment = $ request -> get ( 'comment' ) ; if ( $ comment ) { $ comment = urldecode ( $ comment ) ; } $ taskManager = $ this -> get ( 'phlexible_task.task_manager' ) ; $ userManager = $ this -> get ( 'phlexible_user.user_manager' ) ; $ assignUser = null ; if ( $ assignedUserId ) { $ assignUser = $ userManager -> find ( $ assignedUserId ) ; } $ task = $ taskManager -> find ( $ id ) ; $ taskManager -> updateTask ( $ task , $ this -> getUser ( ) , $ name , $ assignUser , $ comment ) ; return new ResultResponse ( true , 'Task transition created.' , array ( 'task' => $ this -> serializeTask ( $ task ) ) ) ; }
Create task transition.

@param Request $request

@return ResultResponse
@Route("/create/transition", name="tasks_create_transition")
@Method({"GET", "POST"})
@ApiDoc(
description="Create status",
requirements={
{"name"="id", "dataType"="string", "required"=true, "description"="Task ID"},
{"name"="recipient", "dataType"="string", "required"=false, "description"="Recipient"},
{"name"="name", "dataType"="string", "required"=true, "description"="Transition name"},
{"name"="comment", "dataType"="string", "required"=false, "description"="Comment"}
}
)
Create task transition .