Setting the BOM JavaScript path

The bomJSPath variable holds the root folder path used for loading the BOM JavaScript files used by the form, in the format required by the Forms Runtime Adapter loadForm method.

var bomJSPath = window.external.GetBOMJSPath();

The URL is built by calling ViewWorkItem.GetBOMJSPAth,

public string GetBOMJSPath()
{
   return _adapter.GetBOMJSPath(_item);
}

which in turn calls adapter.GetFormURL.

public string GetBOMJSPath(workResponse item)
{
   string formURL = item.presentation.formIdenitifier;
   return _handler.GetBaseURL() + "bpmresources/" + formURL.Substring(0, formURL.IndexOf('/'));
}

This method builds the URL as follows:

  • 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 form resources of deployed BPM applications.
  • formURL is the formIdentifier of the form used by this work item, obtained from the previous OpenItem call.
  • formURL.Substring(0, formURL.IndexOf('/')) extracts the initial part of this string (the version number of the form resources), which identifies the root folder path used for loading the BOM JavaScript files used by the form - for example, 1.0.0.201107291435.