Publishing parameter type and default value via the process' REST-API

Dear JOpera team,

pertaining to my unresolved request about resource pattern support [1]
I found a significant limitation of the REST-API to process invocation:

- [2] lists all published processes
- using this info [3] resolves the input API of a particular process
- unlike the Eclipse run condiguration the REST-API neither conveys the
expected data type nor default value of the parameter
- the WSDL/SOAP-API displays just the data types due to restrictions of WSDL
- although being available statically (at process definiton level) the default
parameter values are visible only after the process has been instantiated

I hoped to implement process start authorization by means of evaluating the default
parameter values (e.g. pre-setting parameters "group" or "user" with appropriate
identifiers).

Is there a simple workaround to pass default parameter values to the process REST-API
or adding any annotation parameters for the above-mentioned purpose ?

Thank you
Jaro

[1] http://www.jopera.org/node/419#comment-45
[2] http://localhost:8080/rest
[3] http://localhost:8080/rest/omlfile/process/version

Default Parameter Values

Hi Jaro,

in the current release the default parameter values are indeed visible through the REST API only through the HTML and XML representations. We will add them to the JSON and plain text formats in the next release, thanks for pointing out the bug.

More in detail, if you deploy the mashup_doodlemap example.

http://localhost:8080/rest/mashup_doodlemap/DoodleMap/1.1/?_Accept=appli...

should return you an XML document such as the following:

<template id="{mashup_doodlemap}DoodleMap[1.1]" start_url="/rest/mashup_doodlemap/DoodleMap/1.1/" instance_url="/rest/mashup_doodlemap/DoodleMap/1.1/*/">
<input>
<param name="results">10</param>
<param name="zip">10001</param>
<param name="query">Pizza</param>
<param name="name">CP</param>
<param name="time">2000</param>
<param name="participants">3</param>
<param name="title">Pizza in NY</param>
<param name="description">Where to go for Pizza in NY?</param>
</input>
</template>

which contains the default values as text between the <param> tags.

The same happens with the HTML form where the default values are entered in the form fields for you. The browser is going to send them when POSTing the form to start the process and your client should do the same.

Can you be more specific about the "process start authorization" issue? In the current design, the REST API does not deal with any of such issues, it is up to your client (e.g., we use it with a web frontend) to check that calls made to the API are done only by authorized clients. Of course, we can always extend the API to deal with such requirement.

Best Regards,
JOpera Team

Default Parameter Values

Dear JOpera team,

I've checked the XML/Html output as well and it did not seem to work.
Now it turned out that changes to the process API (adding new parameters
and default values) require a JOpera restart in order to be reflected in
the REST-API. A simple save/build or clean/project rebuild does not help.
Please try to reproduce using v. 2.4.9.

The use case: JOpera is utilized as a workflow backend. The wrapper retrieves
the process interface XML and evaulates the default values specifying the (id/group
based) access to individual processes.

Many thanks for your quick response
Jaro

Thanks for your bug report

Hi Jaro,

yes, we can reproduce the problem. It would seem that the REST cache does not get flushed properly when processes get redeployed.

Also, once you restart JOpera, could you please confirm that you can read the default parameter values you need in the XML representation of the process interface?

Thanks again for your bug report, we will fix it in the next JOpera release.

Best Regards,
JOpera Team

Default Parameter Values

Dear JOpera team,
... yes, once the REST-API got updated by a restart the default paremeter values
and new parameters are displayed correctly.
Cheers
Jaro