restclientprocessmaker

Using ProcessMaker as a REST client not Server


I want to call an external API within a task from ProcessMaker and use the result of that call in the process. In the process it would look something like this: enter image description here However the only information I've been able to find is how to use ProcessMaker as a REST server, not a client.


Solution

  • In order to do that, you would need to use a Script Task. A Script Task allows you to execute a ProcessMaker Trigger, which is essentially PHP code.

    So you would use PHP's CURL functions to make the request to the API and then return the value to a ProcessMaker variable, @@MyReturnVar.

    In about a month ProcessMaker will be releasing version 3.2, which will make it much easier to do this kind of stuff, with the new Task Type, Service Task.

    So for the meantime, Script Tasks and Triggers are your friend.

    http://wiki.processmaker.com/3.0/Tasks#ScriptTask

    http://wiki.processmaker.com/3.0/Triggers