Specifications
Client connection
Returns the valid ClientConnection object if the script code is executed in
the context of a client connection, otherwise null is returned.
Note: The ClientConnection object is available only in context of a client
connection. If there is a client connection which triggered evaluation of
getClientConnection(
) : ClientConnection
a script, then this script returns a valid ClientConnection object after calling
this method. In all other cases, the method getClientConnection returns
null. This means that the ClientConnection currently can be used only in
JavaScript script expressions specified in Metadata properties of Submit
point and Checkpoint flow elements.
Switch class
The single instance of the Switch class is passed as an argument to the script entry points that
operate in the context of a particular flow element. By convention, the name for the Switch
object is “s” (although the script developer can choose to use another name).
Since the Switch class inherits from the Environment class, any of the functions described for
that class can be called for the Switch class as well. In other words, you can call the Environment
class functions with “e.function()” or “s.function()” depending on the argument passed to the
entry point.
Accessing the flow definition
See script element, script declaration and main script properties for background information.
Returns the name of the flow, as displayed in the Flows pane, in
which this script resides.
getFlowName( ) : String
Returns the name of the flow element associated with this script as
displayed in the canvas.
getElementName( ) :
String
Returns a string that uniquely identifies the flow element associated
with this script (within the limits of the guarantees described below).
getElementID ( ) : String
Callers should not rely on the syntax of the returned string as this
may change between Switch versions.
The element ID for a particular flow element offers two fundamental
guarantees:
• It differs from the element ID for any other flow element in any
currently active flow.
• It remains unchanged as long as the flow in which it resides is
not edited, even if the flow is deactivated and reactivated and
across Switch sessions.
Note that holding or releasing connections or renaming the flow
does not count as editing in this context. However, exporting and
re-importing (or upgrading) a flow, or renaming a flow element
inside the flow, does count as editing.
Returns the name of this script as defined in the script declaration.
getScriptName( ) : String
458
Enfocus Switch 10