Composite SmartObjects

Composite SmartObjects are SmartObjects that combine data and methods from different data sources, which is one of the key benefits of using SmartObjects. This approach allows designers to create logical business entities (such as “Employee”, “Customer”, “Order” and so on) that combines data from the different systems where the data is stored. The consumer (which might be a Form control) does not need to know anything about those data sources or how to combine the data: the SmartObject does all that work behind the scenes.

For example, you may want to create a logical "Employee" SmartObject which combines data from a HR SQL Database and a Azure Active Directory user store and presents this data to your application builders as a logical "Employee" object. The designers don’t need to know where the data comes from; but they can easily use this "Employee" SmartObject that represents all the Employee-related data.

Composite SmartObjects are implemented by creating a SmartObject method that chains or calls two or more Service Object methods in a specified sequence, using the Advanced SmartObjects: Methods screen. The key to building composite SmartObjects is that there must be a common, unique-value property between the data sources that can be used to join the data sources.

Let's examine an example. In the image below, there is a composite SmartObject called Employee, which combines data from an Employees SQL database table and an Active Directory user object. Notice that there is a common property between the two data sources. Both the SQL database and Active Directory store the user’s domain login name (e.g. Denallix\Bob). Because this is a common and unique property in the two systems, K2 can use these two properties to “join” data from the different data sources into one SmartObject.

Conceptual diagram of a composite SmartObject

Considerations