Options
All
  • Public
  • Public/Protected
  • All
Menu

Basic Scheduler project mixin type. At this level, events have assignments and dependencies, which both are, however, only visual and do not affect the scheduling.

Hierarchy

Index

Properties

Accessors

Methods

Properties

$project

The project instance, this entity belongs to.

assignmentModelClass

assignmentModelClass: typeof BaseAssignmentMixin

The constructor for the "Assignment" entity of the project

assignmentStore

The instance of the "Assignments" collection of the project

assignmentStoreClass

assignmentStoreClass: typeof ChronoAssignmentStoreMixin

The constructor for the "Assignments" collection of the project

assignmentsData

assignmentsData: any[]

The assignments data - can be provided during project instantiation and will be loaded with loadInlineData.

const project    = new SchedulerBasicProjectMixin({
    eventsData       : [
        { id : 1, name : 'Predecessor' },
        { id : 2, name : 'Successor' }
    ],
    assignmentsData : [
        { event : 1, resource : 101 },
        { event : 2, resource : 101 },
        { event : 2, resource : 102 }
    ]
    resourcesData   : [
        { id : 100, name : 'John' },
        { id : 101, name : 'Mary' },
        { id : 102, name : 'Gabriel' }
    ]
})

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).

calendarManagerStore

calendarManagerStore: ChronoCalendarManagerStoreMixin

The instance of the "Calendars" collection of the project

calendarManagerStoreClass

calendarManagerStoreClass: typeof ChronoCalendarManagerStoreMixin

The constructor for the "Calendars" collection of the project

calendarModelClass

calendarModelClass: typeof BaseCalendarMixin

The constructor for the "Calendar" entity of the project

calendarsData

calendarsData: any[]

The calendars data - can be provided during project instantiation and will be loaded with loadInlineData.

const project    = new SchedulerBasicProjectMixin({
    calendar      : 1,
    calendarsData : [
        {
            id        : 1,
            name      : 'Default',
            intervals : [
                {
                    recurrentStartDate : 'on Sat at 0:00',
                    recurrentEndDate   : 'on Mon at 0:00',
                    isWorking          : false
                }
            ]
        }
    ]
})

cycleEffectClass

cycleEffectClass: typeof CycleEffect

The constructor for the cycle effect - the effect indicating a computation cycle.

daysPerMonth

daysPerMonth: number

The number of days per month.

Please note: the value does not define the amount of working time per month for that purpose one should use calendars.

The value is used when converting the duration from one unit to another. So when user enters a duration of, for example, 1 month the system understands that it actually means 30 days (which is then converted to hours) and schedules accordingly.

daysPerWeek

daysPerWeek: number

The number of days per week.

Please note: the value does not define the amount of working time per week for that purpose one should use calendars.

The value is used when converting the duration from one unit to another. So when user enters a duration of, for example, 2 weeks the system understands that it actually means 14 days (which is then converted to hours) and schedules accordingly.

dependenciesData

dependenciesData: any[]

The dependencies data - can be provided during project instantiation and will be loaded with loadInlineData.

const project    = new SchedulerBasicProjectMixin({
    eventsData       : [
        { id : 1, name : 'Predecessor' },
        { id : 2, name : 'Successor' }
    ],
    dependenciesData : [ { fromEvent : 1, toEvent : 2 } ]
    resourcesData   : [
        { name : 'Bulldozer' }
    ]
})

dependencyModelClass

dependencyModelClass: typeof BaseDependencyMixin

The constructor for the "Dependency" entity of the project

dependencyStore

The instance of the "Dependencies" collection of the project

dependencyStoreClass

dependencyStoreClass: typeof ChronoDependencyStoreMixin

The constructor for the "Dependencies" collection of the project

direction

direction: Direction

The scheduling direction of the event. The Forward direction corresponds to the as-soon-as-possible scheduling (ASAP), Backward - to as-late-as-possible (ALAP).

If not specified (which is the default), direction is inherited from the parent task (and from project for the top-level tasks). By default, the project model has forward scheduling mode.

