Requirements for Creating Custom Web Forms

You can create custom web forms, and then bind, build an expression, or set a literal value against the input and output parameters in a workflow.

Form Library

All custom web forms must include the form library, which is contained in tasklistform.min.js via a script tag (for example, <script src="https://<Insert Host Name Here>/tasklistform.min.js"></script>). This file is located in <32-bit installdir>:\Program\Applications\Workflow\SDK. You can also find a file that provides information about calling the required functions that allow forms to work in the Task List.

Custom Form Template

The file, FormTemplate.html, provides information about calling the required functions that allow forms to work in the Task List. This file is located in <32-bit installdir>:\Program\Applications\Workflow\SDK.

Communicating with the Task List

In order for your form to send and receive data from the Task List, your form must contain the appropriate calls to the form library. The form must call:
  • formLoaded() when it is ready to receive input data; for example, in the onloaded event of your body element
  • submitForm() to perform a submission back to workflow; for example, in the onsubmit handler of your form element
  • cancelForm() when it wishes to signal a cancellation of the form; for example, in the onclick handler of a cancel button)

For examples of how these calls are performed, see the included sample form.

Using Custom Web Forms in the Workflow Task List

In order for custom HTML forms to function properly in the regular Task List, you must ensure the following line is added at the start of the <head> section of your form.

<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">

Hosting Sample Files

You must update the linked CSS files and script elements in Sample Custom Form.html to point to the location where the files are hosted. To do so, replace <Insert Host Name Here> in the following code with the full host name.
<link rel="stylesheet" type="text/css" media="screen" href="https://<Insert Host Name Here>/SampleForm/css/jquery-ui.css"/>    
<link rel="stylesheet" type="text/css" media="screen" href="https://<Insert Host Name Here>/SampleForm/css/ui.jqgrid.css"/>

<script src="https://<Insert Host Name Here>/SampleForm/js/jquery-1.11.0.min.js"></script>   
<script src="https://<Insert Host Name Here>/SampleForm/js/i18n/grid.locale-en.js"></script>
<script src="https://<Insert Host Name Here>/SampleForm/js/jquery.jqGrid.src.js"></script>
<script src="https://<Insert Host Name Here>/SampleForm/js/jquery-ui.js"></script>
<script src="https://<Insert Host Name Here>/SampleForm/js/tasklistform.min.js"></script>

Accessing Custom Web Forms

Customers who create custom web forms must also provide secure web hosting in order for these forms to be accessible by Workflow. As a result, you must use an HTTPS address. When you configure a custom web form, use only this HTTPS address in the URL field.

Note: The HTTPS configuration for custom HTML forms is also applicable to Workflow task client.

To use a custom HTML form with the Web HMI Task List, Web HMI must be configured to allow connections to the custom form host.

The custom form will fail to load if the reverse proxy is not configured. Use the proxy whitelist to accomplish the configuration.
  1. Open the C:\Program Files\Proficy\ProficyWebServer\ReverseProxy\serverConfig.json file on the Web HMI Server.
  2. Edit the whitelist element to include the custom form host. e.g., "whitelist" : [ "https://myformhost:port" ],
  3. Restart the “GE Proxy” windows service.

Form Events in Web-based Forms

For more information on using form events, see Event Handlers for Web-based Forms.

Requirements for Binding Input and Output Parameters

  • There must be exactly one <form> element in the custom HTML.
  • All elements must have a unique Name attribute.
    Note: Exception for radio buttons: All radio buttons in a radio group have the same name.
  • Labels: The For attribute must be set to the ID of the corresponding element.
    Note: Exception for radio buttons: Labels for radio groups have the Name property set to the same Name of each radio button. A label element must be present to ensure that the radio button options can be modified from a running workflow.
  • Authentication: For custom web forms to work properly, there must be no authentication on the server hosting these forms.
  • Modifying forms: If you make changes to the custom form, you must save it in order for the changes to work.
  • To tell the host which methods to call when passing in the initial workflow inputs and when collecting the form outputs to return, the form must call addInputParameterFunction and addOutputParameterFunction. This call is handled automatically for most basic HTML elements, such as <p>, <input>, <textarea>, <select>, and <img>.
  • Inputs:
    • Add an input parameter function with the string name <elementName>.InitialValue for each control input that you want to handle.
    • In the sample form, the jqGrid populates using a JSON representation of a table:
      if (addInputParameterFunction) {           
          addInputParameterFunction('jqGrid.InitialValue', populateForm);
      }
  • Outputs:
    • Add an output parameter function with the name <elementName>.Value for each control output that you want to provide. Returns a string.
    • In the sample form, a JSON representation of the table is returned:
      if (addOutputParameterFunction) {           
          addOutputParameterFunction(collectFormOutput);       
      }

Supported Binding Elements

ControlTagElement
Text<p>
  • value
Image<img>
  • URL
Input<input>
  • label
  • value
Selection<select>
  • label
  • options
  • selected index
  • selected value
Radio Buttons<input>
  • label
  • options
  • selected index
  • selected value
List Box<select multiple>
  • all selection options, and
  • multi-select outputs
OthersN/A
  • value (provided as string)
    Note: The custom form must provide a mechanism for applying the provided values to the control and returning a string as output. For more information, see Requirements for Binding Input and Output Parameters above.