For connectors with workflow support, you can write workflow scripts in JavaScript to control which fields are visible, required, etc. in response to user interaction with the task editor.
A workflow script consists of a set of event handlers which are automatically called in response to user interaction including opening or submitting a task and editing a field. The event handlers can call dom.getTask().getField(fieldId) where dom is an argument of type DOM passed to the handler by the framework, and fieldId is a String representing the ID of a field (e.g. “BG_STATUS”), to retrieve an IField object representing that field. The IField object has methods which the script can call to change the field’s value, visibility, and so on. See the API Documentation below for details.
Workflow scripts are written in JavaScript but must use a Java API to access the task data model and task editor capabilities. See Model Documentation.
For documentation of the event handlers to be implemented by workflow scripts, see JavaScript Event Handlers.
Connectors that support workflow can use properties to make extra information available to workflow scripts. The properties can be accessed by calling ITask.getProperty().
changedFieldIds parameter of handleSubmit to determine what fields the user has changed.DOM objects they are passed will always be the same object, but they should also not assume they will always be different. So, a script should not store a DOM object in a global variable.