Options
All
  • Public
  • Public/Protected
  • All
Menu

This is an event class, SchedulerBasicProjectMixin is working with. It is constructed as BaseEventMixin, enhanced with BaseHasAssignmentsMixin and HasDependenciesMixin

tier

enterprise

tier-for-gantt

core

Hierarchy

Index

Properties

$project

The project instance, this entity belongs to.

assigned

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

A set of resources assigned to this task

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

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

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)

incomingDeps

incomingDeps: Set<InstanceType<this["project"]["dependencyModelClass"]>>

A set of incoming dependencies for this task (dependencies which ends at this task)

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.

outgoingDeps

outgoingDeps: Set<InstanceType<this["project"]["dependencyModelClass"]>>

A set of outgoing dependencies from this task (dependencies which starts at this task)

project

The project instance, this entity belongs to.

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

startDate

startDate: Date

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

Static endDateNonWorkingTimeSkipDirection

endDateNonWorkingTimeSkipDirection: Direction = Direction.Backward

Specifies the direction of how the event skips non-working time when calculating its endDate. Default value Direction.Backward

Static startDateNonWorkingTimeSkipDirection

startDateNonWorkingTimeSkipDirection: Direction = Direction.Forward

Specifies the direction of how the event skips non-working time when calculating its startDate. Default value Direction.Forward

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

assign

  • assign(resource: InstanceType<this["project"]["resourceModelClass"]>): Promise<any>
  • A method which assigns a resource to the current event

    Parameters

    • resource: InstanceType<this["project"]["resourceModelClass"]>

    Returns Promise<any>

calculateDuration

calculateDurationProposed

calculateDurationPure

calculateEffectiveCalendar

calculateEffectiveVisualCalendar

calculateEndDate

calculateEndDateProposed

calculateEndDatePure

calculateProjectedDuration

calculateProjectedXDateWithDuration

  • This method calculates the opposite date of the event.

    Parameters

    • baseDate: Date

      The base date of the event (start or end date)

    • isForward: boolean

      Boolean flag, indicating whether the given baseDate is start date (true) or end date (false)

    • duration: Duration

      Duration of the event, in its durationUnits

    • Optional durationUnit: TimeUnit

    Returns CalculationIterator<Date>

calculateStartDate

calculateStartDateProposed

calculateStartDatePure

canConvertDuration

  • Indicates whether the event can perform the provided duration conversion. The event might not be able to convert units on early stages of data loading when the project has not loaded its conversion rates yet. So the method by default checks that the project has loaded the rates needed for conversion.

    Parameters

    • duration: Duration

      Duration value

    • fromUnit: TimeUnit

      Duration value time unit

    • toUnit: TimeUnit

      Target time unit to convert the value to

    Returns boolean

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>

convertDurationGen

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"]
  • Convenience method to get the instance of assignment by its id.

    Parameters

    • id: ModelId

    Returns this["project"]["assignmentStore"]["modelInstanceT"]

getAssignmentFor

  • getAssignmentFor(resource: InstanceType<this["project"]["resourceModelClass"]>): InstanceType<this["project"]["assignmentModelClass"]> | null
  • If a given resource is assigned to this task, returns a BaseAssignmentMixin instance for it. Otherwise returns null

    Parameters

    • resource: InstanceType<this["project"]["resourceModelClass"]>

    Returns InstanceType<this["project"]["assignmentModelClass"]> | null

getAssignmentStore

  • getAssignmentStore(): this["project"]["assignmentStore"]
  • Convenience method to get the instance of the assignment store in the project instance, this entity belongs to.

    Returns this["project"]["assignmentStore"]

getCalendarById

  • getCalendarById(id: ModelId): this["project"]["calendarManagerStore"]["modelInstanceT"]
  • Convenience method to get the instance of calendar by its id.

    Parameters

    • id: ModelId

    Returns this["project"]["calendarManagerStore"]["modelInstanceT"]

getCalendarManagerStore

  • getCalendarManagerStore(): this["project"]["calendarManagerStore"]
  • Convenience method to get the instance of the calendar manager store in the project instance, this entity belongs to.

    Returns this["project"]["calendarManagerStore"]

