Re: WPS questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: WPS questions

BenjaminPross
Hello Alejandro,

please find some comments inline:

Am 31.07.2014 12:38, schrieb Alejandro Garcia-Soto Keyenberg:
Good morning,

sorry for the delay, i got a week off and im now back on the project.

Sure thing Daniel, you can add the discussion on the geoprocessing mailing.


About the ISubject, we are currently using the percentage field (the integer), but how is it possible to add text to the ProcessStarted field, like you suggested ?<wps:ProcessStarted>Executed step 1 of 3</wps:ProcessStarted>
You can just pass your text as String value to the update() method. As I was mentioning, integer values will be used for the percentage, Strings for messages.

For the cancel issue, excluding WPS 2.0 because I believe its not a standard yet, my plan is to put the PID in the ProcessStarted field, catch it with the client and create a 'Cancel' process thats called from the client with that PID so it can kill the first process.

They passed me this project and apart from the Cancel new feature I should tune up the existing code.
We need to pass a jobOrder (xml with fields for a processor) and execute the processor its on the jobOrder.

Currently its working but I dig into the code and on your tutorials, and got tons of new questions,

1) currently the client is passing the jobOrder as a literalData and on server the literalData is transformed into an xml file then its checked against a schema and passed to the processor.
Isn't better to pass the jobOrder as a complexData that its autochecked with the schema defined on the describeProcess, maybe make a fileBinding, and pass it to the processor?
I would say passing it as complexData is cleaner, but it of course involves some work. Hopefully the tutorials can help: https://wiki.52north.org/bin/view/Geoprocessing/ExtendingTheWPS

2) Is it possible to refer to an xml file as the processdescription instead of using the SelfDescribingAlgorithm?
Yes, if you let your process extend simply AbstractAlgorithm, you have the full control over the process description. There is also a tutorial for that.

3) Also in the code that exist now its implemented with SelfDescribingAlgorithm, I got a LiteralOutputData which is a string with the message of the processor, but I tried to insert a new LiteralOutputData (date) and when the process is done on the response xml only appears the result field. Do I have to do something more apart of the modification of the getOutputIdentifiers and getOutputDataType methods? For testing purposes, at the moment "date" is just a string.
   @Override
   public List<String> getOutputIdentifiers() {
      List<String> list = new ArrayList<String>();
      list.add("result");
      list.add("date");
      return list;
   }
   @Override
   public Class getOutputDataType(String arg0) {
         return LiteralStringBinding.class;               
   }

Usually the above code should work. Could you check the process description, whether the output appears? Did you request the "date" output in your execute request?

Cheers,

Benjamin
Thanks for your help, and again sorry for the delay.


On Tue, Jul 22, 2014 at 4:43 PM, Benjamin Proß <[hidden email]> wrote:
Hi guys,

Please find some comments inline:

Am 22.07.2014 16:01, schrieb Daniel Nüst:
...
Is it possible to extend the status response of the server giving more
information of the running process?
Looking at the schema for Execute responses: The wps:Status element
cannot be extended, but the wps:ProcessOutputs has the following
description:

"List of values of the Process output parameters. [..] If the process
has not finished executing, the implementer can choose to include
whatever final results are ready at the time the Execute response is
provided.[..]"

So from the specification perspective, I think you could provide
extended status information there as an intermediate result.
You can also add messages to the different status elements, e.g. <wps:ProcessAccepted>Process Accepted</wps:ProcessAccepted>
If you use the 52°North WPS and let your process implement ISubject, you can update the status of a running process (<wps:ProcessStarted/> element).
Integer values will be added to the percentCompleted attribute, e.g. <wps:ProcessStarted percentCompleted="21"/>
String messages will be added to the element, e.g: <wps:ProcessStarted>Executed step 1 of 3</wps:ProcessStarted>

Is it possible to cancel a running process from the client?
Do you mean a specific client implementation? Do you mean our WPS server
implementation? Afaik the 52N WPS does not support this, but we used to
have a branch where this was implemented (see [1]).

