Symbols

Top  Previous  Next

An MScript symbol may point to different entities depending on how and where it is used.

Syntax:

[[data-type specifier] [source/target specifier]:]symbol-name 
 

data-type specifier

The data types of the symbols are expressed with data-type specifiers which take place before ':' character.

'n' : data type is numeric

'b' : data type is boolean

 

If no data-type specifier is defined for a MScript symbol then its data type is string.

Examples:

n:Count       Numeric symbol

b:Retired     Boolean symbol

Descr         String symbol

 
 

source/target specifier

source/target specifiers specify either the source or the target depending on the function the symbol is used.

Specifier

Meaning

Example

 i

Input Field (Request parameter)

i:Name

 v

Pool Variable

v:Choice

 f

Process Record Field

f:PRODUCT_ID

 a

Current ADOM node

a:Counter

 p

Page Variable

p:REC_ID

 s

Session Variable

s:PERSON_ID

 r:/

Request ADOM node

r:/XXX/YYY

 s:/

Session ADOM node

s:/mor_security_userinfo^1/username

 a:/

Application ADOM node

a:/sysinfo/dbname

 c:

Template Call Parameter

c:ID

 

Examples:

@vof(i:Name)            

@set(f:invalid,'true');

 

If a source specifier is omitted the MScript engine searches the sources in the following order to find a

1.(a:) Current ADOM Node (If available)
2.(f:) Process Record Field (If available)
3.(v:) Pool Variable
4.(c:) Template Call Parameter
5.(p:) Page Variable
6.(s:) Session Variable
7.(i:) Input Field (Request Parameter)

 

If a target specifier is omitted the MScript engine searches the targets in the following order to find a

1.(a:) Current ADOM Node (If available)
2.(f:) Process Record Field (If available)
3.(v:) Pool Variable

 

Data-type specifiers and source/target specifiers can be used together before the ':' character:

Examples:

ni:Count    Numeric Input Field

bf:Retired  Boolean Process Record Field  

 

Focusing to Process Record Fields and Template Call Parameters

From within a child process, it is possible to access to the fields of the outer process records. Each '.' character (except the first one) used before the f: specifier stands for one level outer process record.

 

Examples:

[ID:1, NAME:'Products', DISCOUNT:20]  * Two level outer Record 

  [ID:12, CAT:5]                      * One level outer Record

    [ID:121, NAME:'A4 Laser Printer'] 

    [ID:122, NAME:'A3 Color Printer'] * Current Process Record

 

 

Symbol

Description

Returned Value

f:NAME

Search the "NAME" field in all the nested records and return the value of the first one found.

'A3 Color Printer'

.f:NAME 

Return the value of the "NAME" field from the current record

'A3 Color Printer'

..f:NAME

Return the value of the "NAME" field from the one level outer record

''

...f:NAME

Return the value of the "NAME" field from the two level outer record

'Products'

f:CAT

Search the "CAT" field in all the nested records and return the value of the first one found.

'5'

.f:CAT

Return the value of the "CAT" field from the current record

''

f:DISCOUNT

Search the "DISCOUNT" field in all the nested records and return the value of the first one found.

20

 

 

Similarly from within inner process templates it is possible to access to the parameters of the outer template calls.

<processTemplate name="T1">
  <callTemplate name="T2">
    <param name="ID">23</param>
  </callTemplate>
</processTemplate>
 
<processTemplate name="T2">
  <callTemplate name="T3"/>
    <param name="CAT">1</param>
  </callTemplate>
</processTemplate>
 
<processTemplate name="T3">
  <callProcess name="Logger"/>
</processTemplate>
 
<process name="Logger">
  <param name="mscript">
    @echo(.c:ID)   @// returns ''
    @echo(c:ID)    @// returns '23'
    @echo(.c:CAT)  @// returns '1'
    @echo(c:CAT)   @// returns '1'
  </param>
</process>