Handling Status Updates
This page collects information how to enable a status query for algorithms running the the 52°North
WPS.
Specification Features
WPS 1.0.0
In the WPS 1.0.0 specification, the following aspects are used for status handling.
Status
elemeent is defined to carry information about the execution state of a process.
Process Description
"The
statusSupported
parameter is used to support asynchronous requests via a type of polling. [...]"
For details see section 9.3.1.
Execute Response
"The status element [..] has five possible subelements (choice):
ProcessAccepted
,
ProcessStarted
,
ProcessPaused
,
ProcessFailed
and
ProcessSucceeded
[..]".
See section 10.3.1 for details.
Inf short, you can add messages to the different status elements, e.g.
<wps:ProcessAcceptedProcess>Accepted</wps:ProcessAccepted>
, or provide numerical status information in the
percentCompleted
attribute like this:
<wps:ProcessStarted percentCompleted="42" />
.
Alternatively, looking at the schema for Execute responses: The
Status
element cannot be extended, but the
ProcessOutputs
can hold any content and 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, one could also provide extended status information there as an intermediate result.
WPS 2.0
to be updated once the
WPS 2.0 specification is completed.
Processing Backends
Java Algorithm
If you use the 52°North
WPS and let your process implement
ISubject, you can update the status of a running process (i.e.
wps:ProcessStarteddddd
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>
.
The
AbstractObservableAlgorithm shows how the same class implements
IAlgorithm
and
ISubject
.
check if the statusSupported for process descriptions is supported.
R Algorithm
tbd.