Advanced SmartObjects: Methods

SmartObject methods define the actions or operations you can perform on a SmartObject, such as create, read, update, and delete. Methods are often used to populate the values contained in SmartObject properties. A SmartObject's methods are associated to one or more Service Object methods, which tells K2 which service object method(s) to call when the SmartObject method is executed.

When editing a SmartObject in advanced mode, you can edit the methods for that SmartObject in the Methods tab, as shown below. You can use the Methods tab to view, add, edit, and delete SmartObject methods.

Methods

Actions/Column Description
Add Opens the Add Method wizard to define a new service method binding.
Edit Opens the Edit Method wizard for an existing service method binding.
Remove Removes the method (note that removing a method might break applications that rely on this method).
Remove All Removes all the methods (note that removing all methods might break applications that rely on the SmartObject).
Name The name of the SmartObject method.
Method Bindings Displays the service object method(s) to which the SmartObject method is bound.
Service The name of the service instances where the bound service object methods exist.

You can use the SmartObject Methods tab to:

  • configure the underlying service object methods that are bound to the SmartObject's methods
  • limit the number of available methods on a SmartObject
  • edit the mappings between the service object method's parameters
  • configure input properties and return properties
  • configure the SmartObject method parameters
  • edit the SmartObject's properties
  • call multiple service object methods in a single SmartObject method (sometimes referred to as SmartObject method chaining) to create a composite SmartObject

See the following resources for more information:

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.