The project instance, this entity belongs to.
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).
A set of references to child events
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.
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.
The duration of the event. See also durationUnit.
The duration unit of the event's duration. See also duration.
The earliest possible date the event can finish. This value is calculated based on the event restrictions.
The earliest possible date the event can start. This value is calculated based on the event restrictions.
The effective calendar used by this entity (either its own calendar if provided or the project calendar) for data calculation purposes.
The effective calendar used by this entity (either its own calendar if provided or the project calendar) for data visualizing purposes.
The end date of the event. Can also be provided as a string, parsable with DateHelper.parse()
Field to accumulate the "generic" constraints for end date (which are not related to ASAP scheduling). It is calculated with calculateEndDateConstraintIntervals.
Gets the calendar.
Getter for direction field.
Gets the event end date.
Gets the event start date
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)
A reference to the parent event
The percent done for this event.
The project instance, this entity belongs to.
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.
Setter for direction field.
The start date of the event. Can also be provided as a string, parsable with DateHelper.parse()
Field to accumulate the "generic" constraints for start date (which are not related to ASAP scheduling). It is calculated with calculateStartDateConstraintIntervals.
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)
A graph identifier, that represents the whole entity.
An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.
A ConstrainedScheduleMixin for this event, which is used for scheduling by constraints and dependencies.
A ConstrainedScheduleMixin, which in the absence of late scheduling is just an alias for earlyPreSchedule
An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.
The main calculation method for the duration field. Delegates to either calculateDurationProposed or calculateDurationPure, depending on the information from dispatcher
The "proposed" calculation function of the duration field. It should calculate the duration as if there's a user input for it or a previous value. It can also use the values of other fields to "validate" the "proposed" value.
See also calculateDurationPure
The "pure" calculation function of the duration field. It should calculate the duration as if there's no user input for it and no previous value - "purely" based on the values of other fields.
If start date of event is less or equal then end date (normal case) it delegates to calculateProjectedDuration. Otherwise, duration is set to 0.
See also calculateDurationProposed.
Calculation method of the effectiveCalendar. Takes the calendar from the project, if not provided to the entity explicitly.
Calculation method of the effectiveCalendar. Takes the calendar from the project, if not provided to the entity explicitly.
The main calculation method for the endDate field. Delegates to either calculateEndDateProposed or calculateEndDatePure, depending on the information from dispatcher
The "proposed" calculation function of the endDate field. It should calculate the endDate as if there's a user input for it or a previous value. It can also use the values of other fields to "validate" the "proposed" value.
See also calculateEndDatePure
The "pure" calculation function of the endDate field. It should calculate the endDate as if there's no user input for it and no previous value - "purely" based on the values of other fields.
At this level it delegates to calculateProjectedXDateWithDuration
See also calculateEndDateProposed.
Method calculates the task percentDone field value. For a summary task it calculates the value based on the task children if the project autoCalculatePercentDoneForParentTasks is true (default). And for a regular (leaf) task it just returns the field provided value as-is.
This method calculates the duration of the given time span, in the provided durationUnit
or in the durationUnit.
This method calculates the opposite date of the event.
The base date of the event (start or end date)
Boolean flag, indicating whether the given baseDate
is start date (true
) or end date (false
)
Duration of the event, in its durationUnits
The main calculation method for the startDate field. Delegates to either calculateStartDateProposed or calculateStartDatePure, depending on the information from dispatcher
The "proposed" calculation function of the startDate field. It should calculate the startDate as if there's a user input for it or a previous value. It can also use the values of other fields to "validate" the "proposed" value.
See also calculateStartDatePure
The "pure" calculation function of the startDate field. It should calculate the startDate as if there's no user input for it and no previous value - "purely" based on the values of other fields.
At this level it delegates to calculateProjectedXDateWithDuration
See also calculateStartDateProposed.
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.
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.
This method is called when entity is added to some replica.
Convenience method to get the instance of assignment by its id.
Convenience method to get the instance of the assignment store in the project instance, this entity belongs to.
Convenience method to get the instance of calendar by its id.
Convenience method to get the instance of the calendar manager store in the project instance, this entity belongs to.
Convenience method to get the instance of dependency by its id.
Convenience method to get the instance of the dependency store in the project instance, this entity belongs to.
Duration getter. Returns the duration of the event, in the given unit. If unit is not given, returns duration in durationUnit.
Convenience method to get the instance of event by its id.
Convenience method to get the instance of the event store in the project instance, this entity belongs to.
The method to get the ChronoGraph
instance, this entity belongs to.
Returns a project instance
Convenience method to get the instance of resource by its id.
Convenience method to get the instance of the resource store in the project instance, this entity belongs to.
The abstract method which should indicate whether this event has sub events
Template method, which is called when model is joining the project (through joining some store that has already joined the project)
This method is called when entity is removed from the replica it's been added to.
Template method, which is called when model is leaving the project (through leaving some store usually)
Duration setter.
The new duration to set.
The unit for new duration. Optional, if missing the durationUnit value will be used.
A boolean flag, indicating, whether the intention is to keep the start date (true
) or end date (false
)
Sets the event end date.
The new end date to set
Whether the intention is to keep the duration
field (keepDuration = true
) or startDate
(keepDuration = false
)
The method to set the project instance, this entity belongs to.
Sets the event start date
The new start date to set
Whether the intention is to keep the duration
field (keepDuration = true
) or endDate
(keepDuration = false
)
The method defines whether the provided child event should be taken into account when calculating this summary event earlyEndDate. Child events roll up their earlyEndDate values to their summary tasks. So a summary task earlyEndDate gets equal to its maximal child earlyEndDate.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default, the method returns true
to include all child events data.
Child event to consider.
true
if the provided event should be taken into account, false
if not.
The method defines whether the provided child event should be taken into account when calculating this summary event earlyStartDate. Child events roll up their earlyStartDate values to their summary tasks. So a summary task earlyStartDate date gets equal to its minimal child earlyStartDate.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default, the method returns true
to include all child events data.
Child event to consider.
true
if the provided event should be taken into account, false
if not.
The method defines whether the provided child event should be taken into account when calculating this summary event endDate. Child events roll up their endDate values to their summary tasks. So a summary task end gets equal to its maximal child end.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default the method returns true
to include all child events data.
true
if the provided event should be taken into account, false
if not.
The method defines wether the provided child event should be taken into account when calculating this summary event lateEndDate. Child events roll up their lateEndDate values to their summary tasks. So a summary task lateEndDate gets equal to its maximal child lateEndDate.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default the method returns true
to include all child events data.
Child event to consider.
true
if the provided event should be taken into account, false
if not.
The method defines wether the provided child event should be taken into account when calculating this summary event lateStartDate. Child events roll up their lateStartDate values to their summary tasks. So a summary task lateStartDate date gets equal to its minimal child lateStartDate.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default the method returns true
to include all child events data.
Child event to consider.
true
if the provided event should be taken into account, false
if not.
The method defines whether the provided child event should be taken into account when calculating this summary event percentDone.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default the method returns true
to include all child events data.
Child event to consider.
true
if the provided event should be taken into account, false
if not.
The method defines whether the provided child event should be taken into account when calculating this summary event startDate. Child events roll up their startDate values to their summary tasks. So a summary task start date gets equal to its minimal child start.
If the method returns true
the child event is taken into account
and if the method returns false
it's not.
By default the method returns true
to include all child events data.
true
if the provided event should be taken into account, false
if not.
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.
Date to start skipping from
Skip direction (true
to go forward in time, false
- backwards)
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.
Date to start skipping from
Skip direction (true
to go forward in time, false
- backwards)
Amount of working time to skip
Units the duration
value in (if not provided then duration is considered provided in durationUnit)
The abstract method which should return an Iterable of BaseEventMixin
Calculation function that simply returns current (proposed or previous) value of an identifier.
Generated using TypeDoc
This mixin provides the constraint-based scheduling. Event is scheduled according to the set of constraints which can be applied to start date or end date.
Scheduling by constraints for an event can be disabled by setting its manuallyScheduled flag to
true
, which will delegate to previous behavior.The constraint is represented with the DateInterval class, which indicates the "allowed" interval for the point being constrained.
Scheduling by constraints algorithm
Constraints for start date are accumulated in the startDateConstraintIntervals field of event itself and in the ConstrainedScheduleMixin.startDateConstraintIntervals field of its earlySchedule. Constraints for end date are accumulated in the endDateConstraintIntervals field of event itself and in the ConstrainedScheduleMixin.endDateConstraintIntervals field of its earlySchedule.
This mixin does not define where the constraints for the event comes from. The constraints are calculated in the event's schedule field calculation methods, (like ConstrainedScheduleMixin.calculateStartDateConstraintIntervals) which just return empty arrays. Some other mixins may override those methods and can generate actual constraints (the ConstrainedByDependenciesEventMixin is an example).
The "early" fields contains the constraints which are related to scheduling event in the as-soon-as-possible manner. The fields w/o "early" prefix contains the constraints which do not relate to the ASAP scheduling.
"Early" and "normal" constraints for every date are combined, then intersected, which gives "combined" constraining interval.
So at this point we have a "combined" constraining interval for start date and for end date.
Then, the interval for start date is shifted on the event duration to the right and this gives an additional constraint for the end date. The similar operation is done with the interval for the end date.
After intersection with those additional intervals we receive the final constraining interval for both dates. Since we are using the ASAP scheduling, we just pick the earliest possible date.
If any of intervals is empty then we consider it as scheduling conflict, and reject the transaction.