T4S4  18.1 C7177 A20283
Teamcenter Gateway for SAP S/4HANA API Reference
TestScript Namespace Reference

Functions

 defineScriptParamCombo name description optionList args
 Assigns a combo parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamDate name description args
 Assigns a date parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamEditCombo name description optionList args
 Assigns an editable combo parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamFileCombo name description args
 Assigns a file combo parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamGroup controllerParam controlledParamListList
 Assigns a group parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamList name description optionList args
 Assigns a list parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamMultiList name description optionList args
 Assigns a multi list parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamNumber name description args
 Assigns a number parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamPasswordText name description args
 Assigns a password text parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamSeparator name description args
 Adds a separator or headline to a script GUI (for new script format, T4x version >= 10) More...
 
 defineScriptParamText name description args
 Assigns a text parameter to a script (for new script format, T4x version >= 10) More...
 
 defineScriptParamTimeDate name description args
 Assigns a time date parameter to a script (for new script format, T4x version >= 10) More...
 
 setScriptCategoryList categoryList
 Sets a list of categories for a script. More...
 
 setScriptComment comment
 Sets a comment for a script. More...
 
 setScriptDesc description
 Sets a description for a script. More...
 
 setScriptDictionary dictionary
 Sets a dictionary for a script (for new script format, T4x version >= 10) More...
 
 setScriptFlavour flavour
 Sets a flavour for a script. More...
 
 setScriptGui paramList
 Assigns a list of representations of parameters as GUI to a script (for new script format, T4x version >= 10) More...
 
 setScriptTagList tagList
 Sets a list of tags for a script. More...
 

Variables

 categoryList
 
 comment
 
 desc
 
 dictionary
 
 flavour
 
 format
 
 param
 
 tagList
 

Function Documentation

◆ defineScriptParamCombo()

TestScript::defineScriptParamCombo   name description optionList args  

Assigns a combo parameter to a script (for new script format, T4x version >= 10)

Combo parameters are displayed in the script GUI as drop down box, allowing to select from a specified set of values. It is possible to select exactly one value.

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
optionList: the set of allowed values
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
  • -external <list of values>, a list of allowed values displayed in the script GUI
  • -externalkey <list of values>, a list of key values of the dictionary in order to have language-specific allowed values in the script GUI
Returns
a representation of the parameter

◆ defineScriptParamDate()

TestScript::defineScriptParamDate   name description args  

Assigns a date parameter to a script (for new script format, T4x version >= 10)

Date parameters are displayed in the script GUI as text box. A date picker appears when the text box is clicked, allowing the select a date

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
Returns
a representation of the parameter

◆ defineScriptParamEditCombo()

TestScript::defineScriptParamEditCombo   name description optionList args  

Assigns an editable combo parameter to a script (for new script format, T4x version >= 10)

Editable combo parameters are displayed in the script GUI as drop down box, allowing

  • to select from a specified set of values
  • to specify an arbitrary text value It is possible to select or to specify exactly one value.
Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
optionList: the set of allowed values
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
  • -external <list of values>, a list of allowed values displayed in the script GUI
  • -externalkey <list of values>, a list of key values of the dictionary in order to have language-specific allowed values in the script GUI
Returns
a representation of the parameter

◆ defineScriptParamFileCombo()

TestScript::defineScriptParamFileCombo   name description args  

Assigns a file combo parameter to a script (for new script format, T4x version >= 10)

File combo parameters are displayed in the script GUI as drop down box, allowing to select from a specified set of values. The set of allowed values is determined at run-time as the set of files in the T4x upload folder. It is possible to select exactly one value.

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
Returns
a representation of the parameter

◆ defineScriptParamGroup()

TestScript::defineScriptParamGroup   controllerParam controlledParamListList  

Assigns a group parameter to a script (for new script format, T4x version >= 10)

Group parameters are not displayed in the script GUI as a widget, but as a group of widgets separated from other parameter entry fields by somewhat larger spaces before and below the group. Groups are meaningful for the script GUI only and are ignored when executing a script from the the command line. A group consists of the following:

  • a "contoller" combo widget
  • lists of "controlled" widgets; each list is called a "branch" There are the following restrictions:
  • controlled widgets can be of any type, except groups.
  • there must be as many branches as values in the controller. Depending on the currently selected value of the controller combo widget:
  • the branch of widgets assigned to that value is shown
  • other branches are hidden
Parameters
controllerParam: the representation of a combo parameter to be used as controller
controlledParamListList: the list of lists of representations of parameters to be used as list of controlled branches
Returns
a representation of the parameter

◆ defineScriptParamList()

TestScript::defineScriptParamList   name description optionList args  

Assigns a list parameter to a script (for new script format, T4x version >= 10)

List parameters are displayed in the script GUI as selection box, allowing to select from a specified set of values. It is possible to select exactly one value, or no value.

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
optionList: the set of allowed values
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
  • -external <list of values>, a list of allowed values displayed in the script GUI
  • -externalkey <list of values>, a list of key values of the dictionary in order to have language-specific allowed values in the script GUI
  • -size <value>, the number of available values displayed in the script GUI at the same time
Returns
a representation of the parameter

◆ defineScriptParamMultiList()

TestScript::defineScriptParamMultiList   name description optionList args  

Assigns a multi list parameter to a script (for new script format, T4x version >= 10)

Multi list parameters are displayed in the script GUI as selection box, allowing to select from a specified set of values. It is possible to select one or more values, or no value.

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
optionList: the set of allowed values
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
  • -external <list of values>, a list of allowed values displayed in the script GUI
  • -externalkey <list of values>, a list of key values of the dictionary in order to have language-specific allowed values in the script GUI
  • -size <value>, the number of available values displayed in the script GUI at the same time
