Advanced SmartObjects: Properties
SmartObject properties define the data 'fields' of the SmartObject, similar to columns in a database or spreadsheet. SmartObject properties are most often associated with data required by, or returned by, SmartObject methods. This is known as binding: you 'map' or 'bind' a field returned by a method, to a property of that SmartObject. When editing a SmartObject in advanced mode, you can edit the properties for that SmartObject in the Properties tab, as shown below:
Field | Description |
---|---|
Name | A descriptive name for this SmartObject property. |
Type | The data type of the property. See SmartBox properties for a listing of the available data types. |
Key | Whether this property is used as a key/unique value, typically used for ID fields. |
SmartBox | Whether this property stores its data in K2 SmartBox. |
Required | Whether this property must have a value, or if it can be null. |
Unique | Whether this property must be a unique value, such as a GUID. |
There are several ways to create advanced SmartObject properties:
- Manually: Add properties to the SmartObject and map them later when editing the SmartObject's methods. To manually add properties, create SmartObject properties as you would for a standard SmartObject. Click Add and enter the property details. You then define how the SmartObject property maps to service object properties using the methods configuration wizard.
- Automatically: Have the designer automatically create properties for you while you are defining the SmartObject's methods. To automatically create SmartObject properties, add a method from an existing SmartObject or service object and select the Create All option to create all the properties.
- During Service Object configuration: Create properties using the service object methods configuration screens. Create properties individually by clicking the Create button on the Map ServiceObject Property dialog, or have K2 automatically create all properties by clicking the Create All button. Selecting Create All automatically creates SmartObject properties for the service object properties that do not already exist and automatically creates a mapping for each property.
Creating Properties in the Inputs & Outputs screenWhen mapping Service Object properties, the following Map to options are available:
- SmartObject property: Map the service object property to an existing SmartObject property.
- SmartObject method parameter: Map the service object property to an existing method parameter. (If no Method parameters exist, this option can not be selected.)
- Specific value: Specify a static value for the service object property. This is mostly used if the method should always use the same, static input value whenever the method is executed.
- System value: Map the service object property to the SmartObject definition or executing user's identity.
The following System value options are available:
- This SmartObject's display name
- This SmartObject's GUID
- This SmartObject's system name
- Current User's Identity (FQN)
Fields Description and notes This SmartObject's display name The display name of the SmartObject that executes the service object. Mostly used if the service object method needs to know which SmartObject it was called by. This SmartObject's GUID The GUID (Global Unique Identifier) of the SmartObject that executes the service object. Mostly used if the service object method needs to know which SmartObject it was called by This SmartObject's system name The system name of the SmartObject that executes the service object. Mostly used if the service object method needs to know which SmartObject it was called by.
See the topic Advanced SmartObjects: Methods for more information about mapping properties to service object properties.
Considerations
- Take care when editing existing SmartObjects, especially if renaming or deleting existing properties or methods. If you rename, change or delete a property or method, you could break an application that requires that property or method.