2

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.

elviejo79
  • 4,592
  • 2
  • 32
  • 35
  • When evaluating Processmaker I just assumed it could do this, that a REST API was one of the sources it could get data from. Bummed to find so much code and gotchas. – SteveCav May 17 '17 at 23:14
  • 1
    ProcessMaker 3.2 has been released, I haven't looked at it. But @Ethan Presber said now it should be easier to use it in this way. – elviejo79 May 18 '17 at 23:47

2 Answers2

2

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

Ethan Presberg
  • 203
  • 1
  • 6
1

You can also have a look at this documentation, which shows an example of how to use External Web Services within ProcessMaker Triggers.

http://wiki.processmaker.com/3.0/ProcessMaker_WSDL_Web_Services#Using_External_WSDL_Web_Services

Zainab
  • 21
  • 2