src/SA/CpeSdk/CpeActivity.php
public function activitySuccess($output = '{}')
    {
        $context = [
            'output'    => $output,
            'taskToken' => $this->token
        ];

        try {
            $this->cpeLogger->logOut("INFO", basename(__FILE__),
                                     "\033[1mNotify Sfn that activity has completed!\033[0m",
                                     $this->logKey);

            $this->cpeSfnHandler->sfn->sendTaskSuccess($context);

            // Notify the client if any
            if ($this->client)
                $this->client->onSuccess($this->token, $output);

        } catch (\Exception $e) {
            $this->cpeLogger->logOut("ERROR", basename(__FILE__),
                                     "Unable to send 'Task success' to Sfn! " . $e->getMessage(),
                                     $this->logKey);

            // Notify the client if any
            if ($this->client)
                $this->client->onException($context, $e);

            return false;
        }

        return true;
    }
public function activitySuccess($output = '{}')
    {
        $context = [
            'output'    => $output,
            'taskToken' => $this->token
        ];

        try {
            $this->cpeLogger->logOut("INFO", basename(__FILE__),
                                     "\033[1mNotify Sfn that activity has completed!\033[0m",
                                     $this->logKey);

            $this->cpeSfnHandler->sfn->sendTaskSuccess($context);

            // Notify the client if any
            if ($this->client)
                $this->client->onSuccess($this->token, $output);

        } catch (\Exception $e) {
            $this->cpeLogger->logOut("ERROR", basename(__FILE__),
                                     "Unable to send 'Task success' to Sfn! " . $e->getMessage(),
                                     $this->logKey);

            // Notify the client if any
            if ($this->client)
                $this->client->onException($context, $e);

            return false;
        }

        return true;
    }
public function activitySuccess ( $ output = '{}' ) { $ context = [ 'output' => $ output , 'taskToken' => $ this -> token ] ; try { $ this -> cpeLogger -> logOut ( "INFO" , basename ( __FILE__ ) , "\033[1mNotify Sfn that activity has completed!\033[0m" , $ this -> logKey ) ; $ this -> cpeSfnHandler -> sfn -> sendTaskSuccess ( $ context ) ; // Notify the client if any if ( $ this -> client ) $ this -> client -> onSuccess ( $ this -> token , $ output ) ; } catch ( \ Exception $ e ) { $ this -> cpeLogger -> logOut ( "ERROR" , basename ( __FILE__ ) , "Unable to send 'Task success' to Sfn! " . $ e -> getMessage ( ) , $ this -> logKey ) ; // Notify the client if any if ( $ this -> client ) $ this -> client -> onException ( $ context , $ e ) ; return false ; } return true ; }
Activity Success and completed
Notifies Sfn that the activity has succeeded
Call this from your activity logic once the process is successful.
If return false then the call to Sfn sndTaskSuccess failed
Try again or throw an exception to mark the Activity as failed
Activity Success and completed Notifies Sfn that the activity has succeeded Call this from your activity logic once the process is successful . If return false then the call to Sfn sndTaskSuccess failed Try again or throw an exception to mark the Activity as failed