Creating a New Capability
  1. Create a new thing shape.
    Be sure to give the thing shape a unique name. For example, Company.Capability.RandomNumberServiceProvider.
     Note
    The name is created under a company namespace to avoid conflicts with other extensions that may be installed at a later time.
     
  2. Create a new data shape.
    The data shape contains new fields that are given or represented by the capability. In this case, it will have a random number field. Following the naming convention guidelines, the new data shape should be named Company.Capability.RandomNumberDataShape.
    At this point, the capability could be applied to any resource provider if there is an attribute that can be mapped to the RandomNumber attribute in the configuration tab. It's also possible that a service is available on the thing shape that could determine the value using other resources or services.
  3. (Optional) Add a new service.
    The service is responsible for retrieving the attribute values. For example, this service may be called GetRandomNumbers and it retrieves or calculates the value to the RandomNumber attribute. It may need to handle data from multiple systems.
    A basic version of this service may loop over the given input objects and set a random number value that is generated using basic Math functions. Each resource provider may override this service to change the way the attribute is calculated for its resources. For more information about navigating relationships with foreign keys, see Capabilities.