Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
User avatar
By dhanaulia
How to create new custom trigger with code in rest api?
ice_screenshot_20190211-134654.png (25.12 KiB) Viewed 67 times
User avatar
By ziadeh
You can create a trigger in PM designer and call it from rest api read this

Also if you want to create a custom code and call it from rest api, you have to create a php file in
Code: Select all
{Your processmaker path}/workflow/engine/src/ProcessMaker/Services/Api
There are couple of test files so you can get some ideas from them.

After you create a rest api php file and made your custom code you need to delete routes.php file:
Code: Select all
{Your processmaker path}/shared/sites/workflow/routes.php
And PM will generate a new one that have your code.

Also you can use Extrarest api for Amosbatto
User avatar
By amosbatto
If you want to add a new trigger functions, then you create a plugin with the PMFunctions Class.

Then you need to add comments in this file of your new plugin:

You can study the source code in my extraFunctions plugin for an example:
Disable grid using JavaScript

Hi, I tried to disable the grid with JavaScript. […]


I used your example as a base to fixup my flow and[…]

There is a third parameter in the sendMessage() fu[…]