processMessage(SmappStateProcessingContext) method

This method is called by the processing engine when the state is activated from external source, for example, incoming SMS message.

public SmappState processMessage (SmappStateProcessingContext context) throws MwizProcessingException, DBException, CryptoException


See this API documentations for the processing engine life cycles.

Typically, this method should be implemented when the supportsSendSmsMessage() is set to true, to handle the reply SMS message.

The reference implementation provided in this method is described as follow. This reference implementation is provided for to help simplifying a typical state development. This implementation is sufficient for most cases.
  • Retrieve the input and output attributes value from the datasource, and bind the value to the input and output attributes. Note: these attributes are persisted to the datasource as a session variable.
  • Delegate the call to the subclass method for processing the state logic, processMessageLogic(SmappStateProcessingContext).
  • The delegate method, processMessageLogic(SmappStateProcessingContext) returns the follow-up transition as SmappState object.
  • If the follow-up transition (SmappState) returned by the processMessageLogic() is not null, proceed to return the same object to the processing engine. Otherwise, if the returned follow-up transition is null, then try to find the matched dynamic follow-up transition, and return that to the processing engine. NOTE: if a null follow-up transition is returned to the processing engine, the engine will terminate the flow.
    Used by: processing enginecontextthe state processing context containing all the necessary object needed while processing the state.the follow-up transitionMwizProcessingExceptionany exceptions that warrant terminating the applicationDBExceptionany database exceptions that warrant terminating the applicationCryptoExceptionany encryption exceptions that warrant terminating the application