Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

ComplexChangeset

pentaho.type.changes. ComplexChangeset

The class ComplexChangeset describes a set of changes to the values of properties in a complex value.

AMD Module

require(["pentaho/type/changes/ComplexChangeset"], function(ComplexChangeset) { /* code goes here */ });

Extends

Constructor

Name Description
new ComplexChangeset(transaction, owner)

Creates a new instance.

Members

Name Description
base :  function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

hasChanges :  boolean

Gets a value that indicates if this changeset contains any changes, whether they are primitive or in contained changesets.

isReadOnly :  boolean

Gets a value that indicates if the changeset is in a read-only state and can no longer be modified.

owner :  pentaho.type.Complex

Gets the complex value where the changes take place.

ownerVersion :  number

Gets the version of the owner at the time when the changeset was created.

propertyNames :  Array.<<code>string>

Gets an array with the names of all of the changed properties contained in this changeset.

transaction :  pentaho.type.changes.Transaction

Gets the owning transaction.

transactionVersion :  number

Gets the transaction version of this changeset.

transactionVersionLocal :  number

Gets the local transaction version of this changeset.

type :  string

Gets the type of change.

Methods

Name Description
__onChildTxnVersionDirty()

Called by a child changeset when its version changes or becomes dirty.

_apply(target)
Protected

Applies any local primitive changes.

_assertWritable()
Protected

Throws an error if the changeset is read-only.

_clearChanges()
Protected

Actually removes all changes from this changeset.

_clearChangesRecursive(parentChangeset)
Protected

Called by a parent changeset on its child changeset, this, for it to clear its changes.

_resetNetOrder()
Protected

Resets the topological order of this changeset, and of any child changesets, by calculating it based on its current parents.

_setTransactionVersion(txnVersion, noNotifyParentChangeset)
Protected

Updates the transaction version to a given value, if it is greater than the current one. Notifies all parents, except the optionally specified one, that their version is dirty.

_setTransactionVersionLocal(txnVersionLocal, noNotifyParentChangeset)
Protected

Updates the local transaction version to a given value due to a local, primitive change, if it is greater than the current one. Then, it calls _setTransactionVersion with the same arguments.

clearChanges()

Removes all changes from this changeset.

eachChildChangeset(fun, ctx)

Calls a function once per child changeset.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

getChange(propertyOrName) : pentaho.type.changes.Change

Gets the change object associated with the specified property.

getOld(name) : pentaho.type.Value

Gets the original value of a property.

hasChange(propertyOrName) : boolean

Determines if the given property has changed.

Constructor Details

new ComplexChangeset(transaction, owner)

Creates a new instance.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 30

Parameters:
Name Default Value Summary
transaction : pentaho.type.changes.Transaction

The owning transaction.

owner : pentaho.type.Complex

The complex value where the changes take place.

Members Details

base:  function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Can also be called from within a constructor function.

Source: javascript/web/pentaho/lang/Base.js, line 299

Inherited From: pentaho.lang.Base#base

hasChanges:  boolean

Gets a value that indicates if this changeset contains any changes, whether they are primitive or in contained changesets.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 386

Overrides: pentaho.type.changes.Changeset#hasChanges

isReadOnly:  boolean

Gets a value that indicates if the changeset is in a read-only state and can no longer be modified.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 216

Inherited From: pentaho.type.changes.Changeset#isReadOnly

owner:  pentaho.type.Complex

Gets the complex value where the changes take place.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 64

Overrides: pentaho.type.changes.Changeset#owner

ownerVersion:  number

Gets the version of the owner at the time when the changeset was created.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 239

Inherited From: pentaho.type.changes.Changeset#ownerVersion

propertyNames:  Array.<<code>string>

Gets an array with the names of all of the changed properties contained in this changeset.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 154

transaction:  pentaho.type.changes.Transaction

Gets the owning transaction.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 51

Inherited From: pentaho.type.changes.Changeset#transaction

transactionVersion:  number

Gets the transaction version of this changeset.

This number is at least as high as the transaction version of any child changesets and primitive changes.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 263

Inherited From: pentaho.type.changes.Changeset#transactionVersion

transactionVersionLocal:  number

Gets the local transaction version of this changeset.

This number is the maximum transaction version of the contained primitive changes.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 251

Inherited From: pentaho.type.changes.Changeset#transactionVersionLocal

type:  string

Gets the type of change.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 80

Default Value: "complex"

Overrides: pentaho.type.changes.Changeset#type

Methods Details

__onChildTxnVersionDirty()

Called by a child changeset when its version changes or becomes dirty.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 378

Inherited From: pentaho.type.changes.Changeset#__onChildTxnVersionDirty

_apply(target)
Protected

