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).
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 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()
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)
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()
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.
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.
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 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 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 notion of "sub events" for the BaseEventMixin, which is a bit more general concept of the "child" events. This special notion is required, because the event store can be a flat store, not providing any tree structuring. In the same time, we treat the project instance as a "parent" event for all events in the flat event store - so it accumulates the same aggregation information as other "regular" parent events.
The event with this mixin is scheduled according to the "sub events" information - it starts at the earliest date among all sub events and ends at the latest. If there's no "sub events" - it delegates to previous behaviour.
Scheduling by children can be disabled by setting manuallyScheduled flag to
true
which will result startDate and endDate fields will keep their provided values.