The state Object is an abstraction layer that implements methods that expose the FrontM.js Capabilities Layer to App developers in a simpler way.
This object also carries the State of the entire conversation and helps the FrontM.js Abstraction Layer to control the flow of the Apps.
The state Object is instantiated by the platform and developers cannot create new instances.
This property is read only and contains the language of the conversation.
This property is an instance of the Developer Class, which is a helper task that exposes debugging and development utility methods and properties.
This property is an instance of the Accounts Class associated with the State.
This property is an instance of the Orders Class associated with the State.
This property returns an array containing all the forms active in the conversation. Each element is an instance of the Forms Class.
This property is read only and returns the error status of the State: either true or false.
This property stacks error messages, if the State is in error.
This property contains the Smart Suggestions array generated by the Apps.
This property can be set by the developers to stop the display of Smart Suggestions after the execution of a given Intent. It is reset after the Intent responses are processed.
This property contains the user Object referring to the user currently logged in.
This property contains the location where the App is running.
This property returns an object with all the contents of the MessageTypeConstants Capability.
This property returns the name of the Intent being processed. It is used internally by the FrontM.js Abstraction Layer.
This property is an instance of the Notification Class which is a helper class that exposes different methods and properties to deal with user notifications.
This property is an instance of the API Class which is a helper class that exposes different methods and properties to deal with third-party API access.
This property is an instance of the DB Class which is a helper class that exposes different methods and properties to deal with persistent storage.
This property contains the message received by the App.
This property contains the message type received by the App.
This method calls the default onError closure in the system. It is usually used within the user-defined onError closures in Apps.
This method runs a function passed as a parameter once an hour. It is not a scheduler. When it is called, it first checks if the function was run during the last hour. If it was, the function is not run. It is usually used to offer greetings to users.
This method sends a message to the current App. In future, this method will also be used to send messages to other Apps.
This method creates a unique single short UUID.
This method sets a value to a custom field and stores it within the State.
This method clears a custom field value.
This method gets a custom field value.
This method adds a Smart Suggestion object to the State, which will be displayed after the Intent processing is finished.
This method adds an array of Smart Suggestion objects to the State.
This method adds English Smart Suggestions to the App. This method receives an array of strings as input.
This method clears the Smart Suggestions array.
This method returns a Form Object identified by the passed Id. It returns null if the Form is not found.
This method adds the Form Object pasted in the parameters to the State.
This method removes the Form from the state Object.
This method adds a user-defined error to the stack. Once an error is added, the state Object enters in (its instead of in?) error state.
This method removes all errors from the stack.
This method adds a response message to the state Object.
This method adds a string response to the state Object.
This method clears the response array.