1. Enable rest api registering feature on main plugin file
i.e, if I have a plugin named "erik", so we have a file named workflow/engine/plugins/erik.php
and a folder workflow/engine/plugins/erik/
- inside of setup method of plugin main class set: $this->enableRestService(true);
---- file: erik.php ----
class erikPlugin extends PMPlugin
{
...
public function setup()
{
$this->registerMenu("processmaker", "menuerik.php");
...
$this->enableRestService(true); // <- this line enable Rest Service dispatching feature
}
...
2. Create a folder: workflow/engine/plugins/erik/src/Services/Api/
$ mkdir -p workflow/engine/plugins/erik/src/Services/Api/
3. Create a Restler class inside the folder created above
i.e. creating a Hello class.
---- file: workflow/engine/plugins/erik/src/Services/Api/Hello.php -----
<?php
namespace Services\Api;
use Luracast\Restler\RestException;
use ProcessMaker\Services\Api;
use \ProcessMaker\Util;
/**
* @protected
*/
class Hello extends Api
{
/**
* @url GET /world
*/
public function world()
{
try {
$hello = array(
'message' => 'Hello world'
);
return $hello;
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}
---------- end file ---------
4. Disable and enable the plugin named "erik" on ProcessMaker Admin Interface
5. Use the Rest Api defined inside the plugin
you can access from a url something like that:
format: http://<SERVER-ADDR>/api/1.0/<WORKSPACE>/plugin-<THE-PLUGIN-NAME>/hello/world
i.e.
http://processmaker/api/1.0/workflow/plugin-erik/hello/world
Note.- to access this url that has the protected attribute into the class
you need provide the access token into request header.
Causa : Esta "," tal cual se indica aparece en esa poscion debido a que este obedece a una configuracion del ENVIRONMENT; ejemplo (@lastName, @firstName (@userName)), si esta seleccionada esta opcion deberia parecer una coma(,).
Solucion : Sin embargo puede que algunos de estos valores (Firstname o lastanme fuese vacio) en este caso se elimina la coma ",".
> Code Isuue:
Al modificar un Intemediate send message event y grabar sale un mensaje de error
> Solution:
Al configurar la propiedad de un message event y guardar la configuracion ya no muestra el error.
Issue:
Las cookies de sesion no se ha definido con el flag HttpOnly esta debe definirse para mitigar ataques de tipo
cross-site scripting.
Cause:
No se a definido el parametro "httponly" al momento de usar la funcion "setcookie"
Solution:
Se define el parametro "httponly" al momento de usar la funcion "setcookie"
Causa : Definida asi en su contruccion.
Solució Remover en menu anterior(Click derecho en el canvas - menu contextual), y adicionar en el menu "Process Objects".
Causa : Esta "," tal cual se indica aparece en esa poscion debido a que este obedece a una configuracion del ENVIRONMENT; ejemplo (@lastName, @firstName (@userName)), si esta seleccionada esta opcion deberia parecer una coma(,).
Solucion : Sin embargo puede que algunos de estos valores (Firstname o lastanme fuese vacio) en este caso se elimina la coma ",".
Issue:
RefreshToken not recreated after using it to generate another accessToken
Cause:
Nuevo requerimiento de funciones
Solution:
Se esta definiendo el flag "always_issue_new_refresh_token" con "true",
esto para poder generar un nuevo refresh-token cuando se solicita
un access-token usando un refresh-token