Applies any local primitive changes.

Source: javascript/web/pentaho/type/changes/Change.js, line 60

Overrides: pentaho.type.changes.Changeset#_apply

Parameters:
Name Default Value Summary
target : pentaho.type.mixins.Container

The container to which changes are applied.

_assertWritable()
Protected

Throws an error if the changeset is read-only.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 205

Inherited From: pentaho.type.changes.Changeset#_assertWritable

Throws:
Name Description
pentaho.lang.OperationInvalidError

When the changeset has been marked read-only.

_clearChanges()
Protected

Actually removes all changes from this changeset.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 446

Overrides: pentaho.type.changes.Changeset#_clearChanges

See also: pentaho.type.changes.Changeset#clearChanges

_clearChangesRecursive(parentChangeset)
Protected

Called by a parent changeset on its child changeset, this, for it to clear its changes.

This method updates the transaction version of this changeset to match the parent's version and then delegates to the _clearChanges method.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 434

Inherited From: pentaho.type.changes.Changeset#_clearChangesRecursive

Parameters:
Name Default Value Summary
parentChangeset : pentaho.type.changes.Changeset

The parent changeset.

See also: pentaho.type.changes.Changeset#transactionVersion , pentaho.type.changes.Changeset#clearChanges

_resetNetOrder()
Protected

Resets the topological order of this changeset, and of any child changesets, by calculating it based on its current parents.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 110

Inherited From: pentaho.type.changes.Changeset#_resetNetOrder

See also: pentaho.type.changes.Changeset#__calculateNetOrder

_setTransactionVersion(txnVersion, noNotifyParentChangeset)
Protected

Updates the transaction version to a given value, if it is greater than the current one. Notifies all parents, except the optionally specified one, that their version is dirty.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 307

Inherited From: pentaho.type.changes.Changeset#_setTransactionVersion

Parameters:
Name Default Value Summary
txnVersion : number

The new transaction version.

noNotifyParentChangeset : pentaho.type.changes.Changeset
Optional
null

The parent changeset that should not be notified.

_setTransactionVersionLocal(txnVersionLocal, noNotifyParentChangeset)
Protected

Updates the local transaction version to a given value due to a local, primitive change, if it is greater than the current one. Then, it calls _setTransactionVersion with the same arguments.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 334

Inherited From: pentaho.type.changes.Changeset#_setTransactionVersionLocal

Parameters:
Name Default Value Summary
txnVersionLocal : number

The new local transaction version.

noNotifyParentChangeset : pentaho.type.changes.Changeset
Optional
null

The parent changeset that should not be notified.

clearChanges()

Removes all changes from this changeset.

Primitive changes are removed, while contained changesets are cleared.

This method validates that the changeset is in a valid state and then delegates actual work to the _clearChangesRecursive method.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 415

Inherited From: pentaho.type.changes.Changeset#clearChanges

Throws:
Name Description
pentaho.lang.OperationInvalidError

When the changeset or any of its contained changesets have been marked read-only.

See also: pentaho.type.changes.Changeset#_clearChanges , pentaho.type.changes.Changeset#_clearChangesRecursive

eachChildChangeset(fun, ctx)

Calls a function once per child changeset.

Source: javascript/web/pentaho/type/changes/Changeset.js, line 185

Overrides: pentaho.type.changes.Changeset#eachChildChangeset

Parameters:
Name Default Value Summary
fun : function

The function to call.

ctx : any

The this context on which to call fun.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

Methods that are overridden are accessible through this.base.

This object is extended, but its class doesn't change.

Source: javascript/web/pentaho/lang/Base.js, line 1037

Inherited From: pentaho.lang.Base#extend

Parameters:
Name Default Value Summary
source : Object

The instance specification.

keyArgs : Object
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : Object
Optional

A map of property names to exclude from source.

Returns:
Name Description
Object

This object.

getChange(propertyOrName) : pentaho.type.changes.Change

Gets the change object associated with the specified property.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 104

Parameters:
Name Default Value Summary
propertyOrName : nonEmptyString | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
pentaho.type.changes.Change

An object describing the changes to be performed in the given property, or null if the property has not changed.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name propertyOrName is not defined.

getOld(name) : pentaho.type.Value

Gets the original value of a property.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 201

Parameters:
Name Default Value Summary
name : nonEmptyString | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
pentaho.type.Value

The original value of the property (before the change).

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

hasChange(propertyOrName) : boolean

Determines if the given property has changed.

Source: javascript/web/pentaho/type/changes/ComplexChangeset.js, line 131

Parameters:
Name Default Value Summary
propertyOrName : nonEmptyString | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
boolean

true if the property has changed; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name propertyOrName is not defined.