コード例 #1
0
ファイル: Light.php プロジェクト: nhenderson/processmaker
    /**
     * Get in base64 the image process (processmap)
     *
     * @url GET /process/:pro_uid/case
     *
     * @param string $prj_uid {@min 32}{@max 32}
     * @param string $app_uid {@min 32}{@max 32}{@from path}
     */
    public function doGetProcessMapImage($pro_uid, $app_uid = null)
    {
        $return = array();
        try {
            $oPMap = new \ProcessMaker\BusinessModel\ProcessMap();
            $schema = Adapter\BpmnWorkflow::getStruct($pro_uid);

            $schemaStatus = array();
            if (!is_null($app_uid)) {
                $case = new \ProcessMaker\BusinessModel\Cases();
                $case->setFormatFieldNameInUppercase(false);
                $schemaStatus = $case->getTasks($app_uid);
            }

            $file = $oPMap->get_image($schema, $schemaStatus);
            ob_start();
            imagepng($file);
            $image  = ob_get_clean();
            $return["map"] = base64_encode($image);

        } catch (\Exception $e) {
            throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
        }
        return $return;
    }
コード例 #2
0
ファイル: Cases.php プロジェクト: nhenderson/processmaker
    /**
     * @url GET /:app_uid/:del_index/steps
     *
     * @param string $app_uid {@min 32}{@max 32}
     * @param int $del_index
     *
     */
    public function doGetSteps($app_uid, $del_index)
    {
        try {
            $case = new \ProcessMaker\BusinessModel\Cases();
            $case->setFormatFieldNameInUppercase(false);

            $response = $case->getSteps($app_uid, $del_index);

            return $response;
        } catch (\Exception $e) {
            throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
        }
    }