dispatcher

dispatcher: SEDDispatcher

The dispatcher instance for this event. Dispatcher accumulates the information about user input and decide which formula to use for calculation of every related field (startDate, endDate and duration at this level).

Every field can be calculated with 2 type of formulas. The 1st one is called "proposed" and it is used when there is a user input for this field ("proposed" input), or, when user intention is to keep the previous value of the field. The 2nd type is called "pure" and it is used, when a value of the field should be calculated "purely" based on the values of other fields.

See CycleResolverGuide for more information.

duration

duration: Duration

The duration of the event. See also durationUnit.

durationUnit

durationUnit: TimeUnit

The duration unit of the event's duration. See also duration.

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.

endDate

endDate: Date

The end date of the event. Can also be provided as a string, parsable with DateHelper.parse()

eventModelClass

eventModelClass: typeof SchedulerBasicEvent

The constructor for the "Event" entity of the project.

eventStore

The instance of the "Events" collection of the project

eventStoreClass

eventStoreClass: typeof ChronoEventStoreMixin

The constructor for the "Events" collection of the project

eventsData

eventsData: any[]

The events data - can be provided during project instantiation and will be loaded with loadInlineData.

const project    = new SchedulerBasicProjectMixin({
    eventsData   : [ { name : 'Task 1' } ]
})

getCalendar

getCalendar: () => BaseCalendarMixin

Gets the calendar.

Type declaration

getDirection

getDirection: () => Direction

Getter for direction field.

Type declaration

getEndDate

getEndDate: () => Date

Gets the event end date.

Type declaration

    • (): Date
    • Returns Date

getStartDate

getStartDate: () => Date

Gets the event start date

Type declaration

    • (): Date
    • Returns Date

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)

hoursPerDay

hoursPerDay: number

The number of hours per day.

Please note: the value does not define the amount of working time per day for that purpose one should use calendars.

The value is used when converting the duration from one unit to another. So when user enters a duration of, for example, 5 days the system understands that it actually means 120 hours and schedules accordingly.

manuallyScheduled

manuallyScheduled: boolean

A boolean field, indicating whether this event should be scheduled automatically or its startDate and endDate are supposed to be defined manually.

maxCalendarRange

maxCalendarRange: number

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

project

The project instance, this entity belongs to.

replica

replica: EngineReplica

The Replica instance containing all data for this project.

resetUndoRedoQueuesAfterLoad

resetUndoRedoQueuesAfterLoad: boolean

Set to true to reset the undo/redo queues of the internal StateTrackingManager after the Project has loaded. Defaults to false

resourceModelClass

resourceModelClass: typeof BaseResourceMixin

The constructor for the "Resource" entity of the project

resourceStore

The instance of the "Resources" collection of the project

resourceStoreClass

resourceStoreClass: typeof ChronoResourceStoreMixin

The constructor for the "Resources" collection of the project

resourcesData

resourcesData: any[]

The resources data - can be provided during project instantiation and will be loaded with loadInlineData.

const project    = new SchedulerBasicProjectMixin({
    resourcesData   : [
        { name : 'John' },
        { name : 'Mary' },
        { name : 'Sarah' },
        { name : 'Robert' }
    ]
})

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

setDirection

setDirection: (value: Direction) => Promise<CommitResult>

Setter for direction field.

Type declaration

skipNonWorkingTimeInDurationWhenSchedulingManually

skipNonWorkingTimeInDurationWhenSchedulingManually: boolean

When true the project's manually scheduled tasks adjust their duration by excluding the non-working time from it, according to the calendar.

Default value is true

skipNonWorkingTimeWhenSchedulingManually

skipNonWorkingTimeWhenSchedulingManually: boolean

When true the project manually scheduled tasks adjust their proposed start/end dates to skip non working time.

Default value is false

startDate

startDate: Date

The start date of the event. Can also be provided as a string, parsable with DateHelper.parse()

stm

stm: StateTrackingManager

State tracking manager instance the project relies on

unspecifiedTimeIsWorking

unspecifiedTimeIsWorking: boolean

