Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# JavaScript Features not Supported in TIBCO BPM Scripting

Certain JavaScript features are not supported.

## New Operator

The `new` operator from JavaScript is not supported. Instead, the `factory` methods must be used to create new instances of classes.

## Switch Statement

The `switch` statement from JavaScript is not supported:

    switch (value) {
        case constant:
             BLOCK;
             break;
        …
        default:
             BLOCK;
             break
    }

Instead, an `if () {} else if () {} …` statement should be used.

## try/catch Statement

The `try/catch` statement is not supported:

    try {
            BLOCK;
    }
    catch (error) {
            BLOCK;
    }
    Finally {
            BLOCK;
    }

The only way to catch an exception in a script is to catch the error on ScriptTask or another task.

## JavaScript Functions

JavaScript functions are not supported. Code must be written out in full.

## JavaScript RegExp Object

The JavaScript `RegExp` object is not supported. For example, the Text field `replace()` method only supports string substitution, not the substitution of a pattern matched by a regular expression.

## "==="operator

The === operator (same value and type) is not supported.

## JavaScript Arrays

Using [ ] for array indices is not supported, as there is no way to create JavaScript arrays in TIBCO Cloud BPM. Instead, the List type is used. Consequently, the following loop is not supported:

    for (FIELD in ARRAYFIELD) {
             BLOCK;
    }

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.