Options
All
  • Public
  • Public/Protected
  • All
Menu

A mixin for the resource entity at the Scheduler Pro level.

Hierarchy

Index

Properties

$project

The project instance, this entity belongs to.

assigned

assigned: Set<InstanceType<this["project"]["assignmentModelClass"]>>

A set of events assigned to this resource

calendar

The calendar of this entity.

Please use effectiveCalendar to get the calendar that is actually used by the entity. The calendar reflects only the value provided to this entity while effectiveCalendar returns the calendar that is really used (falls back to the project calendar in case the own calendar is not provided).

cost

cost: number

The total projected cost for the resource.

costAccrual

costAccrual: CostAccrual

Specifies how and when the resource cost are to be charged, or accrued, to the cost of an event. The options are:

  • Start - costs are charged when events start
  • Prorated - costs are prorated across event durations
  • End - costs are charged when events finish

defaultRateTable

Specifies which rate table to use by default when assigning the resource.

effectiveCalendar

effectiveCalendar: BaseCalendarMixin

The effective calendar used by this entity (either its own calendar if provided or the project calendar) for data calculation purposes.

effectiveVisualCalendar

effectiveVisualCalendar: BaseCalendarMixin

The effective calendar used by this entity (either its own calendar if provided or the project calendar) for data visualizing purposes.

getCalendar

getCalendar: () => BaseCalendarMixin

Gets the calendar.

Type declaration

getDefaultRateTable

getDefaultRateTable: () => SchedulerProResourceRateTable

Generated getter for the defaultRateTable field

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)

maxUnits

maxUnits: number

A maximum "capacity" for this resource, in percents. Corresponds to SchedulerProAssignmentMixin.units property. Default value is 100. If the sum of all "units" of all assignments of resource for a certain period exceeds this value, such resource is marked as "over-allocated" in the resource histogram.

project

The project instance, this entity belongs to.

rateTables

rateTables: SchedulerProResourceRateTableStore

The resource rate tables.

setCalendar

setCalendar: (calendar: BaseCalendarMixin | ModelId) => Promise<CommitResult>

Sets the calendar. The method triggers schedule change propagation and returns a Promise:

// set calendar
model.setCalendar(calendar1).then(() => {
    // some code to run after schedule got updated
    ...
})

It also adds the calendar to the project calendar manager.

Type declaration

setDefaultRateTable

setDefaultRateTable: (defaultRateTable: SchedulerProResourceRateTable | string | number) => Promise<CommitResult>

Generated setter for the defaultRateTable field

Type declaration

type

Indicates whether the resource is a work, material or a cost resource. Work resources are people and equipment. Material resources are consumable supplies, such as concrete, or soil. And cost resources let to apply a cost to an event by assigning a cost item (like an extra expenditure on flights) to that event.

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

addRateTable

calculateEffectiveCalendar

calculateEffectiveVisualCalendar

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

getAssignmentById

  • getAssignmentById(id: ModelId): this["project"]["assignmentStore"]["modelInstanceT"]

getAssignmentStore

  • getAssignmentStore(): this["project"]["assignmentStore"]

getCalendarById

  • getCalendarById(id: ModelId): this["project"]["calendarManagerStore"]["modelInstanceT"]

getCalendarManagerStore

  • getCalendarManagerStore(): this["project"]["calendarManagerStore"]

getDependencyById

  • getDependencyById(id: ModelId): this["project"]["dependencyStore"]["modelInstanceT"]

getDependencyStore

  • getDependencyStore(): this["project"]["dependencyStore"]

getEventById

  • getEventById(id: ModelId): this["project"]["eventStore"]["modelInstanceT"]

getEventStore

  • getEventStore(): this["project"]["eventStore"]

getGraph

getProject

  • getProject(): this["project"]

getRate

getRates

getResourceById

  • getResourceById(id: ModelId): this["project"]["resourceStore"]["modelInstanceT"]

getResourceStore

  • getResourceStore(): this["project"]["resourceStore"]

joinProject

  • joinProject(): void

leaveGraph

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

    Parameters

    Returns void

leaveProject

  • leaveProject(isReplacing?: boolean): void

removeRateTable

setProject

  • setProject(project: this["project"]): this["project"]

userProvidedValue

Generated using TypeDoc