Show TOC

Custom State InformationLocate this document in the navigation structure

State information includes an ID, a name, a revision number, and usage notes. The name and usage notes are metadata that the state editor shows in the Application Composer.

For a custom state, you can explain its purpose and functionality as state notes, which appear in the state editor.

public String getStateNotes() {       
  StringBuilder sb = new StringBuilder();       
  sb.append("A sample state. When executed, it checks for ");       
  sb.append("an entered Postal/ZIP Code, and returns the ");
  sb.append("weather report for that area.\n\n);    
  sb.append("Use the following follow up states:\n ");       
  sb.append("- OK: Weather report for the area was found\n ");       
  sb.append("- FAIL: Unexpected error\n ");       
  sb.append("- Dyn -1: Area code entered was not valid\n ");       
  sb.append("- Dyn -2: No weather report for the area\n ");       
  return sb.toString();    

Get My Weather Custom State

The revision number is a prerequisite for any plug-in component, as specified in the PluginInterface class. It identifies a version, and sets the plug-in number. getRevisionString() can return any String value.
public String getRevisionString() {       
  return "1.0.0";
The state ID is a unique identifier for the state. Each state must have a unique ID stored in the database for each installation in which the state is used. This unique value allows the state to be resolved to the same type across installations.
private static long STATE_ID = 600000L;        

public long getStateId() {       
  return STATE_ID;                   

For custom states, assign unique ID values between 600,000 and 999,999. Values between 0 and 599,999 are reserved.