new PatchSerializer( [separateComplexProps])
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
separateComplexProps |
boolean |
<optional> |
false |
- Implements:
Methods
-
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(type, leftTag, rightTag [, id])
-
Creates a relation between two instances.
Parameters:
Name Type Argument Default Description typestring Tag of the relation
leftTagstring Left instance tag
rightTagstring Right instance tag
idnumber <optional>
-1 operationId
- Implements:
-
deleteInstance(tag [, followRule] [, id])
-
Deletes an instance
- Removing a non existing instance does not trigger an error
- Removing an instance that still has relations does not trigger an error
Parameters:
Name Type Argument Description tagstring followRuleolympe.dc.FollowRules <optional>
idnumber <optional>
operationId
- Implements:
-
deleteRelation(type, leftTag, rightTag [, id])
-
Removes a relation between two instances
Parameters:
Name Type Argument Default Description typestring Tag of the relation
leftTagstring Left instance tag
rightTagstring Right instance tag
idnumber <optional>
-1 operationId
- Implements:
-
flush()
-
Returns and clears the serialization output
Returns:
- Type
- string
-
flushArray()
-
Returns the serialized patch as an array, ready to be stringify and clears the serializer
Returns:
- Type
- Array
-
flushObject()
-
Return all accumulated operations split by types.
Returns:
-
reset()
-
Resets the serialization output
-
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:
Type Definitions
-
MultiPatchContents
-
Type:
- Object
Properties:
Name Type Argument Description deleteRelationsArray.<!Object> <nullable>
deleteInstancesArray.<!Object> <nullable>
newInstancesArray.<!Object> <nullable>
updateInstancesArray.<!Object> <nullable>
newRelationsArray.<!Object> <nullable>
-
PatchContent
-
NB: Use quoted property names (e.g. content['rootTag']) to prevent Google Closure from optimizing them out. These properties must be preserved to be serialized in JSON files. They are required by the Orchestrator.
Type:
- Object
Properties:
Name Type Description onumber mstring lstring rstring folympe.dc.FollowRules pObject inumber
Olympe SDK