Open topic with navigation

TIBCO® BPM Enterprise 5.5.0

# com.tibco.forms.client.FormRunner

The com.tibco.forms.client.FormRunner class provides static utility methods for instantiating the Form class in the custom client application. It also provides access to the Forms logger, which can be used even when no forms are loaded.

For more details on the `logger()` method, see the table at the bottom of this page.

The following methods are supported:

- loadForm()
- loadFormWithRemoteData()

The loadForm() and loadFormWithRemoteData() methods have the same set of input parameters but they differ in the way the initial data are passed. Both the methods are void.

- In loadForm(), the initial data are passed directly as a JSON (JavaScript Object Notation) string.
- In loadFormWithRemoteData(), a URL of the initial JSON data is passed using the initDataURL parameter. The FormRunner retrieves the data from the specified URL.

The details of these methods are as follows:

com.tibco.forms.client.FormRunner Class
Method | Description
--- | ---
    loadForm(
    String url,
    String initialData,
    String bomJSPath,
    String locale,
    String parentNodeId,
    Function onSuccess,
    Function onError,
    Boolean JSONP)
| Loads the form at the specified URL. The parameter details are as follows: `url` - Specifies the URL to the form JSON representation, e.g. "`http://<hostname:port>/bpmresources/com.example.myproject_1.0.0.20201105175821853/wp/openspaceGWTPull_DefaultChannel/openspaceGWTPull_DefaultChannel/FindAddress/GetAddress/Getuserdetails/Getuserdetails.gwt.json`" `initialData` - Specifies the JSON representation of the initial data that are provided to the form. `bomJSPath` - Specifies the root folder path used for loading the BOM JavaScript files used by the form, e.g. "`http://<hostname:port>/bpmresources`" `locale` - Specifies the locale to be used in the form runtime with format <lc>[_<CC>] where [] denotes optionality, e.g. "`en_US`". The locale needs to be represented such that <lc> is a valid two-character lowercase ISO-639 language code and if present the optional <CC> is a valid two-character uppercase ISO-3166 country code. Both '_' and '-' are supported as delimiters. `parentNodeId` - Specifies the DOM identifier of the node to which the form is added. The value cannot be `null.` If you are using an `iframe`, you can pass the ID of the `iframe` element on the page. For more information, see iframe Integration. `onSuccess` - A function that is called once the form is successfully initialized. The Form object is passed into this function. This function can be used to add custom callback handlers that implement lifecycle events such as `submit`, `close`, and `cancel`. `onError` - A function that is called if any errors are encountered in initializing the form. The function will receive any exception that was encountered during the initialization. `JSONP` - Informs the Forms Runtime Adapter to use JSON with Padding (JSONP) when loading JSON resources. The default value is `false`. When the custom client and Forms Runtime Adapter are hosted on different servers, set the JSONP parameter as `true`. In this scenario, there are SOP (Single Origin Policy) issues while loading JSON resources. By using the JSONP technique, the JSON response is wrapped to a call to a function by the server and sent to the client. A JSON resource can then be loaded using a script tag to avoid any SOP violations.
    loadFormWithRemoteData(String url,
    String initDataURL,
    String bomJSPath,
    String locale,
    String parentNodeId,
    Function onSuccess,
    Function onError,
    Boolean JSONP)
| Loads the form at the specified URL. The parameter details are as follows: `url` - Specifies the URL to the form JSON representation, e.g. "`http://<hostname:port>/bpmresources/com.example.myproject_1.0.0.20201105175821853/wp/openspaceGWTPull_DefaultChannel/openspaceGWTPull_DefaultChannel/FindAddress/GetAddress/Getuserdetails/Getuserdetails.gwt.json`". `initDataURL` - Specifies the URL to the form initial data. `bomJSPath` - Specifies the root folder path used for loading the BOM JavaScript files used by the form, e.g. "`http://<hostname:port>/bpmresources`" `locale` - Specifies the locale to be used in the form runtime with format <lc>[_<CC>] where [] denotes optionality, e.g. "en_US". The locale need to be represented such that <lc> is a valid two-character lowercase ISO-639 language code and if present the optional <CC> is a valid two-character uppercase ISO-3166 country code. Both '_' and '-' are supported as delimiters. `parentNodeId` - Specifies the DOM identifier of the node to which the form should be added. The value cannot be `null`. If you are using an `iframe`, you can pass the ID of the `iframe` element on the page. For more information, see iframe Integration. `onSuccess` - A function that is called once the form is successfully initialized. The Form object is passed into this function. This can be used to add custom callback handlers that implement lifecycle events such as `submit`, `close`, and `cancel`. `onError` - A function that is called if any errors are encountered in initializing the form. The function will receive any exception that was encountered during the initialization. `JSONP` - Informs the Forms Runtime Adapter to use JSON with Padding (JSONP) when loading JSON resources. The default value is `false`. When the custom client and Forms Runtime Adapter are hosted on different servers, set the JSONP parameter as `true`. In this scenario, there are SOP (Single Origin Policy) issues while loading JSON resources. By using the JSONP technique, the JSON response is wrapped to a call to a function by the server and sent to the client. A JSON resource can then be loaded using a script tag to avoid any SOP violations.
    renderStaticView()