getDependencyById

  • getDependencyById(id: ModelId): this["project"]["dependencyStore"]["modelInstanceT"]
  • Convenience method to get the instance of dependency by its id.

    Parameters

    • id: ModelId

    Returns this["project"]["dependencyStore"]["modelInstanceT"]

getDependencyStore

  • getDependencyStore(): this["project"]["dependencyStore"]
  • Convenience method to get the instance of the dependency store in the project instance, this entity belongs to.

    Returns this["project"]["dependencyStore"]

getDuration

  • Duration getter. Returns the duration of the event, in the given unit. If unit is not given, returns duration in durationUnit.

    Parameters

    Returns Duration

getDurationConverter

getEventById

  • getEventById(id: ModelId): this["project"]["eventStore"]["modelInstanceT"]
  • Convenience method to get the instance of event by its id.

    Parameters

    • id: ModelId

    Returns this["project"]["eventStore"]["modelInstanceT"]

getEventStore

  • getEventStore(): this["project"]["eventStore"]
  • Convenience method to get the instance of the event store in the project instance, this entity belongs to.

    Returns this["project"]["eventStore"]

getGraph

getProject

  • getProject(): this["project"]

getResourceById

  • getResourceById(id: ModelId): this["project"]["resourceStore"]["modelInstanceT"]
  • Convenience method to get the instance of resource by its id.

    Parameters

    • id: ModelId

    Returns this["project"]["resourceStore"]["modelInstanceT"]

getResourceStore

  • getResourceStore(): this["project"]["resourceStore"]
  • Convenience method to get the instance of the resource store in the project instance, this entity belongs to.

    Returns 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

setDuration

  • Duration setter.

    Parameters

    • duration: Duration

      The new duration to set.

    • Optional unit: TimeUnit

      The unit for new duration. Optional, if missing the durationUnit value will be used.

    • Optional keepStart: boolean

      A boolean flag, indicating, whether the intention is to keep the start date (true) or end date (false)

    Returns Promise<CommitResult>

    A Promise resolved when the schedule has been recalculated. Await it before reading the resulting dates back from the record.

setEndDate

  • setEndDate(date: Date, keepDuration?: boolean): Promise<CommitResult>
  • Sets the event end date.

    Parameters

    • date: Date

      The new end date to set

    • Default value keepDuration: boolean = false

      Whether the intention is to keep the duration field (keepDuration = true) or startDate (keepDuration = false)

    Returns Promise<CommitResult>

    A Promise resolved when the schedule has been recalculated. Await it before reading the resulting dates back from the record.

setProject

  • setProject(project: this["project"]): this["project"]
  • The method to set the project instance, this entity belongs to.

    Parameters

    • project: this["project"]

    Returns this["project"]

setStartDate

  • setStartDate(date: Date, keepDuration?: boolean): Promise<CommitResult>
  • Sets the event start date

    Parameters

    • date: Date

      The new start date to set

    • Default value keepDuration: boolean = true

      Whether the intention is to keep the duration field (keepDuration = true) or endDate (keepDuration = false)

    Returns Promise<CommitResult>

    A Promise resolved when the schedule has been recalculated. Await it before reading the resulting dates back from the record.

skipNonWorkingTime

  • The method skips the event non working time starting from the provided date and going either forward or backward in time. It uses the event effective calendar to detect which time is not working.

    Parameters

    • date: Date

      Date to start skipping from

    • isForward: boolean

      Skip direction (true to go forward in time, false - backwards)

    Returns CalculationIterator<Date>

skipWorkingTime

  • The method skips the provided amount of the event working time starting from the date and going either forward or backward in time. It uses the event effective calendar to detect which time is not working.

    Parameters

    • date: Date

      Date to start skipping from

    • isForward: boolean

      Skip direction (true to go forward in time, false - backwards)

    • duration: Duration

      Amount of working time to skip

    • Optional unit: TimeUnit

      Units the duration value in (if not provided then duration is considered provided in durationUnit)

    Returns CalculationIterator<Date>

unassign

  • unassign(resource: InstanceType<this["project"]["resourceModelClass"]>): Promise<any>
  • A method which unassigns a resource from the current event

    Parameters

    • resource: InstanceType<this["project"]["resourceModelClass"]>

    Returns Promise<any>

userProvidedValue

Generated using TypeDoc