Returns
a representation of the parameter

◆ defineScriptParamNumber()

TestScript::defineScriptParamNumber   name description args  

Assigns a number parameter to a script (for new script format, T4x version >= 10)

Number parameters are displayed in the script GUI as text box, allowing to specify a numeric value.

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is displayed in the script GUI for the text box initially
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
  • -placeholder <value>, a placeholder value which is displayed in the script GUI when the text box is empty
  • -integer, if the parameter is required to be an integer number
  • -min <value>, a minimum value for the parameter
  • -max <value>, a maximum value for the parameter
Returns
a representation of the parameter

◆ defineScriptParamPasswordText()

TestScript::defineScriptParamPasswordText   name description args  

Assigns a password text parameter to a script (for new script format, T4x version >= 10)

Password text parameters are displayed in the script GUI as text box, allowing to specify a password value. Characters in the password text box are shown as asteriscs.

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is displayed in the script GUI for the text box initially
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
  • -placeholder <value>, a placeholder value which is displayed in the script GUI when the text box is empty
Returns
a representation of the parameter

◆ defineScriptParamSeparator()

TestScript::defineScriptParamSeparator   name description args  

Adds a separator or headline to a script GUI (for new script format, T4x version >= 10)

Separator parameters are displayed in the script GUI as a horizontal line or a headline label allowing to specify an arbitrary text value

Parameters
name: the variable assigned to the parameter; for a separator this is obviously not relevant, as no values can be selected or entered, but for identification of the gui elements this name must not be empty and should be unique
description: the label displayed in the script GUI for the parameter
  • if a non-empty description is specified for the separator, a headline will be shown
  • specify an empty description to get a simple horizontal line
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -height <value>, separator height; this option is only relevant for horizontal lines and specifies the thickness of the line
  • -key <value>, a key value from the dictionary in order to have language-specific headlines in the script GUI (only relevant for headlines)
  • -level <value>, with a value between 1 and 6 specifies the headline level in decreasing order, i. e. level 1 is most important level 6 least; obviously this option is only relevant for headlines.
Returns
a representation of the parameter

◆ defineScriptParamText()

TestScript::defineScriptParamText   name description args  

Assigns a text parameter to a script (for new script format, T4x version >= 10)

Text parameters are displayed in the script GUI as text box, allowing to specify an arbitrary text value

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is displayed in the script GUI for the text box initially
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
  • -placeholder <value>, a placeholder value which is displayed in the script GUI when the text box is empty
Returns
a representation of the parameter

◆ defineScriptParamTimeDate()

TestScript::defineScriptParamTimeDate   name description args  

Assigns a time date parameter to a script (for new script format, T4x version >= 10)

Time date parameters are displayed in the script GUI as text box. A time-date picker appears when the text box is clicked, allowing the select a date with a time

Parameters
name: the variable assigned to the parameter
description: the label displayed in the script GUI for the parameter
args: (optional) the following additional arguments (preceded by a "minus" symbol):
  • -key <value>, a key value of the dictionary in order to have a language-specific label in the script GUI
  • -default <value>, a default value which is selected initially when displayed in the script GUI
  • -required, if the parameter is required; if required, the "empty string" is not allowed as parameter value
Returns
a representation of the parameter

◆ setScriptCategoryList()

TestScript::setScriptCategoryList   categoryList  

Sets a list of categories for a script.

Scripts can have categories which can be used for filtering.

Parameters
categoryList: list of categories

◆ setScriptComment()

TestScript::setScriptComment   comment  

Sets a comment for a script.

Scripts can have a comment which is displayed when pressing the help button. Comments can be specified in two ways: 1) by providing a string literal 2) by providing a variable

The second way, illustrated below, is the way to go, when non-trivial comments are provided.

Parameters
comment: the comment
1 set scriptComment {
2  <h1>My function</h1>
3  <p>Use HTML as you like.</p>
4  <p>Comments can easily extend over more than just one line.</p>
5 }

◆ setScriptDesc()

TestScript::setScriptDesc   description  

Sets a description for a script.

Scripts have a description which is displayed in the script overview

Parameters
description: the description

◆ setScriptDictionary()

TestScript::setScriptDictionary   dictionary  

Sets a dictionary for a script (for new script format, T4x version >= 10)

Scripts can have a script dictionary. The script dictionary can be used to generate:

  • language-specific script GUIs
  • language-specific script output
Parameters
dictionary: the dictionary

◆ setScriptFlavour()

TestScript::setScriptFlavour   flavour  

Sets a flavour for a script.

Scripts have a flavour which is displayed as icon in the script overview. If no flavour is specified, then implicitly the flavour is "T4X"

Parameters
flavour: the flavour, which can be - among others - one of the following: T4X, T4S, T4O, T4EA, TE4S

◆ setScriptGui()

TestScript::setScriptGui   paramList  

Assigns a list of representations of parameters as GUI to a script (for new script format, T4x version >= 10)

Parameters
paramList: a list of representations of parameters
Returns
1=ok 0=error

◆ setScriptTagList()

TestScript::setScriptTagList   tagList  

Sets a list of tags for a script.

Scripts can have tags which can be used for filtering.

Parameters
tagListlist of tags

Variable Documentation

◆ categoryList

categoryList
static

◆ comment

comment
static

◆ desc

desc
static

◆ dictionary

dictionary
static

◆ flavour

flavour
static

◆ format

format
static

◆ param

param
static

◆ tagList

tagList
static