Class: CreateInstance

olympe.dc.transaction.operations. CreateInstance

Create instance operation


new CreateInstance(model [, tag])

Creates a CreateInstance operation instance.

Parameters:
Name Type Argument Description
model olympe.dc.InstanceTag

Tag of the model to create an instance of or sync constructor

tag olympe.dc.InstanceTag <optional>

Tag of the newly created instance, by default it is automatically generated

Implements:

Extends

Methods


<protected> getCurrentTag(value)

Gets a tag from the specified InstanceTag or Sync constructor

Parameters:
Name Type Description
value olympe.dc.InstanceTag
Inherited From:
Overrides:
Returns:
Type
string

<protected> getCurrentValue(value)

Gets the current value of a Proxy. If this value is an ONumber, OString, ..., returns the corresponding primitive type. If this value is undefined, convert it to null.

Parameters:
Name Type Description
value olympe.df.Proxy | olympe.df.Node | *
Inherited From:
Overrides:
Returns:
Type
*

getCurrentValues(values)

Applies getCurrentValue() to all properties of the specified object and returns a new one containing the results

Parameters:
Name Type Description
values Map.<string, *>
Inherited From:
Overrides:
Returns:
Type
Map.<string, *>

getModelTag()

Gets the new instance model tag

Returns:
Type
string

getTag()

Gets the newly created instance tag

Implements:
Returns:
Type
string

localSource()

Sets the newly created instance as a local instance, i.e. the client becomes the master of the instance.


persist(persistInstance)

Set the instance as volatile if false, or set the instance to be persisted if true.

Parameters:
Name Type Description
persistInstance boolean
Returns:

this

Type
olympe.dc.transaction.operations.CreateInstance

setDefaultProperty(tag, value)

Sets a default property value of the newly created instance

Parameters:
Name Type Argument Description
tag string | olympe.dc.registry.Property
value olympe.df.OString | olympe.df.ONumber | olympe.df.OBoolean | olympe.df.Color | olympe.df.ODateTime | olympe.dc.Reference | string | number | boolean | olympe.df.Node | olympe.df.Proxy <nullable>
Returns:
Type
olympe.dc.transaction.operations.CreateInstance

setName(value)

Set the name of a newly created instance

Parameters:
Name Type Description
value string
Returns:
Type
olympe.dc.transaction.operations.CreateInstance

setProperty(tag, value)

Sets a property value of the newly created instance

Parameters:
Name Type Argument Description
tag string | olympe.dc.registry.Property
value olympe.df.OString | olympe.df.ONumber | olympe.df.OBoolean | olympe.df.Color | olympe.df.ODateTime | olympe.dc.Reference | string | number | boolean | olympe.df.Node | olympe.df.Proxy <nullable>
Returns:
Type
olympe.dc.transaction.operations.CreateInstance

setSource(source)

Set the source of this instance

Parameters:
Name Type Description
source string
Returns:
Type
olympe.dc.transaction.operations.CreateInstance

setVersion(version)

Sets the newly created instance version

Parameters:
Name Type Description
version number
Returns:
Type
olympe.dc.transaction.operations.CreateInstance