Hi Steven,
Have you seen the documentation on github?
It is possible to provide a template path when registering a microflow service. This allows for constructing more complex URLs, from which values are parsed. For example, a microflow could be defined with the template path: groups/{groupId}/users/{userId}
. If that service would be called with http://myapp.com/rest/groups/123/users/John
, the attribute groupId
of the input argument of the microflow would be instantiated with the value 123
. Likewise, the attribute userId
would be instantiated with the value John
.
I think you would need a path of /microflow/{microflowname} and in your microflow that you are exposing have a parameter called "microflowname"
Here is a link to the github. There is also a test project that you can check out.
https://github.com/mendix/RestServices
Hope this helps!
Edit: Sorry I confused the newer publish rest services with this one. For this path to work
/microflow/{microflowname}
The microflow that you are exposing needs to have a parameter of an non-persistent object with an attribute called "microflowname". Then when you call your service, this object will be passed to the microflow with the attribute value set based on what was sent through the url.
Edit 2: I think a request handler can solve your issue. Here is a link to a really good blog post.
https://www.mendix.com/blog/requesthandlers-at-your-service/
I'm not too sure what you are trying to accomplish but you could setup a request handler as your catch all and then call your microflow service.
The CreateMicroflowServiceWithPath microflow's PathTemplate parameter should be in the form of a regular expression. The solution is to set the PathTemplate parameter to "microflow/.{0,}". The dot (.) token in the regular expression matches any character, and the "{0,}" matches 0 or more of the preceding token.
So with this regular expression set in the PathTemplate, calls to "http://localhost:8080/microflow/", "http://localhost:8080/microflow/foo_bar", etc. will route to the same exposed microflow.