I was looking to update the WPS dev guide example; and ran into an oddness.
Consider the following code in WPSExecutionManager:
ExecutionStatus completedStatus = new ExecutionStatus(status);
if (status.getPhase() == ProcessState.RUNNING) {
completedStatus.setPhase(ProcessState.SUCCEEDED);
} else {
completedStatus.setPhase(ProcessState.FAILED);
}
{code:java}
This looks fine, but at the time the debugger gets here the status == ProcessPhase.QUEUED which results in the process having both a FAILED status and an answer:
{code:xml}
<ExecuteResponse ...>
<Process processVersion="1.0.0">
<Identifier>test:version</Identifier>
<Title>Test Verion</Title>
<Abstract>Implementation version</Abstract>
</Process>
<Status creationTime="2015-06-29T22:59:52.097Z">
<ProcessFailed>
<ExceptionReport version="1.1.0">
<Exception exceptionCode="NoApplicableCode">
<ExceptionText>Process failed during execution</ExceptionText>
</Exception>
</ExceptionReport>
</ProcessFailed>
</Status>
<ProcessOutputs>
<Output>
<Identifier>result</Identifier>
<Title>Version</Title>
<Data>
<LiteralData>0.5.3</LiteralData>
</Data>
</Output>
</ProcessOutputs>
</ExecuteResponse>
For reference here is a sample process:
public class ExampleProcesses extends StaticMethodsProcessFactory<ExampleProcesses> {
public GrassProcesses() {
super(Text.text("Example"), "example", ExampleProcesses);
}
@DescribeProcess(title = "Version", description = "Version of implementation used")
@DescribeResult(description = "Version")
public static String version() {
return "0.5.2";
}
}
|