| Renders a tree representation of the data provided in the `InitialData` parameter. The API has the following parameters: `initialData`: specifies the JSON representation of the initial data that are provided to the form. `bomJSPath`: specifies the root folder path used for loading the BOM JavaScript files used by the form. For example: `http://<hostname:port>/bpmresources` `locale`: specifies the locale to be used in the runtime form with the `<lc>[_<CC>]` format, where `[]` denotes optionality. For example: "en_US". The locale needs to be represented such that `<lc>` is a valid two-character lowercase ISO-639 language code, and, if present, the optional `<CC>` is a valid two-character uppercase ISO-3166 country code. Both '`_`' and '`-`' are supported as delimiters. `parentNodeId`: specifies the DOM identifier of the node to which the form must be added. The value cannot be null. If you are using an `iframe`, you can pass the ID of the `iframe` element on the page. For more information, see iframe Integration. `onSuccess`: is a function that is called after the form is successfully initialized. The Form object is passed into this function. It can be used to add custom callback handlers that implement lifecycle events such as submit, close, and cancel. `onError`: is a function that is called on encountering any error in initializing the form. The function receives the exception encountered during the initialization. `provideCloseAction`: if it is set to `true`, the form is rendered with a button that closes the form and cleans up any resources used. If it is set to `false`, then it is the responsibility of the containing application to clean up the form when it is no longer needed. `JSONP`: informs the Forms Runtime Adapter to use JSON with Padding (JSONP) when loading JSON resources. The default value is `false`. When the custom client and Forms Runtime Adapter are hosted on different servers, set the JSONP parameter to `true`. In this scenario, there are SOP (Single Origin Policy) issues while loading JSON resources. By using the JSONP technique, the JSON response is wrapped as a function by the server and is sent to the client. A JSON resource can then be loaded using a script tag to avoid any SOP violations.

Note: For the list of language codes and country codes required for specifying the locale parameter, visit the following websites:

- List of language codes - http://www.loc.gov/standards/iso639-2/langhome.html
- List of country codes - http://www.iso.org/iso/country_codes/iso_3166_code_lists.html

The details of the `logger()` method are as follows:

com.tibco.forms.client.FormRunner.logger Class
Method | Return Value | Description
--- | --- | ---
    fatal(String message)
| Void | Logs the given messages at the `fatal` logging level.
    error(String message)
| Void | Logs the given messages at the `error` logging level.
    warn(String message)
| Void | Logs the given messages at the `warn` logging level.
    info(String message)
| Void | Logs the given messages at the `info` logging level.
    debug(String message)
| Void | Logs the given messages at the `debug` logging level.
    trace(String message)
| Void | Logs the given messages at the `trace` logging level.
    isFatalEnabled()
| Boolean | Checks whether the `Fatal` logging level is enabled. It returns `true` if the logging level is enabled, and `false` otherwise.
    isErrorEnabled()
| Boolean | Checks whether the `Error` logging level is enabled. It returns `true` if the logging level is enabled, and `false` otherwise.
    isWarnEnabled()
| Boolean | Checks whether the `Warn` logging level is enabled. It returns `true` if the logging level is enabled, and `false` otherwise.
    isInfoEnabled()
| Boolean | Checks whether the `Info` logging level is enabled. It returns `true` if the logging level is enabled, and `false` otherwise.
    isDebugEnabled()
| Boolean | Checks whether the `Debug` logging level is enabled. It returns `true` if the logging level is enabled, and `false` otherwise.
    isTraceEnabled()
| Boolean | Checks whether the `Trace` logging level is enabled. It returns `true` if the logging level is enabled, and `false` otherwise.

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® BPM Enterprise

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