rex_firebase_itemmonitor
Plugin, ACE table, Discussion thread
Dependence: rex_firebase_apiV3
Dependence: rex_firebase_apiV3
Introduction
Monitor items' values.
Monitor items' values.
Usage
Concept
It is used to monitor items added, item removed, or values changed in any item in the item table, to read changed items back to client.
This plugin only could read item back, use rex_firebase_itembook or to write items.
It is used to monitor items added, item removed, or values changed in any item in the item table, to read changed items back to client.
This plugin only could read item back, use rex_firebase_itembook or to write items.
Monitor all items in a table
Sample capx
Call "Action:Start" to start monitoring all items in a table, or call "Action:Stop" to stop monitoring.
Sample capx
Call "Action:Start" to start monitoring all items in a table, or call "Action:Stop" to stop monitoring.
Monitor queried items in a table
Sample capx
Follows these steps to monitor queried items in a table-
Sample capx
Follows these steps to monitor queried items in a table-
- Create a querying object by rex_firebase_query object.
- Set query object by "Action:Set query"
- Call "Action:Start" to start monitoring
On item added
"Condition:On item added" will be triggered while a item had been added into item table. Get itemID of current added item by "Expression:LastItemID", content of item by "Expression:LastItemContent" in JSON string, or add 2nd parameter for specific key, 3rd parameter for default value if this key is not existed.
"Condition:On item added" will be triggered while a item had been added into item table. Get itemID of current added item by "Expression:LastItemID", content of item by "Expression:LastItemContent" in JSON string, or add 2nd parameter for specific key, 3rd parameter for default value if this key is not existed.
Expression:LastItemContent - get item values in JSON string
Expression:LastItemContent( key ) - get the value with specific key
Expression:LastItemContent( key , default_value ) - get the value with specific key, return default_value if this key is not existed
Designer could use these information to create an instance. Remember to maintain a mapping table from itemID to UID of created instance for picking this instance later.
On item removed
"Condition:On item removed" will be triggered while a item had been removed. Get itemID of removed item by "Expression:LastItemID", content of item by "Expression:LastItemContent".
Designer could use these information to remove the instance.
"Condition:On item removed" will be triggered while a item had been removed. Get itemID of removed item by "Expression:LastItemID", content of item by "Expression:LastItemContent".
Designer could use these information to remove the instance.
On value changed, On any value changed
"Condition:On value changed", and "Condition:On any value changed" will be triggered while a value of item had been changed. Get triggered itemID by "Expression:LastItemID". Changed value by "Expression:PrevValue", "Expression:LastValue". Property name by "Expression:LastPropertyName".
"Condition:On value changed", and "Condition:On any value changed" will be triggered while a value of item had been changed. Get triggered itemID by "Expression:LastItemID". Changed value by "Expression:PrevValue", "Expression:LastValue". Property name by "Expression:LastPropertyName".
Value at Table [ LastItemID ] [ LastPropertyName ] had changed from PrevValue to LastValue
Designer could change related instance by these information.
On key added, On key removed
"Condition:On key added", "Condition:On key removed" will be triggered while the property of an item had been added or removed.
"Condition:On key added", "Condition:On key removed" will be triggered while the property of an item had been added or removed.
Retrieve current items
Call "Condition:For each itemID" to retrieve current items. Get itemID and content by "Expression:CurItemID" and "Expression:CurItemContent". The input parameters of "Expression:CurItemContent" is the same with "Expression:LastItemContent".
Call "Condition:For each itemID" to retrieve current items. Get itemID and content by "Expression:CurItemID" and "Expression:CurItemContent". The input parameters of "Expression:CurItemContent" is the same with "Expression:LastItemContent".
Expression:CurItemContent - get item values in JSON string
Expression:CurItemContent( key ) - get the value with specific key
Expression:CurItemContent( key , default_value ) - get the value with specific key, return default_value if this key is not existed
Call "Condition:For each key" to retrieve properties of a specific item. Get property and respond value by "Expression:CurKey", "Expression:CurValue".
More sample capx
Big map - set global variable "DOMAIN" at "E_setup" event sheet first.
Big map - set global variable "DOMAIN" at "E_setup" event sheet first.