Interface IDataAssociationsService
Namespace: Unity.DigitalTwins.Live.Sdk.Services.Interfaces
Assembly: solution.dll
Syntax
public interface IDataAssociationsService
Methods
Create3DObjectInfoAsync(IEnumerable<CustomProperties>)
Implement this method to create custom properties for one or more 3D objects.
Declaration
Task<IEnumerable<CustomProperties>> Create3DObjectInfoAsync(IEnumerable<CustomProperties> customProperties)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<CustomProperties> | customProperties | The custom properties of one or more 3D objects. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<CustomProperties>> | Returns the newly-created custom properties. |
CreateRuleAsync(Rule)
Implement this method to create a new rule.
Declaration
Task<Rule> CreateRuleAsync(Rule ruleToCreate)
Parameters
| Type | Name | Description |
|---|---|---|
| Rule | ruleToCreate | The rule to be created. |
Returns
| Type | Description |
|---|---|
| Task<Rule> | Returns the created rule. |
Remarks
The 'isAutomated' property executes rules automatically, without manual intervention. If the 'isDisabled' property is set to true, the rule does not qualify for execution.
Delete3DObjectInfoAsync()
Implement this method to delete all 3D object custom properties for the specified workspace and facility.
Declaration
Task<IEnumerable<CustomProperties>> Delete3DObjectInfoAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<CustomProperties>> | Returns the deleted custom properties. |
DisableRuleByIdAsync(String)
Implement this method to disable the specified rule.
Declaration
Task<Rule> DisableRuleByIdAsync(string ruleId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | ruleId | The ID of the rule to be disabled. |
Returns
| Type | Description |
|---|---|
| Task<Rule> | If successful, returns true. If not, returns false. |
Remarks
Disabled rules cannot be executed. To enable a rule, update the 'isDisabled' property via PUT /workspaces/{{workspaceId}}/facilities/{facilityId}/rules/{ruleId}.
DisassociateDevicesAsync(Boolean)
Implement this method to remove geometry values from all devices belonging to the specified workspace and facility.
Declaration
Task<IEnumerable<Device>> DisassociateDevicesAsync(bool isTestRun)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | isTestRun | Indicates whether or not results are saved. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Device>> | Returns a list of devices with removed geometry values. |
Remarks
The 'isTestRun' property can execute operations without saving the resulting device disassociations.
DisassociateDevicesByRuleIdAsync(String, Boolean)
Implement this method to remove geometry values from devices that match the specified rule.
Declaration
Task<IEnumerable<Device>> DisassociateDevicesByRuleIdAsync(string ruleId, bool isTestRun)
Parameters
| Type | Name | Description |
|---|---|---|
| String | ruleId | The ID of the rule used to remove geometry values from devices. |
| Boolean | isTestRun | Indicates whether or not results are saved. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Device>> | Returns a list of devices for which the geometry value was removed |
Remarks
The 'isTestRun' property can execute operations without saving the resulting device disassociations.
ExecuteAutomatedRulesAsync(Boolean, Boolean)
Implement this method to execute all rules that are marked for automatic execution.
Declaration
Task<IEnumerable<Device>> ExecuteAutomatedRulesAsync(bool matchUnassociatedDevicesOnly, bool isTestRun)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | matchUnassociatedDevicesOnly | Indicates whether to execute the rule against all devices within the workspace and facility or only against devices with no data association. |
| Boolean | isTestRun | Indicates whether or not results are saved. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Device>> | Returns the list of devices that have been successfully associated with a geometry value. |
ExecuteRuleByIdAsync(String, Boolean, Boolean)
Implement this method to execute the specified rule.
Declaration
Task<IEnumerable<Device>> ExecuteRuleByIdAsync(string ruleId, bool matchUnassociatedDevicesOnly, bool isTestRun)
Parameters
| Type | Name | Description |
|---|---|---|
| String | ruleId | The ID of the rule to be executed. |
| Boolean | matchUnassociatedDevicesOnly | Indicates whether to execute the rule against all devices within the workspace and facility or only against devices with no data association. |
| Boolean | isTestRun | Indicates whether or not results are saved. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Device>> | Returns the list of devices that have been successfully associated with a geometry value. |
Get3DObjectInfoAsync()
Implement this method to retrieve all 3D object information for the specified workspace and facility.
Declaration
Task<IEnumerable<CustomProperties>> Get3DObjectInfoAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<CustomProperties>> | Returns the custom properties of the 3D objects configured for the specified workspace and facility. |
GetRuleByIdAsync(String)
Implement this method to retrieve a rule by its ID.
Declaration
Task<Rule> GetRuleByIdAsync(string ruleId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | ruleId | The ID of the rule to be retrieved. |
Returns
| Type | Description |
|---|---|
| Task<Rule> | Returns the requested rule. |
GetRuleInterpretersAsync()
Implement this method to retrieve all rule interpreters for the specified workspace and facility.
Declaration
Task<IEnumerable<RuleInterpreter>> GetRuleInterpretersAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<RuleInterpreter>> | Returns a list of the rule interpreters available for the specified workspace and facility. |
GetRulesAsync()
Implement this method to retrieve all active rules.
Declaration
Task<IEnumerable<Rule>> GetRulesAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Rule>> | Returns a list of the active rules configured for the specified workspace and facility. |
UpdateRuleAsync(String, Rule)
Implement this method to update an existing rule.
Declaration
Task<Rule> UpdateRuleAsync(string ruleId, Rule ruleToUpdate)
Parameters
| Type | Name | Description |
|---|---|---|
| String | ruleId | The ID of the rule to be updated. |
| Rule | ruleToUpdate |
Returns
| Type | Description |
|---|---|
| Task<Rule> | Returns the updated rule. |
Remarks
The 'isAutomated' property executes rules automatically, without manual intervention. If the 'isDisabled' property is set to true, the rule does not qualify for execution.