As far as I know cancelling processes is very tricky in practice,
because the actual algorithms rarely support this, especially if you use
e.g. GRASS in the background.

This is also included in the work that the WPS 2.0 SWG is doing. Are you
aware of that group or even a member?

If not, is there a place on the server where the given url in the status
response is linked to the running process where it is possible to make a
query?
The communication here runs through the result database, see class [2].
Here you can query the status of the process.
@Benjamin: Can you elaborate on this?
I am afraid, it is not possible to create a link to a running process from the status URLs.
The unique identifiers used in the URLs merely point to a directory (or database entry) that is on the other side modified by the process.
With WPS 2.0 there will be a unique job id for each running process and seperate operations to get the status and also to cancel (dismiss) a process using the job id.

Hope this helps.

Cheers,

Benjamin


Alejandro, would it be ok for you to continue this discussion on the
geoprocessing mailing list so that others can also learn from our answers?

/Daniel

[1]
http://blog.52north.org/2013/01/14/a-look-into-wps-branches-today-spacebel/
[2]
https://github.com/52North/WPS/blob/e137a0c3548c9de4a2aebe65d22af6ded21290c6/52n-wps-database/src/main/java/org/n52/wps/server/database/DatabaseFactory.java




--
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: <a moz-do-not-send="true" href="tel:%2B49-%280%29-251%E2%80%93396371-42" value="+4925139637142" target="_blank">+49-(0)-251–396371-42
Fax: <a moz-do-not-send="true" href="tel:%2B49-%280%29-251%E2%80%93396371-11" value="+4925139637111" target="_blank">+49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849




-- 
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: +49-(0)-251–396371-42
Fax: +49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: WPS questions

Alejandro Garcia-Soto Keyenberg
thanks for your fast reply Benjamin,

I will try a couple of things and keep you updated

Kind regards


On Thu, Jul 31, 2014 at 2:51 PM, Benjamin Proß <[hidden email]> wrote:
Hello Alejandro,

please find some comments inline:

Am <a href="tel:31.07.2014%2012" value="+13107201412" target="_blank">31.07.2014 12:38, schrieb Alejandro Garcia-Soto Keyenberg:
Good morning,

sorry for the delay, i got a week off and im now back on the project.

Sure thing Daniel, you can add the discussion on the geoprocessing mailing.


About the ISubject, we are currently using the percentage field (the integer), but how is it possible to add text to the ProcessStarted field, like you suggested ?<wps:ProcessStarted>Executed step 1 of 3</wps:ProcessStarted>
You can just pass your text as String value to the update() method. As I was mentioning, integer values will be used for the percentage, Strings for messages.

For the cancel issue, excluding WPS 2.0 because I believe its not a standard yet, my plan is to put the PID in the ProcessStarted field, catch it with the client and create a 'Cancel' process thats called from the client with that PID so it can kill the first process.

They passed me this project and apart from the Cancel new feature I should tune up the existing code.
We need to pass a jobOrder (xml with fields for a processor) and execute the processor its on the jobOrder.

Currently its working but I dig into the code and on your tutorials, and got tons of new questions,

1) currently the client is passing the jobOrder as a literalData and on server the literalData is transformed into an xml file then its checked against a schema and passed to the processor.
Isn't better to pass the jobOrder as a complexData that its autochecked with the schema defined on the describeProcess, maybe make a fileBinding, and pass it to the processor?
I would say passing it as complexData is cleaner, but it of course involves some work. Hopefully the tutorials can help: https://wiki.52north.org/bin/view/Geoprocessing/ExtendingTheWPS

2) Is it possible to refer to an xml file as the processdescription instead of using the SelfDescribingAlgorithm?
Yes, if you let your process extend simply AbstractAlgorithm, you have the full control over the process description. There is also a tutorial for that.

