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>