new PatchGenerator(db [, transactionId])
Creates a PatchGenerator.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
db |
olympe.dc.DBView | ||
transactionId |
string |
<optional> |
ID used for the creation of patches and rollback patches |
Methods
-
createInstance(tag, persist [, properties])
-
Creates an instance and returns it's tag
Parameters:
Name Type Argument Description tagstring New instance tag
persistboolean Should persist this instance or not
propertiesMap.<string, ?*> <optional>
Instance's properties (map of properties names to values)
-
createRelation(relation, originTag, destinationTag)
-
Creates a relation between two instances on the specified destination
Parameters:
Name Type Description relationstring Type of the relation
originTagstring Origin instance tag
destinationTagstring Destination instance tag
-
deleteInstance(tag, followRule)
-
Deletes an instance
Parameters:
Name Type Description tagstring followRuleolympe.dc.FollowRules -
deleteRelation(relation, originTag, destinationTag)
-
Removes a relation between two instances on the specified destination
Parameters:
Name Type Description relationstring Type of the relation
originTagstring Origin instance tag
destinationTagstring Destination instance tag
-
getGlobalPatch()
-
Return the patch containing all the operations united
Returns:
-
getInstanceVersion(tag)
-
Gets the version of the specified instance inside the patch
Parameters:
Name Type Description tagstring Instance tag
Returns:
Instance version if found in patch
- Type
- number | undefined
-
getPatches()
-
Return an iterator over all patch and their destination
Returns:
- Type
- Map.<string, !olympe.dc.db.GraphPatch>
-
getSize()
-
Returns the number of generated patches
Returns:
- Type
- number
-
isEmpty()
-
Returns true if the patch generator is empty
Returns:
- Type
- boolean
-
isPersistedInstance(tag)
-
Return whether the specified instance is marked as persisted or not, considering this transaction.
Parameters:
Name Type Description tagstring Returns:
- Type
- boolean
-
persist(persist)
-
Sets the persist flag. If true, force all instances to be created locally, even if they have a remote source
Parameters:
Name Type Description persistboolean -
setInstanceDeleted(tag)
-
Marks an instance as deleted`
Parameters:
Name Type Description tagstring -
<package> updatedInstances()
-
Return the list of instances updated or created in this transaction.
Returns:
- Type
- Iterable.<string>
-
updateInstance(tag [, properties] [, forceUpdate])
-
Updates an instance.
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)
Type Definitions
-
PatchApplier(destination, patch)
-
Parameters:
Name Type Description destinationstring patcholympe.dc.db.GraphPatch
Olympe SDK