Professional Documents
Culture Documents
Myriad Connect - Training - SCE2 Most Used Plugins
Myriad Connect - Training - SCE2 Most Used Plugins
svc_variable:redir_by_variable/5 svc_arithmetic:arithmetic/9
svc_variable:incl/3 svc_arithmetic:compare/7
svc_variable:extract/6 svc_transient_data:store/5
svc_variable:compare_variables/9 svc_transient_data:get_values/3
svc_core:redir_by_attribute/4 svc_sms:sms_mt/10
svc_core:incl_attribute/2 svc_sms:sms_mt_to_sh/10
svc_core_ext:set_attribute/5 svc_sms_ext:sms_mo_init/9
Most used plugins
svc_variable:set_v2/5, set_v2/6
These two plugins sets any value into a variable, while set_v2/6 can control the
length of the value.
SCE2 field service and name specify the variable to store the value.
Most used plugins
svc_variable:set_v2/5, set_v2/6
When we input the value, we can select the dynamic string types.
conf: specify the value of certain config.
"app_name:parameter" specifies the config
index_list specifies the exactly config value position. If there is only one value in the config, we
need input “[]” here.
date: specify the time (local or UTC) and display by %y/%m/%d %H:%M:%S or other
format.
fixed: specify any string constant.
list_item: specify a value from certain list.
new_line: generate a newline, which is used in some string regenerate.
session: specify certain attribute/value of the ongoing session.
variable: specify the value from certain variable in the ongoing session.
Most used plugins
svc_variable:redir_by_variable/5
This plugin redirects to one of several pages depending on the value of a variable of
ongoing session.
service and name specify the variable for redirecting.
match specifies the match type, i.e. equal, equal_num, prefix, contain or length.
patterns specifies as many matching rules as you wish, which are separated by “,”.
We always keep “?” as the last rule, which means all other rules don’t match, i.e. the
other condition.
When match is contain, the rules in patterns can be regex.
Check the following page for regex syntax:
http://
erlang.org/documentation/doc-5.10.4/lib/stdlib-1.19.4/doc/html/re.html#regexp_syntax
Most used plugins
svc_variable:redir_by_variable/5
This plugin inserts the value of the specific variable into page content.
It is enabled only when previous page use the \include(XXX) for displaying string.
service and name specify the variable for displaying.
incl_by_variable/5 can display the string in the list, while need appoint the index of
the list.
Most used plugins
svc_variable:extract/6
This plugin extracts values from specific string and stores them in the ongoing
session.
variable specifies the variable for extracting, which can be dynamic string.
extract specifies the extracting rules, which can be regex.
Check the following page for regex syntax:
http://erlang.org/documentation/doc-5.0.2/lib/stdlib-1.9.4/doc/html/regexp.html
The regex here also supports group syntax “\\(” and “\\)”.
service and var_names specify the variables to store the extract results.
Most used plugins
svc_variable:compare_variables/9
This plugin redirects to one of several pages depending on the specific attribute
value of ongoing session.
attr specifies the attribute to check.
match specifies the match type, i.e. equal, equal_num, prefix, contain or length.
patterns specifies as many matching rules as you wish, which are separated by “,”.
We always keep “?” as the last rule, which means all other rules don’t match, i.e. the
other condition.
When match is contain, the rules in patterns can be regex.
Check the following page for regex syntax:
http://erlang.org/documentation/doc-5.10.4/lib/stdlib-1.19.4/doc/html/re.html#regexp_sy
ntax
Most used plugins
svc_core:incl_attribute/2
This plugin inserts the value of the specific attribute into page content.
attr specifies the attribute to insert.
Most used plugins
svc_core_ext:set_attribute/5
This plugin stores specific session's variable with public key for a period of time.
key specifies primary key used to store values.
svc_name specifies name space used to get variables.
Note: All the variables with service name equal to svc_name will be stored.
duration specifies the period in seconds of storing data. The valid period range is
0~600s, while default value is 60s.
Most used plugins
svc_transient_data:get_values/3
This plugin gets transient data from database and adds them into ongoing session.
Warning: Existing variables can be overwritten, whose service name and variable name
are same as any variable in database.
key specifies primary key used to get values.
Transient data
It is possible that we need to store some data for a period beyond sessions. We call
these data as transient data.
Cellcube provides a module to store, read and delete transient data.
Every single transient data has an index, which is composed of unique id and a
specific key.
The unique id is the user profile id or msisdn.
The key is specified by plugins’ argument key.
Transient data are only stored for a specific period. After that, i.e. when them
expired, they will be deleted in a short time.
The module periodically scans whole database, and removes the expired transient
data.
Session 1 store/5
Transient
data
Session 2 get_values/3
Most used plugins
svc_multilang:local/4
This plugin gets a text in the language of ongoing session, and inserts it into page
content.
table_root specifies the root prefix of the text resource table.
default_lang specifies the default language of the text to fetch.
text_id specifies the id of the text to fetch.
Most used plugins
svc_multilang:local/4
Check the valid prefixes and text ids from Cellcube Multi-Language Management
table roots
text ids
Most used plugins
svc_sms:sms_mt/10
This plugin sends a Mobile-Terminated Short Message (MT-SM) from the user
starting the ongoing session to the destination address.
destination specifies the Destination Address of the MT-SM.
text specifies the first part of MT-SM content.
routing specifies the first component of the routing attribute of the outgoing
simulated MT-SM.
See config pdist::sms_routing
receipt specifies whether a delivery receipt should be requested to the SMS-C.
service_type specifies the service type. Normally leave it empty.
sms_class specifies the sms class type.
append specifies the second part of MT-SM content.
If the plugin follows a form, this argument automatically takes the form’s input.
Specially send SMS
Sometimes, we need to send SMS from address A to B, while neither A or B started
the ongoing session. In this case, neither plugin svc_sms:sms_mt/10 or
svc_sms:sms_mt_to_sh/10 is suitable to be directly invoked. However, we can
adopt the flow.
svc_variable:set_v2/5 svc_core_ext:set_attribute/5
store session attribute set session attribute
msisdn to variable V msisdn to B
svc_core_ext:set_attribute/5 ok/nok
svc_sms:sms_mt/10
restore session attribute set argument origin
msisdn to V whether the SMS is sent to A
successfully or not
Specially send SMS
svc_variable:set_v2/5 svc_core_ext:set_attribute/5
store session attribute set session attribute
msisdn to variable V msisdn to A
svc_core_ext:set_attribute/5 ok/nok
svc_sms:sms_mt_to_sh/10
restore session attribute set argument
msisdn to V whether the SMS is sent destination to B
successfully or not
Most used plugins
svc_sms_ext:sms_mo_init/9
This plugin simulates a Mobile-Originated Short Message (MO-SM) from the user
starting the ongoing session to the destination address.
text specifies the first part of MT-SM content.
destination specifies the Destination Address of the MT-SM.
routing specifies the first component of the routing attribute of the outgoing
simulated MT-SM.
See config pdist::sms_routing
receipt specifies whether a delivery receipt should be requested to the SMS-C.
service_type specifies the service type. Normally leave it empty.
append specifies the second part of MT-SM content.
If the plugin follows a form, this argument automatically takes the form’s input.
Questions ?