Status Codes
Most programs perform some sort of error checking and display any necessary messages to the user, typically returning integers to indicate successful completion or other status. The server-side API can return a status code following execution of a stream containing the node. See the topic Status Detail Document for more information.
The Status Codes section enables you to associate a message with a particular status code, for display to the user.
Format
<StatusCodes>
<StatusCode code="codenum" status="status" message="message_text"
messageKey="message_key" />
...
</StatusCodes>
The status code attributes are shown in the following table.
| Attribute | Description |
|---|---|
code
|
The status code (an integer value) with which the message will be associated. |
status
|
The status classification:
success - node executed successfully
warning - node executed with warnings
error - node execution unsuccessful |
message
|
The message to be displayed when this status code is returned. |
messageKey
|
Identifies the message for localization purposes. |
Example
In this example, the text of the error message is included in the
StatusCode element:
<StatusCodes>
<StatusCode code="0" status="error" message="Cannot initialise a peer" />
<StatusCode code="1" status="error" message="Error reading input data" />
<StatusCode code="2" status="error" message="Internal Error" />
<StatusCode code="3" status="error" message="Input Field Does Not Exist" />
</StatusCodes>
On execution, if the server-side API returns status code 3, the following message is displayed to the user.

In the next example, the error message texts are referenced by a
messageKey attribute:
<StatusCodes>
<StatusCode code="0" status="error" messageKey="initErrMsg.LABEL"/>
<StatusCode code="1" status="error" messageKey="inputErrMsg.LABEL"/>
<StatusCode code="2" status="error" messageKey="internalErrMsg.LABEL"/>
<StatusCode code="3" status="error" messageKey="invalidMetadataErrMsg.LABEL"/>
...
</StatusCodes>
A property file (e.g. messages.properties), in the same
folder as the specification file, contains the actual message texts as well as other display
text:
...
initErrMsg.LABEL=Initialisation failed.
inputErrMsg.LABEL=Error when reading input data.
internalErrMsg.LABEL=Internal error.
invalidMetadataErrMsg.LABEL=Metadata (on input/output fields) not valid.
...
This method is useful when display text needs to be localized for overseas markets, for example, as all the text for localization can be found in one file. See the topic Localization for more information.