server
JSON object that stores information about the workflow context of the server-side process.
Syntax
{
b2C : WorkflowServerB2CObject;
bus : WorkflowServerBusObject;
clientCertificates : WorkflowClientCertificatesObject;
convert : WorkflowServerObjectConvert;
cryptography : WorkflowServerObjectCryptography;
data : WorkflowDataObject;
date : WorkflowServerDateUtilsObject;
files : WorkflowServerObjectFiles;
identityProvider: WorkflowServerObjectIdentityProvider;
localization : WorkflowServerLocalizationObject;
metadata : WorkflowMetadataObject;
request : WorkflowServerRequest;
text : WorkflowServerObjectText;
transientData : WorkflowTransientDataObject;
user : WorkflowUserObject;
xml : WorkflowServerObjectXml;
xss : WorkflowServerObjectXss;
}
Properties
All properties are read-only.
| Property | Type | Description |
|---|---|---|
b2C
|
WorkflowServerB2CObject | Facilitates working with B2C portals. |
bus
|
WorkflowServerBusObject | |
clientCertificates
|
WorkflowClientCertificatesObject | See ftos.utils.getCertificate. |
convert
|
WorkflowServerObjectConvert | Encodes and decodes binary data and text with various encodings. |
cryptography
|
WorkflowServerObjectCryptography | Calculates hash values and message authentication codes (MACs) for IFtosWorkflowBlob objects. |
data
|
WorkflowDataObject | Returns an entity extension's attributes and values. |
date
|
WorkflowServerDateUtilsObject | |
files
|
WorkflowServerObjectFiles | Allows you to load the content of a text file in a WorkflowTextFileReader object for processing. |
identityProvider |
WorkflowServerObjectIdentityProvider | Allows you to log out or force a password reset for a user account. |
localization
|
WorkflowServerLocalizationObject | Localization setting that the client is currently using. |
metadata
|
WorkflowMetadataObject | Information about entity forms. |
request |
WorkflowServerRequest | Information about the client running the workflow. |
text
|
WorkflowServerObjectText | |
transientData
|
WorkflowTransientDataObject | Information about a transient entity's data. |
user
|
WorkflowUserObject | Information about the user account of the currently logged client. |
xml
|
WorkflowServerObjectXml | Allows you to parse XML content. |
xss
|
WorkflowServerObjectXss | Provides HTML sanitization against cross-site scripting. |
Type Aliases
Facilitates working with B2C portals which expose specific digital journeys to unauthenticated users. Starting with v24.3, this is renamed from b2csessionID to ftos.context.user.b2cSessionId.
{
ContextUser.b2CSessionId : string;
createTemporaryIdentity (journeyName: string, culture: string): ITemporaryIdentity;
deleteTemporaryIdentity (userId: string): ITemporaryIdentityDeletion;
migrateSessionDataToUser (sourceSessionId: string, targetUserId: string, targetBusinessUnitId: string): void
}
| Parameter | Type | Description |
|---|---|---|
ContextUser.b2CSessionId
|
string | ID of the anonymous session. |
Methods
Creates a temporary user account for an anonymous user journey.
| Parameter | Type | Description |
|---|---|---|
journeyName
|
string | Name of the anonymous user journey for which to create the temporary user account. |
culture
|
string | ISO country code used for localizing the journey in a specific language. |
For more details, see ftos.identity.users.createTemporary.
Deletes a temporary user account used for an anonymous user journey. You need admin rights to run this method.
| Parameter | Type | Description |
|---|---|---|
userId
|
string | ID of the temporary user account to be deleted. One or more users can be entered as parameter. |
For more details, see ftos.identity.users.deleteTemporary.
Assigns data ownership for the records in an anonymous session to a platform user account (populates the createdByUserId, modifiedByUserId, userId, businessUnitId attributes with the corresponding user ID and business unit ID).
Starting with v24.3, this is renamed from migrateSessionDataToUser to ftos.data.migrateSessionDataToUser.
The user account running the method needs update access rights to session's records stored in the B2CExternalProcess entity. E.g.: a user with admin rights.
| Parameter | Type | Description |
|---|---|---|
sourceSessionId | string | ID of the anonymous session. |
targetUserId | string | ID of the user account to be assigned data ownership for the session records. |
targetBusinessUnitId? | string | ID of the business unit used to populate the records' businessUnitId attribute. If not specified, applies the target user's default business unit. |
{
receive(source : WorkflowServerBusObjectReceiveSource): WorkflowServerBusObjectReceivedMessage;
send(message : WorkflowServerBusObjectSendMessage): void;
}
Starting with v24.3, this is will be removed.
{
origin? : string;
topic? : string;
}
Starting with v24.3, this is will be removed.
{
readonly body : any;
readonly correlationId : string;
readonly errorMessage : any;
readonly id : number;
readonly messageId : string;
readonly origin : string;
readonly subject : string;
readonly topic : string;
readonly transactionId : string;
complete(): void;
}
Starting with v24.3, this is will be removed.
{
body : string;
correlationId? : string;
destination? : string;
subject : string;
topic : string;
}
Encodes and decodes binary data and text with various encodings.
{
ftos.convert.base64.toString(base64 : string, encoding : string): string;
ftos.convert.string.toBase64(s : string): string;
ftos.convert.string.toByteArray(input : string, encoding : string): IFtosWorkflowBlob;
ftos.convert.base64.toByteArray(base64 : string): IFtosWorkflowBlob;
ftos.convert.base64.toHex(input : string): string;
toBase64FromHex(input : string): string;
ftos.convert.byteArray.toHex(input: IWorkflowBlob): string;
ftos.convert.hex.toByteArray(input: string): IWorkflowBlob
}
Methods
Converts a Base64 encoded string to a JavaScript string using a specified encoding.
Starting with v24.3, this is renamed from fromBase64 to ftos.convert.base64.toString.
| Parameter | Type | Description |
|---|---|---|
base64
|
string | Base64-encoded input string. |
encoding
|
string | Encoding of the output string:
|
Converts an ASCII-encoded string to the Base64 encoding scheme.
Starting with v24.3, this is renamed from toBase64StringFromAscii to ftos.convert.string.toBase64.
| Parameter | Type | Description |
|---|---|---|
s
|
string | ASCII-encoded input string. |
Converts an input string with a specified encoding to an IFtosWorkflowBlob object.
Starting with v24.3, this is renamed from toBlob to ftos.convert.string.toByteArray.
| Parameter | Type | Description |
|---|---|---|
input
|
string | Input string. |
encoding
|
string | Encoding of the input string:
|
Converts a Base64 encoded string to an IFtosWorkflowBlob object.
Starting with v24.3, this is renamed from toBlobFromBase64 to ftos.convert.base64.toByteArray.| Parameter | Type | Description |
|---|---|---|
base64 | string | Base64-encoded input string. |
Converts a Base64 encoded string to its hexadecimal string representation.
Starting with v24.3, this is renamed from toHexFromBase64 to ftos.convert.base64.toHex.
| Parameter | Type | Description |
|---|---|---|
input
|
string | Base64-encoded input string. |
Converts a hexadecimal string representation to a Base64 encoded string.
Starting with v24.3, this is renamed from toBase64FromHex to ftos.convert.hex.toBase64.
| Parameter | Type | Description |
|---|---|---|
input
|
string | Hexadecimal string representation. |
Converts an IFtosWorkflowBlob object to a hexadecimal string representation.
Starting with v24.3, this is renamed from toHexFromBlob to ftos.convert.byteArray.toHex.
| Parameter | Type | Description |
|---|---|---|
input | IFtosWorkflowBlob | Blob object to be converted to a hexadecimal string. |
Converts a hexadecimal string representation to an IFtosWorkflowBlob object.
Starting with v24.3, this is renamed from toBlobFromHex to ftos.convert.hex.toByteArray.
| Parameter | Type | Description |
|---|---|---|
input
|
string | Hexadecimal string representation. |
Blob object containing a "length" property that indicates its size in kilobytes.
{
readonly length : number;
toBase64(): string;
toStream(): any;
}
| Property | Type | Description |
|---|---|---|
length
|
number | File's size in kilobytes. |
Methods
Converts the Blob object to a Base64 encoded string.
Not intended for developer use.
Calculates hash values and message authentication codes (MACs) for IFtosWorkflowBlob objects.
Methods
Calculates the hash for an IFtosWorkflowBlob objects using Secure Hash Algorithms (SHA) cryptographic hash functions and returns the resulting value as IFtosWorkflowBlob.
Starting with v24.3, this is renamed from hash to ftos.cryptography.hash.
| Property | Type | Description |
|---|---|---|
input
|
IFtosWorkflowBlob | Blob object to be hashed. |
hashAlgorithm
|
string | SHA function used for hashing: md5, sha1, sha256, 2ha384, or sha512. |
Calculates the MAC for an IFtosWorkflowBlob objects using Hash-Based Message Authentication Code (HMAC) message authentication codes and returns the resulting value as IFtosWorkflowBlob.
Starting with v24.3, this is renamed from hmac to ftos.cryptography.hmac.
| Property | Type | Description |
|---|---|---|
input
|
IFtosWorkflowBlob | Blob object to be hashed. |
key
|
IFtosWorkflowBlob | Blob object storing the cryptographic key used for hashing. |
hashAlgorithm
|
string | SHA function used for hashing: md5, sha1, sha256, 2ha384, or sha512. |
Returns an entity extension's attributes and values.
Methods
Returns an object containing an entity extension's attributes and values.
Starting with v24.3, this is renamed from loadExtension to ftos.data.loadExtension.
| Property | Type | Description |
|---|---|---|
entityName
|
string | Name of the entity extension's parent entity. |
extentionName
|
string | Name of the entity extension. |
viewName(optional)
|
string | Name of the transient entity's view. To be used with entity extensions linked to transient data entities of type collection. |
recordId
|
string | Record ID for which the extension's attributes and values are retrieved. |
Allows you to load the content of a text file in a WorkflowTextFileReader object for processing.
Methods
Creates a WorkflowTextFileReader object that can be used to read a UTF-8 encoded text file.
| Property | Type | Description |
|---|---|---|
fileName
|
string | Path to the file, including the file extension. The root folder in the file path is the default upload folder. The default upload folder is UploadEBS, unless configured differently in the Web.config file ( <add key="UploadFolder" value="~/Uploads" />). |
Creates a WorkflowTextFileReader object that can be used to read a text file with a specific encoding.
| Property | Type | Description |
|---|---|---|
fileName
|
string | Path to the file, including the file extension. The root folder in the file path is the default upload folder. The default upload folder is UploadEBS, unless configured differently in the Web.config file ( <add key="UploadFolder" value="~/Uploads" />). |
encoding
|
string | The name of one of the encodings supported by the .NET Framework. |
Creates a WorkflowTextFileReader object that can be used to read a text file with a specific encoding (specified using the encoding's code page).
| Property | Type | Description |
|---|---|---|
fileName
|
string | Path to the file, including the file extension. The root folder in the file path is the default upload folder. The default upload folder is UploadEBS, unless configured differently in the Web.config file ( <add key="UploadFolder" value="~/Uploads" />). |
codePage
|
string | The code page of one of the encodings supported by the .NET Framework. |
Allows you to log out the current user or force a password reset for a user account. Starting with v24.3, this is renamed from forcePasswordChangeAtLogin to ftos.identity.authn.forcePasswordReset.
Methods
Requests a user to update his password on the next login.
| Property | Type | Description |
|---|---|---|
userName
|
string | User account that the password reset will be applied on. |
Sends an email with a password reset link to a FintechOS Identity Provider user.
| Property | Type | Description |
|---|---|---|
userName
|
string | User account that the password reset link will be sent to. The user account must be enabled via FintechOS Identity Provider. |
Object that can be used to read the content of a text file.
{
EOF : boolean;
}
| Property | Type | Description |
|---|---|---|
EOF(readonly)
|
boolean |
HINT
Use this property in conjunction with the readLine() method to parse a file line-by-line until reaching the end. For example, see Extract error messages from a log file into an array. |
Methods
Returns all the file's content in a string.
Avoid using this method for large files.
Reads the current line from the file in a WorkflowTextFileLine object and advances the reading cursor to the next line.
Use this method in conjunction with the EOF property to parse a file line-by-line until reaching the end. For example, see Extract error messages from a log file into an array.
Disposes the WorkflowTextFileReader object.
{
text : string;
}
| Property | Type | Description |
|---|---|---|
text(readonly)
|
string | String containing a line of a WorkflowTextFileReader object. |
Localization setting that the client is currently using.
{
ContextRequest.culture : string;
}
| Property | Type | Description |
|---|---|---|
ContextRequest.culture (readonly) |
string | Client's current localization, such as en-GB or ro-RO. |
Starting with v24.3, this is renamed from GetForm to ftos.metadata.getForm.
{
Metadata.getForm(entityName : string, formName : string): WorkflowUserJourneyMetadata;
}
{
readonly form : WorkflowUserJourneyMetadataForm;
readonly sections : any[];
}
{
fields : WorkflowUserJourneyMetadataField[];
name : string;
}
{
name: string;
displayName: string;
type: 'Bool' | 'Color' | 'Date' | 'Date Time' | 'File' |
'Html' | 'Icon Picker' | 'Js' | 'json' | 'Lookup' | 'Map' |
'Money' | 'Numeric' | 'Option Set' | 'Order Index' | 'Pk' |
'Regarding Lookup' | 'Text' | 'Text Area' | 'Whole Number';
defaultValue: string | WorkflowUserJourneyMetadataLookupValue;
requiredLevel: 'None' | 'Recommended' | 'Required';
lookupValues: WorkflowUserJourneyMetadataLookupValue[];
isReadOnly?: boolean;
}
{
id: string;
displayName: string;
}
Starting with v24.3, this is renamed from clientIP to ftos.context.request.clientIp, and from headers to ftos.context.request.headers.
If the client is connected through a VPN, the client’s actual IP address will not be visible; instead, the VPN’s IP address will be shown.
{
ContextRequest.clientIp : string;
ContextRequest.headers : any;
}
| Property | Type | Description |
|---|---|---|
ContextRequest.clientIp
|
string | IP address of the client machine running the workflow. |
ContextRequest.headers |
any | HTTP request headers sent by the client calling the server-side process. |
Starting with v24.3, this is renamed from createRegex to ftos.regex.create.
{
ftos.regex.create(pattern : string | RegExp, options : WorkflowRegexOption[]): WorkflowRegex;
}
declare type WorkflowRegexOption = 'singleLine' | 'multiLine' | 'ignoreCase';
{
readonly options : string[];
getGroupNames(): string[];
getGroupNumbers(): number[];
groupNameFromNumber(i : number): string;
groupNumberFromName(name : string): number;
isMatch(input : string): boolean;
isMatch(input : string, startAt : number): boolean;
match(input : string): any;
match(input : string, startAt : number): WorkflowRegexMatch;
match(input : string, beginning : number, length : number): WorkflowRegexMatch;
matches(input : string): WorkflowRegexMatch[];
matches(input : string, startAt : number): WorkflowRegexMatch[];
replace(input : string, replacement : string): string;
replace(input : string, replacement : string, count : number, startAt : number): string;
replace(input : string, evaluator : WorkflowRegexMatchEvaluator): string;
replace(input : string, evaluator : WorkflowRegexMatchEvaluator, count : number): string;
replace(input : string, evaluator : WorkflowRegexMatchEvaluator, count : number, startAt : number): string;
split(input : string): any;
split(input : string, count : number): any;
split(input : string, count : number, startAt : number): any;
}
{
readonly groups : WorkflowRegexGroupCollection;
readonly index : number;
readonly length : number;
readonly success : boolean;
readonly value : string;
nextMatch(): WorkflowRegexMatch;
}
declare type WorkflowRegexMatchEvaluator = (match : WorkflowRegexMatch) => string;
declare type WorkflowRegexGroupCollection = WorkflowRegexGroupCollectionIndexers & WorkflowRegexGroupCollectionNoIndexers;
{
readonly [index : number] : WorkflowRegexGroup;
readonly [index : string] : WorkflowRegexGroup;
}
{
readonly count : number;
readonly values : WorkflowRegexGroup[];
}
{
captures : WorkflowRegexCapture[];
index : number;
length : number;
success : boolean;
value : string;
}
{
index : number;
length : number;
value : string;
}
Information about a transient entity's data.
Methods
Returns an object containing the attributes' names and values for a transient data entity with customized input parameters.
Starting with v24.3, this is renamed from load to ftos.data.loadTransientData.
| Parameter | Type | Description |
|---|---|---|
transientEntityName | string | Name of the transient data entity. |
parameters | any | A key-value object with the customized input parameters required by the transient data entity's automation script for load. |
Information about the user account of the currently logged client.
Starting with v24.3, this is renamed from id to ftos.context.user.id, from name to ftos.context.user.name, from roles to ftos.context.user.roles, from isLockedOut to ftos.context.user.isLockedOut, from businessUnitContext to ftos.context.user.businessUnitContext.
{
ContextUser.id? : string;
ContextUser.name : string;
ContextUser.roles : string[];
ContextUser.IsLockedOut : boolean;
ContextUser.businessUnitContext: IServerUserBusinessUnitContext
}
| Property | Type | Description |
|---|---|---|
ContextUser.id (optional) |
string | ID of the user account record. |
ContextUser.name
|
string | Name of the user account. |
ContextUser.roles
|
string[] | Array of strings representing the roles assigned to the user account. |
ContextUser.IsLockedOut
|
boolean |
|
ContextUser.businessUnitContext
|
IServerUserBusinessUnitContext |
{
issuer : string;
type : string;
value : string;
valueType : string;
}
Business unit of the currently logged client.
{
id : string;
name : string
}
| Parameter | Type | Description |
|---|---|---|
id
|
string | ID of the business unit assigned to the user account of the currently logged client. |
name
|
string | Name of the business unit assigned to the user account of the currently logged client. |
Allows you to parse XML content.
Methods
Loads an XML string into an XDocumentWrapper object.
Starting with v24.3, this is renamed from load to ftos.xml.load.
| Parameter | Type | Description |
|---|---|---|
xml | string | XML formatted string. |
Loads a JSON object into an XDocumentWrapper object. The JSON object will be serialized under the <root> element of the XDocumentWrapper. Starting with v24.3, this is renamed from serialize to ftos.xml.serialize.
| Parameter | Type | Description |
|---|---|---|
obj
|
any | JSON object. |
Loads a JSON object into an XDocumentWrapper object. The JSON object will be serialized under the <root> element of the XDocumentWrapper. Starting with v24.3, this is renamed from serialize to ftos.xml.serialize.
| Parameter | Type | Description |
|---|---|---|
obj
|
any | JSON object. |
options
|
any | Serialization options. |
XML Document object based on the XDocument class.
{
root : XElementWrapper;
}
| Property | Type | Description |
|---|---|---|
root
|
XElementWrapper | Root node of the XDocumentWrapper. |
Methods
Returns the contents of the XML document in string format.
Runs an XPath query on the XML document and returns the resulting XML elements in an array of XElementWrapper objects.
| Parameter | Type | Description |
|---|---|---|
xpath
|
string | Path expression of the XPath query. |
Runs an XPath query with namespaces on the XML document and returns the resulting XML elements in an array of XElementWrapper objects.
| Parameter | Type | Description |
|---|---|---|
xpath
|
string | Path expression of the XPath query. |
namespaces
|
any | JSON object that associates namespace URIs with XML element names. |
XML element that is part of an XDocumentWrapper XML document object.
{
attributeCount : number;
elementCount : number;
hasAttributes : boolean;
hasElements : boolean;
[index : string] : any;
name : string;
namespace : string;
value : string;
}
| Property | Type | Description |
|---|---|---|
attributeCount
|
number | Number of attributes of the XML element. |
elementCount
|
number | Number of child elements. |
hasAttributes
|
boolean |
|
hasElements
|
boolean |
|
index : string
|
any | Returns an attribute's value based on its key. To specify a namespace for the attribute, use the following syntax:'{namespace URI}key' |
name
|
string | Name of the XML element. |
namespace
|
string | Namespace associated with the XML element. |
value
|
string | Value of the XML element. |
Methods
Returns all child elements in an array of XElementWrapper objects.
Returns all child elements with a specific name in an array of XElementWrapper objects.
| Parameter | Type | Description |
|---|---|---|
name
|
string | Name of the child elements. To specify a namespace for the name, use the following syntax:'{namespace URI}key' |
Runs an XPath query on the XML element and returns the resulting XML elements in an array of XElementWrapper objects.
| Parameter | Type | Description |
|---|---|---|
xpath
|
string | Path expression of the XPath query. |
Runs an XPath query with namespaces on the XML element and returns the resulting XML elements in an array of XElementWrapper objects.
| Parameter | Type | Description |
|---|---|---|
xpath
|
string | Path expression of the XPath query. |
namespaces
|
any | JSON object that associates namespace URIs with XML element names. |
Provides HTML sanitization against cross-site scripting.
Methods
Returns a string of sanitized of HTML code. Removes JavaScript, styling and scripts tags, inline JavaScript, and comments.
Starting with v24.3, this is renamed from sanitizeHTML to ftos.utils.html.sanitize.
This is a best-effort sanitization only. For complete security, it is recommended to integrate with a third-party dedicated security service or app.
| Parameter | Type | Description |
|---|---|---|
html | string | HTML code to sanitize against cross-site scripting. |
Examples
In this example:
- We extract the content of the myLog.txt file, which is stored in the logs folder, in a variable called content.
- We define an array called errors, which will store the error messages from the log file.
- We iterate over the log file's content line-by-line and, if the line starts with the word error, we store it in the errors array.
- We then clean up memory space by disposing of the content variable.
let content = ftos.files.getTextReader('logs/myLog.txt');
let errors = [];
while (!(content.EOF)) {
let line = content.readLine().text;
if (line.substring(0, 5) == 'error') {
errors.push(line)
}
}
content.dispose()