This property is used when instantiating the default calendar of the project. This calendar will have no availability intervals, so this setting will either turn the whole timespan into working time or non-working.

Default value is true

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

enableProgressNotifications

  • set enableProgressNotifications(value: boolean): void

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

calculateDuration

calculateDurationProposed

calculateDurationPure

calculateEffectiveCalendar

calculateEffectiveVisualCalendar

calculateEndDate

calculateEndDateProposed

calculateEndDatePure

calculateMaxChildrenEndDate

calculateMinChildrenStartDate

calculateProjectedDuration

calculateProjectedXDateWithDuration

calculateStartDate

calculateStartDateProposed

calculateStartDatePure

combineCalendars

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>

convertDuration

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"]

getDefaultAssignmentModelClass

  • getDefaultAssignmentModelClass(): this["assignmentModelClass"]

getDefaultAssignmentStoreClass

  • getDefaultAssignmentStoreClass(): this["assignmentStoreClass"]

getDefaultCalendarManagerStoreClass

  • getDefaultCalendarManagerStoreClass(): this["calendarManagerStoreClass"]

getDefaultCalendarModelClass

  • getDefaultCalendarModelClass(): this["calendarModelClass"]

getDefaultDependencyModelClass

  • getDefaultDependencyModelClass(): this["dependencyModelClass"]

getDefaultDependencyStoreClass

  • getDefaultDependencyStoreClass(): this["dependencyStoreClass"]

getDefaultEventModelClass

  • getDefaultEventModelClass(): this["eventModelClass"]

getDefaultEventStoreClass

  • getDefaultEventStoreClass(): this["eventStoreClass"]

getDefaultResourceModelClass

  • getDefaultResourceModelClass(): this["resourceModelClass"]

getDefaultResourceStoreClass

  • getDefaultResourceStoreClass(): this["resourceStoreClass"]

getDependencyById

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

getDependencyStore

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

getDuration

getEventById

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

getEventStore

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

getGraph

getProject

  • getProject(): this["project"]

getResourceById

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

getResourceStore

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

hasSubEvents

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

loadInlineData

queue

  • queue(fn: () => any, handleReject?: (error: Error | any) => any): Promise<any>
  • Use this method to organize project changes into transactions. Every queue call will create a sequential promise which cannot be interrupted by other queued functions. You can use async functions and await for any promises (including commitAsync) with one exception - you cannot await for other queued calls and any other function/promise which awaits queued function. Otherwise, an unresolvable chain of promises may be created.

    NOTE: Functions which call this method inside are marked with on-queue tag.

    Examples:

    // Invalid queue call which hangs promise chain
    project.queue(async () => {
        const event = project.getEventStore().getById(1);
        await project.queue(() => {
            event.duration = 2;
            return project.commitAsync();
        })
    })
    
    // Valid queue call
    project.queue(() => {
        const event = project.getEventStore().getById(1);
    
        // Consequent queue call will be chained after the current function in the next microtask.
        project.queue(() => {
            event.duration = 2;
            return project.commitAsync();
        })
    
        // Event duration is not yet changed - this condition is true
        if (event.duration !== 2) { }
    })
    internal
    on-queue

    Parameters

    • fn: () => any
        • (): any
        • Returns any

    • Optional handleReject: (error: Error | any) => any
        • (error: Error | any): any
        • Parameters

          • error: Error | any

          Returns any

    Returns Promise<any>

setAssignmentStore

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)

setCalendarManagerStore

setDependencyStore

setDuration

setEndDate

  • setEndDate(date: Date, keepDuration?: boolean): Promise<CommitResult>

setEventStore

setProject

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

setResourceStore

setStartDate

  • setStartDate(date: Date, keepDuration?: boolean): Promise<CommitResult>

shouldRollupChildEndDate

shouldRollupChildStartDate

skipNonWorkingTime

skipWorkingTime

subEventsIterable

tryPropagateWithChanges

  • tryPropagateWithChanges(changerFn: Function): Promise<boolean>

userProvidedValue

Generated using TypeDoc