Coach Views are new feature in version 8.0 and enable reuse of custom, user-defined coach controls, sections and templates. In practice, this means that we can build one control for a certain business object and use it on multiple user interfaces in multiple human tasks. Because business processes are usually all about modifying a business object through a series of steps, performed by various participants, this is an extremely useful option which saves us a lot of redundant work.
In this blog we will take a look at how to build them and how to use them within coaches.
For demonstrational purposes, we will use an existing proces app and an empty Process Order business process definition (bpd) as shown in figure 1. In version 8.0, the procedure of creating these is fairly similar than in version 7.5, which is described here.
We will also use an already prepared business object Order, which contains id, description, value and status fields (String, String, Decimal and String) as shown in figure 2.
We begin creating a new Coach View by clicking on plus sign next to User Interface category in the project tree and selecting New Coach View. In new coach view dialog we enter OrderView as name and click Finish, as shown in figure 3.
Each coach view is designed to present fields of a certain business object. Therefore, we move to Variables tab and add new Business Data element of type Order and name it order, as shown in figure 4.
Finally, we will show how to use this Coach View on a human task interface. Let’s open our bpd, and add Private Variable order of type Order, and make sure the Has Default checkbox is checked, as shown in figure 6.
Now we drag an activity from palette to the Participant lane, name it Submit Order and connect it to Start and End using sequence flow, as shown in figure 7.
We implement this activity as Human Task by right-clicking it and selecting Activity Wizard. We can leave activity name Submit Order, activity type User Task and name of the new library element Submit Order and click next, as shown in figure 8. In next screen we leave order variable as input and output of the activity and click finish, as shown in figure 9.
By double-clicking the activity we open its own diagram. By default, it consists from Start and End events and a single Coach, as shown in figure 10. Notice a Button 1 symbol on flow from Coach to End event. Using buttons on coaches we can create arbitrary flows between various coaches within a single human task in order to implement dynamic interfaces. (There are various other building blocks that can be added to implement more advanced functionalities, such as alerts, UCA agents, scripts, etc.)
If we switch to Coaches tab we can see that form has already been prepared using our pre-configured OrderView Coach View, as shown in figure 11. There is also aforementioned Button 1, which is used to submit the form and continue process flow. All created coach views are by default present in palette, on the right side of the screen, under No Tags section and we can use them in any coach that possesses appropriate variables.
This completes our demo. You can test Submit Order human task by clicking orange Play button in the upper right corner of the screen, or switch to Process Order bpd and test the entire process using the same button.