Example: creating a tabbed coach
This example shows how to create a coach that contains three tabbed pages.
In this example, you have a Customer business object that contains many properties. To capture or display all of these properties within a single coach, the tab control is a good choice.
The first tabbed page of the coach contains three text fields that have some general information about a customer. In this example, you add the fields directly to the coach using sections to set the page layout.

The second page contains a set of phone numbers. You use a coach view to add the fields to the page.

The third page contains a table of addresses. In this case, the coach view you add to the page is a list, which results in a table.

To perform this task, you must be in the IBM® Process Designer desktop editor.
- Create the Customer business object. Customer has id(String), firstName(String), and lastName(String) parameters. It also has two
complex parameters: phoneNumbers(PhoneNumber) and addresses(Address).
- PhoneNumber is a business object that has home(String), work(String), and cell(String) parameters.
- Address is a business object that has number(String), street(String), and city(String) parameters.
With the Customer business object, addresses is an array of the Address type, so ensure that you select List for it.
For information about creating business objects, see Creating business objects in Process Designer.
- Create the coach view for the PhoneNumber business
object:
- Create the PhoneNumberView coach view.
- In its Variables page, add a variable named phoneNumber and set its type to the PhoneNumber business object.
- In the Layout page, drag the home, work, and cell parameter variables
onto the layout. A text control is added to the layout for each variable
because it is the coach view associated with the String type.

- Create a client-side human service named Customer Human Service.
- In the human service diagram, rename the coach to Customer Coach.
- In the Variables page, add the Customer
business object as a private variable.

- Go to the Coaches page and start with a default coach.
- In the Coaches page, delete the default OK button and drag a tabs stock control onto the Customer
Coach layout.

- Create the General page:
- Drag a section onto the tabs control. A tabbed page can contain only one element directly. By adding the section, you can then add as many elements as you want into that section.
- Rename the section to General. The name that you see on the tab comes from the label of the section.
- Drag the id variable onto the section. The id variable is a parameter of the Customer business object.
- Drag another section into the first section below the id text control. In the configuration options of the second section, change its layout to Horizontal.
- Drag the firstName and lastName variables onto the horizontal section.

The Id, firstName, and lastName variables are parameters of the Customer variable.
- Create the Phone Numbers page:
- Drag the PhoneNumberView coach view onto the + part of the tab control. If you did not add a tag to the coach view, you can find it in the NoTags category on the palette. You can see a PhoneNumberView tab in the tab control.
- Bind the PhoneNumberView coach view to the customer.phoneNumbers variable. This action means that any data users enter into the fields gets set in the variable for the heritage human service.
- Select the tab.
- In the General properties, change the label
of the PhoneNumberView instance to Phone
Numbers.

- Create the Addresses page:
- Drag the addresses variable onto the tab control. You can see an Addresses tab in the tab control. If you select the tab, can now see a table with a column for each property defined in the Address business object.
- In the Configuration properties, select Show Add Button and Show Delete Button. By doing this step, you can add and subtract address rows when you run the heritage human service later in this example.
- Add a button control below the tab section and relabel it to OK, The button broadcasts a boundary event and you can use it to wire the coach in the heritage human service flow.
- In the diagram, connect the start node to Customer Coach and then
connect Customer Coach to the end node.

- Click Save or
Finish
Editing. - Test the client-side human service by clicking the
button.