Handling Partial Failures
In many cases, the resource manager is potentially multicasting requests to multiple resource providers. Some resource providers, particularly KeyBasedRelationshipResourceProvider, LinkTableBasedRelationshipResourceProvider, and FlattenedCompositeResourceProvider, and the expands functionality, multicast requests as well.
This multicasting create the possibility of partial failures, where some of the multicast requests succeed but others fail. It also creates a need to provide an indication of such occurrences as part of service results. The InfoTable rows resulting from some services, for example, Create and Update, provide a clear indication of where they succeeded and, based on the caller inputs, where they did not. However, the result rows of other services, for example, Get, do not provide the same indication.
Therefore, in cases where an InfoTable result is potentially incomplete due to a partial failure and the incomplete results are not clear from the context, metadata is added to the field in the InfoTable to convey this information, specifically to the fields' "PartialStatus" aspect. This metadata is added and queried using utilities provided by the com.ptc.resource.PartialResultsUtilities Java class and the PTC.Resource.PartialResultsUtilities ThingWorx Resource object.
In general, when the primary field of an InfoTable has (non-null) PartialStatus metadata, that implies that the InfoTable's rowset is potentially incomplete. Similarly, fields resulting from expands will also be annotated with PartialStatus metadata if the corresponding expand data is known to potentially be incomplete. Callers receiving InfoTable results can check for this metadata and handle it as they deem appropriate. For example, they could put appropriate warning icons on a table view.