new OperationList( [id])
Creates anOperationList.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
id |
string |
<optional> |
the patch id |
- Implements:
Members
-
<static> OPERATIONS :number
-
Patch operations
Type:
- number
Properties:
Name Type Default Description CREATE_INSTANCEnumber 1 UPDATE_INSTANCEnumber 2 DELETE_INSTANCEnumber 3 CREATE_RELATIONnumber 4 DELETE_RELATIONnumber 5
Methods
-
applyOperationsTo(writable)
-
Updates the specified object (writable) with the operation accumulated in this patch.
Parameters:
Name Type Description writableolympe.dc.Writable the writable on which apply the operations contained in this patch.
- Implements:
Returns:
By convention, the writable given as parameter is returned to ease chaining.
- Type
- olympe.dc.Writable
-
concat(otherOperationList)
-
Concat all the operations of the specified other operation list.
Parameters:
Name Type Description otherOperationListolympe.dc.transaction.OperationList -
createInstance(tag [, properties] [, id])
-
Creates an instance and returns it's tag
Parameters:
Name Type Argument Description tagstring New instance tag
propertiesMap.<string, ?*> <optional>
Instance's properties (map of properties names to values)
idnumber <optional>
operationId
- Implements:
-
createRelation(relationTag, originTag, destinationTag [, id])
-
Creates a relation between two instances.
Parameters:
Name Type Argument Description relationTagstring Tag of the relation
originTagstring Origin instance tag
destinationTagstring Destination instance tag
idnumber <optional>
operationId
- Implements:
-
deleteInstance(tag [, followRule] [, id])
-
Deletes the specified instance. If specified, apply the follow rules to make a clean delete.
Parameters:
Name Type Argument Description tagstring followRuleolympe.dc.FollowRules <optional>
idnumber <optional>
operationId
- Implements:
-
deleteRelation(relationTag, originTag, destinationTag [, id])
-
Removes a relation between two instances
Parameters:
Name Type Argument Description relationTagstring Tag of the relation
originTagstring Origin instance tag
destinationTagstring Destination instance tag
idnumber <optional>
operationId
- Implements:
-
getId()
-
Return the patch id
- Implements:
Returns:
- Type
- string
-
getSize()
-
Return the number of primitive operation this patch is made from
- Implements:
Returns:
- Type
- number
-
updateInstance(tag [, properties] [, forceUpdate] [, id])
-
Updates an instance.
- If the instance does not exist, it will be automatically created
- Depending on the implementation, updates will be rejected if the provided "new" version is lower than the stored one
Parameters:
Name Type Argument Default Description tagstring Instance tag
propertiesMap.<string, ?*> <optional>
Instance properties
forceUpdateboolean <optional>
false If true, do not do any version check and accepts any update (used by rollbacks)
idnumber <optional>
operationId
- Implements:
Olympe SDK