Data resources in the application definition file
The data that is used in a mobile app is specified in the application definition XML file in the form of OSLC resources. Resources are categorized as primary, supporting, lookup, or system resources. These categories determine how the resources are specified in the application definition file and how they are managed at run time.
An OSLC resource represents a business, configuration, or domain object that belongs to the provider application. A resource is defined in the provider application by a shape document that describes the structure of the resource and all possible properties. The resource is published for integration by an OSLC object structure. The resource is registered with a service provider that specifies and manages the data operations that are available for the resource to consumer applications.
In Maximo Anywhere, where mobile apps act as consumers, the application definition file specifies the resources that are used by the mobile application. The <data> XML element contains the specifications for all resources. The main characteristics of a resource are defined by the attributes of the root element, <resource>.
| Attribute | Specifies | Usage |
|---|---|---|
| providedBy | The service provider that is used for data operations on this resource. | Required for primary, lookup, and system resources. A service provider reference is required for resources that are retrieved from the provider application as independent entities. The service provider specifies whether data for the resource can be updated, created, or deleted by the consumer application. For the primary resource, the service provider also specifies which queries are available to consumer applications. |
| describedBy | The shape document that defines the resource. | Required for primary, lookup, and system resources. The specifications for these resources in the application definition file must conform to the shape document definition. |
| name | A unique name that is used for references to this resource in the application definition file. | Required for all resources. |
| pageSize | The number of resource instances that can be retrieved at a time from the provider application. If, during query execution, the number of matching resource instances exceeds the page size value, the value is used to break down the result set into subsets that are retrieved in successive calls. | Required for primary, lookup, and system resources. |
additional
Data |
Whether the resource is a lookup resource. | Required with a value of true for all lookup resources. |
| isSystem | Whether the resource is a system resource. | Required with a value of true for all system resources. |
The following example shows the attributes that define the primary resource, workOrder, in the application definition file for the Technician app:
<resource providedBy="/oslc/sp/WorkManagement"
describedBy="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#WorkOrder"
name="workOrder"
pageSize="100"
[...]>The following example shows the attributes that define a lookup data resource, additionalasset, in the application definition file for the Technician app:
<resource providedBy="/oslc/sp/AssetManagement"
describedBy="http://open-services.net/ns/asset#Asset"
name="additionalasset"
pageSize="1000"
additionalData="true">The <resource> element is parent to the <attributes> element. This element contains a list of attributes that specify the resource data that is used by the mobile app. The attributes that are listed correspond to properties that are defined by the resource shape document in the provider application.
Primary resource
The primary resource represents the top-level object in the work list record. The primary resource can be a parent to one or more supporting resources. A supporting resource represents a child object in the work list record. The primary resource can have a one-to-one or a one-to-many relationship with a supporting resource. When a one-to-many relationship exists between the primary and supporting resources, the data for the supporting resource is rendered as a list of child objects in the work list record.
For example, the work order is the primary resource in work list records for the Technician app. The work order resource can be related to supporting resources such as asset, location, task, and labor. A work order can have a single main asset or location and multiple tasks and labor assignments. Tasks and labor assignments are displayed as lists within the work order.
In the application definition file, primary and supporting resources are defined as separate entities. The primary resource has the following characteristics:
- References to the service provider and shape document for the primary resource in the provider application.
- A list of the queries that are used during run time to retrieve work list records from the server. The list is contained in the <queryBases> element.
- A page size value that specifies the maximum number of work list records that can be retrieved in each request.
- Simple and complex attributes for the properties of the primary resource as defined in the shape document. Simple attributes represent data that is local to the primary resource. Complex attributes refer to supporting resources.
A supporting resource includes simple attributes for data that belongs to the supporting resource but is used in the work list record. Supporting resources are dependent on the primary resource to which they are related. Unlike the primary resource, supporting resources are not retrieved independently from the provider application and do not require references to a service provider and shape document.
Lookup resources
During run time, users can change supporting data in the work list record in accordance with business rules and application capabilities. Many changes involve the use of a lookup control to reference and select data that is external to the work list record. Examples of lookup data include the assets, tools, and materials that can be added to a work order.
Users must download lookup data to make it available in the mobile app. Locally stored lookup data can be refreshed be on demand.
Lookup objects are represented in the application definition file as lookup resources. A lookup resource has the following characteristics:
- An additionalData attribute with a value of true.
- References to the service provider and shape document for the lookup resource in the provider application.
- A page size value that specifies the maximum number of records that can be retrieved in each request.
- Simple attributes for the properties of the lookup resource as defined in the shape document.
System resources
A system resource represents an object that is external to the work list record but is required to support system operations in the mobile app. For example, the following resources are classed as system resources for the Technician app:
- The domain value lists that are used to change work order status and other work list record attributes.
- The labor and labor craft resources for the current user that are required for labor reporting.
- Labor timer settings that are active in the provider application and are required for local validation of labor transactions.
System data is automatically downloaded when a user first logs in to the application. If the download fails, the user cannot log in. Locally stored system data is refreshed whenever the user refreshes lookup data.
In the application definition file, a system resource has an isSystem attribute with a value of true. Other characteristics are the same as the characteristics of the lookup resource.