FormRedirect

FormRedirect.htm performs tasks that load the Forms Runtime Adapter and create the onTIBCOFormRunnerLoad function.

Loading the Forms Runtime Adapter

The SCRIPT_LOCATION tag is used to define the runtime address of the Forms Runtime Adapter.

<html>
   <head>
   <meta http-equiv="X-UA-Compatible" content="IE=8" />
   <!-- The following line uses a tag which will be substituted out for the real location of the Forms Runtime Adapter script file once we know which host we are connecting to -->
   <script type="text/javascript" language="javascript" src="%%SCRIPT_LOCATION%%"></script>
   <script type="text/javascript">

The following line in the ViewWorkItem.ShowItem method is used to replace the SCRIPT_LOCATION tag and load the Forms Runtime Adapter into the form object.

htmlText = htmlText.Replace("%%SCRIPT_LOCATION%%", _adapter.GetJSURL());

The tag is replaced with the string returned by adapter.GetJSURL

public string GetJSURL()
{
   return _handler.GetBaseURL() + "bpmresources/formsclient/formsclient.nocache.js";
}

This method builds the runtime address of the Forms Runtime Adapter:

  • GetBaseURL (from ServiceClientFactory.cs) is used to obtain the endpoint URL of the BPM runtime - for example, http://10.100.87.112:8080/.
  • bpmresources is the name of the BPM runtime component that provides access to the Forms Runtime Adapter.
  • formsclient/formsclient.nocache.js is the location of the Forms Runtime Adapter.

Creating the onTIBCOFormRunnerLoad Function

FormRedirect.htm must contain a function called onTIBCOFormRunnerLoad. The Forms Runtime Adapter automatically searches for and runs this function as soon as it has loaded.

Note: The function must be called onTIBCOFormRunnerLoad. if you use a different name the form will not load.