The project instance, this entity belongs to.
The constructor for the "Assignment" entity of the project
The instance of the "Assignments" collection of the project
The constructor for the "Assignments" collection of the project
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' }
]
})
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 instance of the "Calendars" collection of the project
The constructor for the "Calendars" collection of the project
The constructor for the "Calendar" entity of the project
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
}
]
}
]
})
The constructor for the cycle effect - the effect indicating a computation cycle.
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.
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.
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' }
]
})
The constructor for the "Dependency" entity of the project
The instance of the "Dependencies" collection of the project
The constructor for the "Dependencies" collection of the project
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()
The constructor for the "Event" entity of the project.
The instance of the "Events" collection of the project
The constructor for the "Events" collection of the project
The events data - can be provided during project instantiation and will be loaded with loadInlineData.
const project = new SchedulerBasicProjectMixin({
eventsData : [ { name : 'Task 1' } ]
})
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 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.
Maximum range the project calendars can iterate.
The value is defined in milliseconds and by default equals 5 years
roughly.
The project instance, this entity belongs to.
The Replica instance containing all data for this project.
Set to true
to reset the undo/redo queues of the internal StateTrackingManager
after the Project has loaded. Defaults to false
The constructor for the "Resource" entity of the project
The instance of the "Resources" collection of the project
The constructor for the "Resources" collection of the project
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' }
]
})
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.
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 false
When true
the project manually scheduled tasks adjust their proposed start/end dates
to skip non working time.
Default value is false
The start date of the event. Can also be provided as a string, parsable with DateHelper.parse()
State tracking manager instance the project relies on
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
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.
Enables/disables the calculation progress notifications.
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.
Combines an array of calendars into a single CalendarCacheMultiple, which provides an API similar (but not exactly the same) to BaseCalendarMixin
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.
Returns records referencing the provided calendar.
Calendar to find references to.
Array of records referencing the provided calendar.
Convenience method to get the instance of the calendar manager store in the project instance, this entity belongs to.
Returns the default assignment model class to use
Returns the default assignment store class to use
Returns the default calendar manager store class to use
Returns the default calendar model class to use
Returns the default dependency model class to use
Returns the default dependency store class to use
Returns the default event model class to use
Returns the default event store class to use
Returns the default resource model class to use
Returns the default resource store class to use
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)
This method loads the "raw" data into the project. The loading is basically happening by
assigning the individual data entries to the data
property of the corresponding store.
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 will 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) { }
})
This method sets the assignment store instance for the project.
Overrides the project owned store identifiers calculation.
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"
}
})
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)
This method sets the calendar manager store instance for the project.
This method sets the dependency store instance for the project.
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
)
This method sets the event store instance for the project.
The method to set the project instance, this entity belongs to.
This method sets the resource store instance for the project.
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
Tries to calculate project with changes. If project does not calculate, changes are reverted.
Same as tryPropagateWithChanges but using the queue.
Calculation function that simply returns current (proposed or previous) value of an identifier.
Generated using TypeDoc
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.