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
#822852
How to create new custom trigger with code in rest api?
Attachments
ice_screenshot_20190211-134654.png
ice_screenshot_20190211-134654.png (25.12 KiB) Viewed 68 times
User avatar
By ziadeh
#822856
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
#822870
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:
pluginName/classes/class.pmFunctions.php.

You can study the source code in my extraFunctions plugin for an example:
https://www.pmusers.com/index.php/ExtraFunctions_plugin
Disable grid using JavaScript

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

Useful.. https://crbtech.in/online-dot-net-trainin[…]

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

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