Making controller commands retriable

A retriable command is a controller command that can re-execute itself after encountering a system-level exception during the command execution.

Note:
  • Web services are not retriable.
  • All commands in the CommandRegistryEntry class are retriable by default.

Procedure

  1. To make an existing controller command retriable, must perform one of the following steps:
    1. Set the retriable properties in the PROPERTIES column of the CMDREG database table, where PROPERTIES is the default properties associated with this command. The properties are in the property1=value1&property2=value2 form, where propertyn is the name of the property and valuen is the value corresponding to the property.
    2. Set an instance property <CommandRegistryRetriableProperty defaultValue="1" /> in the wc-server.xml file.
      Note:
      • You can also set the instance property using <CommandRegistryRetriableProperty defaultValue="true" />.
      • Setting the instance property to 0 or false results in the controller command being not retriable.
    3. Set the setRetriable() method to return true.
  2. The retriable property is initialized by the command factory based on the properties defined in one of the above command configurations. This command configuration at runtime can come from the following two locations in the following order of sequence:
    1. CommandRegistryEntry retriable setting is assigned from the retriable properties in the PROPERTIES column of the CMDREG database table, only when that entry exists in the database table.
    2. Otherwise, if an instance property called <CommandRegistryRetriableProperty defaultValue="0" /> or <CommandRegistryRetriableProperty defaultValue="false" /> is defined in the wc-server.xml file, then the command factory will use this setting as the default retriable configuration.
    3. Otherwise, the value of retriable defined in the controller command will be used.