3) Also in the code that exist now its implemented with SelfDescribingAlgorithm, I got a LiteralOutputData which is a string with the message of the processor, but I tried to insert a new LiteralOutputData (date) and when the process is done on the response xml only appears the result field. Do I have to do something more apart of the modification of the getOutputIdentifiers and getOutputDataType methods? For testing purposes, at the moment "date" is just a string.
   @Override
   public List<String> getOutputIdentifiers() {
      List<String> list = new ArrayList<String>();
      list.add("result");
      list.add("date");
      return list;
   }
   @Override
   public Class getOutputDataType(String arg0) {
         return LiteralStringBinding.class;               
   }

Usually the above code should work. Could you check the process description, whether the output appears? Did you request the "date" output in your execute request?

Cheers,

Benjamin
Thanks for your help, and again sorry for the delay.


On Tue, Jul 22, 2014 at 4:43 PM, Benjamin Proß <[hidden email]> wrote:
Hi guys,

Please find some comments inline:

Am 22.07.2014 16:01, schrieb Daniel Nüst:
...
Is it possible to extend the status response of the server giving more
information of the running process?
Looking at the schema for Execute responses: The wps:Status element
cannot be extended, but the wps:ProcessOutputs has the following
description:

"List of values of the Process output parameters. [..] If the process
has not finished executing, the implementer can choose to include
whatever final results are ready at the time the Execute response is
provided.[..]"

So from the specification perspective, I think you could provide
extended status information there as an intermediate result.
You can also add messages to the different status elements, e.g. <wps:ProcessAccepted>Process Accepted</wps:ProcessAccepted>
If you use the 52°North WPS and let your process implement ISubject, you can update the status of a running process (<wps:ProcessStarted/> element).
Integer values will be added to the percentCompleted attribute, e.g. <wps:ProcessStarted percentCompleted="21"/>
String messages will be added to the element, e.g: <wps:ProcessStarted>Executed step 1 of 3</wps:ProcessStarted>

Is it possible to cancel a running process from the client?
Do you mean a specific client implementation? Do you mean our WPS server
implementation? Afaik the 52N WPS does not support this, but we used to
have a branch where this was implemented (see [1]).

As far as I know cancelling processes is very tricky in practice,
because the actual algorithms rarely support this, especially if you use
e.g. GRASS in the background.

This is also included in the work that the WPS 2.0 SWG is doing. Are you
aware of that group or even a member?

If not, is there a place on the server where the given url in the status
response is linked to the running process where it is possible to make a
query?
The communication here runs through the result database, see class [2].
Here you can query the status of the process.
@Benjamin: Can you elaborate on this?
I am afraid, it is not possible to create a link to a running process from the status URLs.
The unique identifiers used in the URLs merely point to a directory (or database entry) that is on the other side modified by the process.
With WPS 2.0 there will be a unique job id for each running process and seperate operations to get the status and also to cancel (dismiss) a process using the job id.

Hope this helps.

Cheers,

Benjamin


Alejandro, would it be ok for you to continue this discussion on the
geoprocessing mailing list so that others can also learn from our answers?

/Daniel

[1]
http://blog.52north.org/2013/01/14/a-look-into-wps-branches-today-spacebel/
[2]
https://github.com/52North/WPS/blob/e137a0c3548c9de4a2aebe65d22af6ded21290c6/52n-wps-database/src/main/java/org/n52/wps/server/database/DatabaseFactory.java




--
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: <a href="tel:%2B49-%280%29-251%E2%80%93396371-42" value="+4925139637142" target="_blank">+49-(0)-251–396371-42
Fax: <a href="tel:%2B49-%280%29-251%E2%80%93396371-11" value="+4925139637111" target="_blank">+49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849




-- 
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: <a href="tel:%2B49-%280%29-251%E2%80%93396371-42" value="+4925139637142" target="_blank">+49-(0)-251–396371-42
Fax: <a href="tel:%2B49-%280%29-251%E2%80%93396371-11" value="+4925139637111" target="_blank">+49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849


_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org