Business Object Groups

Business object groups in Aware IM offer you a simple and convenient way to handle similar but different data.

The problem

Let us consider an application that registers client communication history, such as meetings, phone calls, letters, e-mails, etc. A summary of the history should be presented as a chronological list on the client form. The user should be able to see full details of any list item on a separate form.

Some details are common across all communications, like the contact time, summary or description. Other details are specific to a particular communication type, like the status of an outgoing e-mail can be Sent or Unsent, and the user should be able to prepare and send an e-mail, say, by clicking a button. The status of an incoming e-mail can be Read or Unread. Phone conversations do not have any status at all. Letters should have a letter document attached to them, etc.

How would we represent communication details using traditional database software? One way would be to combine the details of all communication types in a single table called, say, Communications. The problem with the single table is that depending on the communication type we would have to hide non-applicable details and operations from the data form (say, by using scripts) or dynamically manipulate the values of the same fields (like Status for incoming and outgoing e-mails).

Alternatively, we could make several forms for our table specific to each communication type. Then we would have to add scripts to all places where a communication form is displayed, like from the history list on the client form, to check the type and display an appropriate form. We would have to do the same check in all other places where the user can navigate to the communication form, like in a search result table.

Another way of going about it could be to create separate tables for different communication types, like Outgoing Emails, Incoming Emails, Outgoing Letters, etc. Each of these tables would have its own data form. The trouble with separate tables is that it would be very difficult (if not impossible) to show records from separate tables in a single chronologically sorted list, say on a client form, or do a search across multiple tables.

The solution

In Aware IM you would create separate business objects for different communication types, like Outgoing Email, Incoming Email, Outgoing Letter, then create a business object group, say, called Communication, and include all the specific objects as its members.

Business object groups are treated in the same way as regular business objects - they can be used in business rules, queries, document templates, and they also appear in the list of available attribute types. So, we would simply add a multi-value relationship attribute Contact History of type Communication to Client to display a list of communication records on the client form. When the user clicks on an item in the list, a form for the specific record is automatically shown to the user.

Note that we solved the problem without adding any scripts or special buttons on forms. Aware IM automatically does all the technical work necessary to find related communication records of different types and put them together in a single chronologically sorted list.

The same object can be a member of multiple groups. For example, we could add another object group Outgoing Correspondence with members Outgoing Email and Outgoing Letter specifically to monitor unsent messages. Since both Outgoing Email and Outgoing Letter include attributes Status and Sent On, we could then define a query to see all unsent e-mails and letters:

FIND OutgoingCorrespondence WHERE OutgoingCorrespondence.Status = 'Unsent'

or have a business rule to automatically register the date when an e-mail or a letter is actually sent:

IF OutgoingCorrespondence.Status WAS CHANGED TO 'Sent' Then OutgoingCorrespondence.SentOn = CURRENT_DATE