Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 30

Cellcube Service Maintaining

Confidential Myriad Group


06/23/2020 2
Most used plugins
There are hundreds of plugins composing services.
Check SCE2’s help: file:///${SCE2_ROOT}/doc/htmlhelp/index.html
Check the tips by hover mouse over the link:
Most used plugins
We calculate the usage of plugins, and introduce most used ones.

svc_variable:set_v2/5, set_v2/6 svc_gsm:transform_msisdn/7

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:change_service/2, change_service/3 svc_multilang:local/4

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

Like redir_by_variable/5, redir_by_variable_if_defined/6 also check whether the


specific variable exists. If the variable doesn’t exist:
redir_by_variable/5 checks whether rule “?” is defined. If defined, redirect to the link,
otherwise the session crashed.
redir_by_variable_if_defined/6 redirects to the link with label variableNotFound.
Most used plugins
svc_variable:incl/3

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 compares two variables in ongoing session according to a matching


criteria.
match specifies the match type, i.e. equal, prefix, suffix or contain.
service1 and name1 specify the first variable to compare.
service2 and name2 specify the second variable to compare.
When match is contain, the second variable 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
compare_variables/9 redirects to ok link if the two variables are matches, to nok
link if not, to error link on errors.
compare_variables/8 messes up the nok link and error link.
Most used plugins
svc_core:change_service/2, change_service/3

These plugins redirect to another service, or a specific page in another service.


svc specifies the path of another service.
tag specifies the page tag inside another service.
The plugins also can redirect to remote service by setting an URL like http://... or
https://... in svc. The plugins will search the config pserver::xmlhttp_hosts, and
execute the remote service only if the URL matches any rule in the config.
Most used plugins
svc_core:redir_by_attribute/4

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 changes the attribute value of the ongoing session.


attr specifies the attribute to modify.
new_value specifies the new value of the attribute.
Most used plugins
svc_arithmetic:arithmetic/9

This plugin executes arithmetical operation (+,-,*,/).


left_operand and right_operand specify the operands for arithmetic. They are
dynamic string.
service_name and result specify the variable to store arithmetical result.
operator specifies the operator.
decimal_places specifies the number of decimal.
Most used plugins
svc_arithmetic:compare/7

This plugin executes arithmetical comparison (>,>=,==,<,=<).


left_operand and right_operand specify the operands for arithmetic. They are
dynamic string.
operator specifies the operator.
Most used plugins
svc_gsm:transform_msisdn/7

This plugin transforms a MSISDN into national or international format depending


on config pservices::msisdn_translate_rules.
transform specifies whether the input number should be transformed into national
or international format.
service_out and name_out specify the variable to store transform result.
number specifies the MSISDN to transform. It is dynamic string.
Most used plugins
svc_transient_data:store/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) to the user


starting the ongoing session.
origin specifies the Originating 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.
Most used plugins
svc_sms:sms_mt_to_sh/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 ?

Confidential Myriad Group


06/23/2020 29
Thank You !

You might also like