An API object representing a single data operation.
This object is useful for both roles, ABCS Business User and ABCS Developer.
- ABCS Developer needs to produce Operation instances to make his custom custom Business Object Provider (BOP) useful.
- ABCS Business User consumes these Operation instances and performs the operation using Operation.perform(..) method.
- Version:
- 17.1.1
- Source:
- See:
-
- Operations to understand how to get certain registered operation and perform it.
- Operations.read(..)
- Operations.create(..)
- Operations.update(..)
- Operations.delete(..)
Returns:
- Type
- Operation
Members
(static) SpecialType :String
stable API
Represents a special kind of an Operation.
Special type is relevant only in cases of Operation instance with standard type set to Operation.Type.READ_MANY or Operation.Type.READ_ONE. For all other Operation.Types, the value is ignored and resulted behavior is not guaranteed by ABCS.
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
QUERY_BY_ID |
String | Marks an Operation capable to retrieve single record by ID. Having an Operation instance marked with this special type has strong impact on the resulted capabilities of the Entity which supports such operation:
Please be aware, that only one Operation of type QUERY_BY_ID is expected for each Entity. If your BOP provides more Operations of this type, the behavior is not guaranteed by ABCS. |
QUERY_BY_IDS |
String | Marks an Operation capable to retrieve many records using the given list of IDs. Includes a capability for ABCS to fetch many records given their IDs. Such Operation is used when Entity which provides this Operation is being referenced from other Entity. If there is a table of referencing Entity and the table has visible column which correspond to the referenced Entity, operation of type QUERY_BY_IDS will be used to fetch all referenced values needed for the table view. And it will be done effectively in one call. To illustrate on an example:
Please be aware, that only one Operation of type QUERY_BY_IDS is expected for each Entity. If your BOP provides more Operations of this type, the behavior is not guaranteed by ABCS. |
QUERY_BY_ANYTHING |
String | Marks an Operation capable of handling any kind of input Condition. Having an Operation of this special type available gives ABCS an opportunity to query any kind of data. This is used for ABCS UIs like "Advanced Search" or "Default Query" which, thanks to having this Operation available, can give ABCS user much more flexibility on how to visually build the query. Please be aware that by registering the Operation of this type, you're obligating that the operation function will handle all possible combinations of AND/OR RelationOperators between unlimited number of parameters. If that's not true, ABCS UI might allow final client to setup query which is actually unsupported by your BOP. To illustrate on an example:
Please be aware, that only one Operation of type QUERY_BY_ANYTHING is expected for each Entity. If your BOP provides more Operations of this type, the behavior is not guaranteed by ABCS. |
- Version:
- 17.1.1
- Source:
- See:
(static) Type :String
stable API
Represents behavior classification of single Operation instance.
Type of the Operation is the most important information that Abcs needs to understand in order to see the logical purpose of the operation itself. The information is used to make the action accessible on appropriate places within Abcs UI.
- If your operation is expected to be available for retrieving collection data, it needs to have Operation.Type.READ_MANY set. That makes it available for example when client drops the Table into an empty page.
- If you would also like to have Create page available for such table, you need to provide operation with Operation.Type.CREATE type which gives Abcs an understanding of what to perform when "Create" button is being clicked.
- If you would also like to have Delete action available for each Collection record, you need to provide operation with Operation.Type.DELETE type which gives Abcs an understanding of what to perform when "Delete" item is being clicked.
-
If you would like to have also Edit/Detail pages available for the selected Collection record, you will need to implement
operation with Operation.Type.READ_ONE type and with special type set to QUERY_BY_ID
which gives Abcs a possibility to read whole record. It also allows the infrastructure to restore bookmarked Edit/Detail page.
To make Edit page working correctly, you also need to provide operation with Operation.Type.UPDATE type which gives Abcs an understanding of what to perform when either Edit or Detail button is being clicked. - If you would also like to provide an Action-like operation which performs certain business rule (e.g. Fire an employee, Raise Salary etc.), Operation.Type.PERFORM should be used. Although, please be aware that these are unsupported by ABCS UI at the moment and because of that, no functionality is guaranteed by ABCS itself.
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
READ_ONE |
String | Operation that reads a single record. |
READ_MANY |
String | Operation that reads multiple records. |
CREATE |
String | Operation that creates a single record. |
UPDATE |
String | Operation that updates a single record. |
DELETE |
String | Operation that deletes a single record. |
PERFORM |
String | Operation that performs non-CRUD action. |
- Version:
- 17.1.1
- Source:
Methods
perform() → {Promise.<operation/js/api/OperationResult>}
stable API
Performs this operation.
Each Operation.perform(..) method call returns an instance of OperationResult. It either:
-
Provides returned data in case Operation perform correctly.
It also can contain any other metadata which Business Object Provider decides to return. For example PaginationCursor can be available if the perfomed Operation has type Operation.Type.READ_MANY set and provider implemented capability to paginate through the resulted records. - Provides error code, message and possibly any other additional error information in case Operation performed incorrectly.
- OperationResult.isSuccess() to check if the call was performed correctly and resulted in a OperationResult.Success.
- OperationResult.isFailure() to check if the call was performed incorrectly and resulted in an OperationResult.Failure.
- Version:
- 15.4.5
- Source:
- See:
Returns:
- Promise of the OperationResult for this operation.
- Type
- Promise.<operation/js/api/OperationResult>