Interface ICustomPlmService
Interface for operations on an external system.
Supported operations:
- TestAccess checks connection with an external system
- CreateItem creates an item in an external system based on the specification
- ReadItem reads an item with the specified identifier from an external system
- UpdateItem updates an item in an external system based on the specification
- DeleteItem deletes an item with specified id from an external system
- QueryItems finds items identifiers which meet specified query criteria
- CreateRelationships creates relationships between items
- ReadRelationship reads relationships between items with specified table identifier and type
- AdvanceState increases item's lifecycle state to the next default state
- IsOperationSupported checks if the external system supports given operation
Namespace: CustomPLMService.Contract
Assembly: CustomPLMService.Contract.dll
Syntax
public interface ICustomPlmService
Methods
AdvanceState(Id, CancellationToken)
Increases item's lifecycle state to the next default state
Declaration
Task AdvanceState(Id id, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Id | id | Item identifier |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
CreateItems(IEnumerable<ItemCreateSpec>, CancellationToken)
Creates items in an external system based on items
If a specified identifier is not used, it will be generated
Declaration
Task<IEnumerable<ItemResult>> CreateItems(IEnumerable<ItemCreateSpec> items, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ItemCreateSpec> | items | Items creation specification |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<ItemResult>> | List of created items |
See Also
CreateRelationships(IEnumerable<RelationshipTable>, CancellationToken)
Creates relationships between items from tables
Declaration
Task CreateRelationships(IEnumerable<RelationshipTable> tables, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<RelationshipTable> | tables | List of relationship tables to be created |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
See Also
DeleteItems(IEnumerable<Id>, CancellationToken)
Deletes from an external system items with specified ids
Declaration
Task DeleteItems(IEnumerable<Id> ids, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Id> | ids | List of item identifier |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
IsOperationSupported(SupportedOperation, CancellationToken)
Checks if an external system supports given operationType
Declaration
Task<bool> IsOperationSupported(SupportedOperation operationType, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
SupportedOperation | operationType | Operation type to be checked |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | True if an external system supports given operation, false otherwise |
QueryItems(Query, Type, CancellationToken)
Finds items identifiers with type
which meet specified query
Declaration
Task<IEnumerable<Id>> QueryItems(Query query, Type type, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query criteria to be meet |
Type | type | Item type |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Id>> | List of found items identifiers |
ReadItems(IEnumerable<Id>, CancellationToken)
Reads items with specified plmIds
from an external system
Declaration
Task<IEnumerable<Item>> ReadItems(IEnumerable<Id> plmIds, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Id> | plmIds | Item identifiers |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Item>> | List of found items if it exists, otherwise null |
ReadRelationships(IEnumerable<Id>, RelationshipType, CancellationToken)
Reads relationships between items with the specified table ids
and type
Declaration
Task<IEnumerable<RelationshipTable>> ReadRelationships(IEnumerable<Id> ids, RelationshipType type, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Id> | ids | List of relationship table identifiers |
RelationshipType | type | Relationship's type |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<RelationshipTable>> | Table with found relationships |
TestAccess(Auth, CancellationToken)
Checks connection with an external system
Declaration
Task<bool> TestAccess(Auth auth, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Auth | auth | Authentication data used to connect to the external system |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | True if using authentication data results in a successful connection, false otherwise |
UpdateItems(IEnumerable<ItemUpdateSpec>, CancellationToken)
Updates items in an external system based on updateSpecs
Declaration
Task<IEnumerable<ItemResult>> UpdateItems(IEnumerable<ItemUpdateSpec> updateSpecs, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ItemUpdateSpec> | updateSpecs | List of item update specifications |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<ItemResult>> | List of updated items |
See Also
UploadFile(FileResource, CancellationToken)
Stores a file in an external system
Declaration
Task<string> UploadFile(FileResource request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
FileResource | request | File name and content as byte array |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> |