Developer

SmappStatePlugin class

This class represents the main class to be inherited by state that needs to be displayed on the Application Composer and State Editor, and to be invoked by the "Processing Engine" at runtime of an application.

Package

com.sybase365.mobiliser.brand.plugins.smapp.state
Syntax
Syntax
public abstract class SmappStatePlugin extends Plugin implements StatePlugin

Base class

Implemented interfaces

Derived classes

Members

All members of SmappStatePlugin, including inherited members.

Methods
Modifier and Type Method Description
protected SmappState continueDyn(String) Helper method in state development.
protected SmappState continueDyn(Integer) Helper method in state development.
protected SmappState continueDyn(Long) Helper method in state development.
protected SmappState continueFail() Helper method in state development.
protected SmappState continueFail(String) Helper method in state development.
protected SmappState continueOk() Helper method in state development.
protected SmappState determineFollowingSmappStateFromPattern(SmappStateProcessingContext) Determine the follow-up transition that match the message in the state processing context.
protected SmappState determineFollowingSmappStateFromPattern(SmappStateProcessingContext, MwizMessage) Determine the follow-up transition that match the message from the input parameter.
protected SmappState determineFollowingSmappStateFromTransitionType(EnumSmappTransitionType, SmappState, SmappStateProcessingContext) Determine the follow-up transition that match the type provided in the input parameter.
public Customer getCurrentCustomer() Current customer Customer of this session.
public List< IAttribute > getInputAttributes() Return the input attributes specified by the state.
public List< IAttribute > getOutputAttributes() Return the output attributes specified by the state.
protected SessionAttribute getSessionAttributeForKey(String) Get the value of session attribute (SessionAttribute) based on the specified key.
protected List< SessionAttribute > getSessionAttributes() Get session attributes for the current state in the current session.
protected Long getSessionId() Session ID that the application is running.
protected SmsTextI18n getSmsText18nReplaced() Process the SMS message by replacing all the session variables with the actual session variable value.
protected abstract Attribute[] getStateAttributes() Returns all the attributes (input and output) specified in the state.
public String getStateNotes() The detailed description about the state, and documentations on how to use the state including the follow-up transitions.
protected void handleFatal(SmappStateProcessingContext, SmappStateProcessingAction) Helper method in state development.
protected boolean isCurrentStateEncrypted() Indicate whether the current state is encrypted.
public boolean isSelectable() To indicate whether the state can be used as the follow-up state.
public void loadStateAttributes(SmappStateEditorContext) Default implementation is empty.
public SmappState processMessage(SmappStateProcessingContext) This method is called by the processing engine when the state is activated from external source, for example, incoming SMS message.
protected SmappState processMessageLogic(SmappStateProcessingContext) Delegate method call by the processMessage(SmappStateProcessingContext).
public void processState(SmappStateProcessingContext, SmappStateProcessingAction) This method is always called by the processing engine when the state is activated by the follow-up transition.
protected abstract SmappState processStateLogic(SmappStateProcessingContext, SmappStateProcessingAction) Delegate method call by the processState(SmappStateProcessingContext, SmappStateProcessingAction).
protected void saveOutputAttributes() Saving attributes that has holdValue (see OutputAttribute#getHoldValue()) in bulk for better performance.
protected void saveSessionAttribute(String, String) Save the input parameters to the session attribute (SessionAttribute).
protected void saveSessionAttribute(String, String, boolean) Save the input parameters to the session attribute (SessionAttribute).
protected void saveSessionAttributes(Map< String, String >) Save the session attributes in the Map of the current state in the current session to database.
protected void sendSmappSms(MwizMessage, Language) Send SMS from the current session.
protected void sendSmappSms(MwizMessage, Language, MwizMessageOptions) Send SMS from the current session.
public void setAckMessage(boolean) Set the SMPP acknowledgement request flag for the current session.
public void shutdown() No default implementation.
public void startup(HashMap< String, String >) No default implementation.
public boolean supportEncryption() Indicate whether this state support encryption.
public boolean supportsDynTransition() Indicates if the state supports dynamic (Dyn) transition.
public boolean supportsFailTransition() Indicate if the state uses the Fail follow-up transition type.
public boolean supportsGoToApplication() Indicate if the state supports transfer flow to another application.
public boolean supportsOkTransition() Indicate if the state uses the OK follow-up transition type.
public boolean supportsSendSmsMessage() Indicate if the state may send SMS message to the current consumer.
Inherited members from Plugin
Modifier and Type Member Description
public String getInstanceName() Get the instance name.
public void setInstanceName(String) Set the instance name.
Inherited members from PluginInterface
Modifier and Type Member Description
public String getRevisionString()  
public void shutdown() Stop this plugin instance.
public void startup(HashMap< String, String >) Initiate the startup process for this plugin instance.
Inherited members from StatePlugin
Modifier and Type Member Description
public long getStateId() The state unique ID.
public String getStateName() The state name is used for display on the state editor.
Inherited members from PluginInterface
Modifier and Type Member Description
public String getInstanceName()  
public String getRevisionString()  
public void setInstanceName(String) A plugin may be instantiated multiple times with different set of attributes, the instanceName may be set externally to uniquely identify a particular instance.
public void shutdown() Stop this plugin instance.
public void startup(HashMap< String, String >) Initiate the startup process for this plugin instance.

Usage

As such it should be regarded as the 'external' API. Any class that extends this class will be called State for the purpose of the API documentation.

There are a significant number of infrastructure functionalities performed by this base class that simplify the state development, including extra methods to allow processing of input and output attribute values and session variables.

Please refer to StatePlugin for more detailed description of the processing engine life cycle.