07-23-2018 05:52 PM
I would like to create a REST call using the Alfresco Process Editor which needs to be in the following format:
https://addresscoverage-cd50.restdb.io/rest/addresssample?q={"STREET_NUMBER": ${streetnumber}}
where ${streetnumber} is an input variable from a form in the model. e.g.
https://addresscoverage-cd50.restdb.io/rest/addresssample?q={"STREET_NUMBER": 194}
This works fine in POSTMAN.(call also requires an x-apikey for auth in the header).
Is it possible to construct a URI in this form using the Alfresco Process Editor?
Or can I edit the model XML to achieve the same thing ?e.g.
<activiti:string><![CDATA[https://addresscoverage-cd50.restdb.io/rest/addresssample]]></activiti:string>
<modeler:request-mapping xmlns:modeler="http://activiti.com/modeler" modeler:jsonPropertyName="q" modeler:jsonPropertyType=??? modeler:jsonPropertyValue=???
07-25-2018 12:53 AM
Hi,
I would suggest to use java execution listener and in the listener you can call this Rest API using any java Rest client.There is a possiblity of passing parameters to the listeners.
Please Refer activiti documentation for further details Activiti User Guide
you can also refer some of the examples on execution listeners in the sommunity
07-25-2018 07:16 PM
Is it possible to construct a URI in this form using the Alfresco Process Editor?
If I add a request mapping like this, then ${streetnumber} is just taken as text.
I need to be able to add some kind of delimiter to take ${streetnumber} as a variable. Something like (but not) this: " { " STREET_NUMBER " : " && ${streetnumber} && "}"
I also thought I might also be able to construct a JSON template that looks like this:
{
"STREET_NUMBER": ${streetnumber}
}
.. but then I am missing the Property Name "q", so this doesn't work either.
Explore our Alfresco products with the links below. Use labels to filter content by product module.