Options
All
  • Public
  • Public/Protected
  • All
Menu

This is an abstract project, which just lists the available stores.

The actual project classes are SchedulerBasicProjectMixin, SchedulerProProjectMixin, GanttProjectMixin.

Hierarchy

Index

Properties

graph

graph: Replica

A reference to the graph, this entity belongs to. Initially empty, and is populated when the entity instance is added to the replica (Replica.addEntity)

maxCalendarRange

maxCalendarRange: number

Maximum range the project calendars can iterate. The value is defined in milliseconds and by default equals 5 years roughly.

replica

replica: EngineReplica

The Replica instance containing all data for this project.

Accessors

$

  • get $(): {}
  • An object, which properties corresponds to the ChronoGraph Identifiers, created for every field.

    For example:

    class Author extends Entity.mix(Base) {
        @field()
        firstName       : string
        @field()
        lastName        : string
    }
    
    const author = Author.new()
    
    // identifier for the field `firstName`
    author.$.firstName
    
    const firstName = replica.read(author.$.firstName)

    Returns {}

$$

  • A graph identifier, that represents the whole entity.

    Returns EntityIdentifier

$entity

  • An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.

    Returns EntityMeta

Static $entity

  • An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.

    Returns EntityMeta

Methods

commit

  • This is a convenience method, that just delegates to the ChronoGraph.commit method of this entity's graph.

    If there's no graph (entity has not been added to any replica) a CommitZero constant will be returned.

    Parameters

    Returns CommitResult

commitAsync

  • This is a convenience method, that just delegates to the ChronoGraph.commitAsync method of this entity's graph.

    If there's no graph (entity has not been added to any replica) a resolved promise with CommitZero constant will be returned.

    Parameters

    Returns Promise<CommitResult>

enterGraph

  • enterGraph(replica: Replica): void
  • This method is called when entity is added to some replica.

    Parameters

    Returns void

leaveGraph

  • This method is called when entity is removed from the replica it's been added to.

    Parameters

    Returns void

setCalculations

  • setCalculations(calculations: Record<string, unknown>): Promise<Record<string, unknown>>
  • Overrides the project owned store identifiers calculation.

    Parameters

    • calculations: Record<string, unknown>

      Object providing new identifier calculation function names. The object is grouped by store identifiers. For example below code overrides event startDate, endDate and duration calculation so the fields will always simply return their current values:

      // event startDate, endDate and duration will use their userProvidedValue method
      // which simply returns their current values as-is
      const oldCalculations = await project.setCalculations({
          events : {
              startDate : "userProvidedValue",
              endDate   : "userProvidedValue",
              duration  : "userProvidedValue"
          }
      })

    Returns Promise<Record<string, unknown>>

    Promise that resolves with an object having the overridden calculations. The object can be used to toggle the calculations back in the future:

    // override event duration calculation
    const oldCalculations = await project.setCalculations({
        events : {
            duration  : "userProvidedValue"
        }
    })
    // revert the duration calculation back
    project.setCalculations(oldCalculations)

userProvidedValue

Generated using TypeDoc