Views

Draft comment:
This topic is shared by BAW, CP4BA, CP4BASaaS. Last updated on 2025-03-13 12:15
Views are reusable sets of user interface widgets, such as text fields, date time pickers, and buttons, that users can use to interact with a business object or service. Views can comprise one or more sets of other views, data bindings, layout instructions, and behaviors.

Because views are reusable, each view instance can share parts of its user interface with other view instances in a coach. For example, you create a coach that contains a view instance that includes a set of address fields. If you create a second coach that needs the same address fields, you can reuse the view. In both cases, the coach is using an instance of the view. You can edit the properties of each instance independently. For example, changing the label of one view instance does not change the label of the other. Both view instances use a reference to point to the view definition. This approach means that if the view definition changes, you can see the change reflected in the instances of the view.

You can modify the view instances by using configuration properties and by overriding default styling. For each view, the data binding is optional. However, if you define a binding for an instance, it must match the type in the view definition. A warning occurs if the business object type does not match the type of the data binding that is defined for the view. In each view topic, the business object binding table lists the business object type that is defined for the view. For each view instance, the configuration properties are optional. If you want to override the default value, you can provide a specific value or you assign a variable. As a convenience, you can also expose the configuration property to any view or coach in a human service that contains the view. Exposing the configuration property creates a configuration option in the current view with matching binding. You do not have to create the configuration option and bind it.

Views in toolkits or process applications
You can create a view in a process application or in a toolkit. In general, create highly reusable views in toolkits and more specialized views in process applications. Choosing the process application means that you can reuse the view only within the process application. However, it also means that if someone edits the view, the changes apply to the view instances in that process application. If the view is in a toolkit and then someone edits it, the changes could apply to all view instances in all the applications that use that version of the toolkit. Because editing a coach definition can affect many instances, be careful in your changes. For example, deleting a content box in the view definition could mean that coaches or views that contain instances of that view cannot display the content that they had defined in that content box. You cannot directly edit the definition of the view from within the parent coach or view. Instead, you must open the view definition first before you can change it.
UI toolkit
The UI toolkit, which is the default toolkit, provides a rich set of views that you can use to build process applications that run on multiple devices. Use the UI views for new development. To become familiar with the UI views, explore the Discover UI sample. For more information, see UI toolkit.
Earlier toolkits, such as the Responsive Coaches toolkit and the Coaches toolkit, are deprecated, but coaches that use deprecated coach views from these toolkits still work and are supported in the designer. You can convert most of your deprecated coach views into UI views. For more information about the conversion, see Converting deprecated functions.
Composite-style vs widget-style view development
Typically, when you build your view, you can follow one of the following patterns. Or you can use a combination of both patterns if your user interface is more complex and requires it.
  • Composite-style views are simple and do not require advanced technical skills to build. To create a composite-style view, add content to the layout from the palette. If your view has multiple areas of information, use the grid layout to arrange the views, then set their properties and complete the data binding as required. Composite-style views can be reused in multiple coaches or in other views that can be built hierarchically.
  • Widget-style views are more complex and require a more technical skill set. Typically, the widget-style views are custom views that can include, for example, a custom HTML segment that you can populate with HTML code, or an iFrame that has a specific ID. You can set the configuration properties of the widget-style view and add inline CSS and inline JavaScript logic in the Behavior page. For behavior that occurs at run time, for example, when a page is loaded or a button is clicked, you can place the JavaScript logic inside the view's event handlers, under Events. For tips on how to develop widget-style views for use with IBM® Robotic Process Automation with Automation Anywhere, see the following section.
The WYSIWYG for the user interface that you are building depends on the type of view: for a composite-style view, the WYSIWYG renders all the embedded views. For a widget-style view, consider adding Advanced Preview HTML or JavaScript for a better WYSIWYG experience. You can use an image-based preview if the WYSIWYG experience is not important.
To ensure optimal UI performance, use the available guidance as you develop and test your coach-based user interfaces. See Accessing coach performance statistics.

Considerations for IBM Robotic Process Automation with Automation Anywhere (deprecated)

With IBM Robotic Process Automation with Automation Anywhere (IBM RPA), repetitive tasks in Business Automation Workflow processes can be automated and expedited by using bots. To enable an efficient interaction with the IBM RPA bots, the following enhancements were made to the Business Automation Workflow coach framework.

Coach support for IBM RPA
To develop reliable user interfaces that IBM RPA bots can use, you must provide a stable and predictable identification of views in your coaches. To ensure that, when you develop your coaches and views in the Process Designer, use the context.controlidpath property that is available in the context JavaScript API object. See The coach view context object.
The context.controlidpath property uniquely identifies a view instance within a coach. It remains stable through most coach layout changes and can be used as a base to create unique IDs for DOM elements in the implementation of the view. For example, it can tolerate changes such as new content added to the coach, content moved around inside the coach, for example, between sections and layout widgets, or changes to field labels.
Both the UI toolkit and the deprecated Responsive Coaches toolkit are enhanced to use the improved framework. No support for IBM RPA is provided for the coach views in the deprecated Coaches toolkit.
Coach development tips
To facilitate the automation of tasks in IBM RPA, keep in mind the following points when you develop your Business Automation Workflow coaches and views:
  • Use context.controlidpath as the base string for HTML IDs within the DOM structure of your views. For example, when you build a Text view, you might want to give your label DOM element the ID text-label-<controlidpath> and the input element the ID text-input-<controlidpath>.
  • Apply the unique identification to all the DOM elements with which the user might want to interact in an RPA task, including the following elements:
    • Form-style fields
    • Read-only information that might be used by the task, for example, text that might be copied by the task for some purpose
    • Page navigation fields, such as Tab
  • To verify that a view works well with the IBM RPA bots, record the interactions using the RPA Smart Recorder, and ensure that the captured HTML IDs are the expected ones, as described earlier. Iterate through recording, playback, and HTML ID assignment until all the interaction elements have stable IDs.
    Note: Users might still need to make minor adjustments to the recorded objects to optimize the playback, but the adjustments should be limited to simple changes such as changing keystroke delays, removing captured properties, and so on.

For more information about IBM RPA, see the IBM Robotic Process Automation with Automation Anywhere documentation External link opens a new window or tab.