DependencyStore

A store representing a collection of dependencies between events in the EventStore.

This store only accepts a model class inheriting from DependencyModel.

A DependencyStore is usually connected to a project, which binds it to other related stores (EventStore, AssignmentStore and ResourceStore). The project also handles references (fromEvent, toEvent) to related records for the records in the store.

Resolving the references happens async, records are not guaranteed to have up to date references until calculations are finished. To be certain that references are resolved, call await project.commitAsync() after store actions. Or use one of the xxAsync functions, such as loadDataAsync().

Using commitAsync():

dependencyStore.data = [{ from, to }, ...];

// references (fromEvent, toEvent) not resolved yet

await dependencyStore.project.commitAsync();

// now they are

Using loadDataAsync():

await dependencyStore.loadDataAsync([{ from, to }, ...]);

// references (fromEvent, toEvent) are resolved

Configs

81

Common

autoCommitStoreCRUD
autoLoadAjaxStore
dataStore
fieldsStore
groupersStoreGroup
idStore
listenersEvents
sortersStoreSort

Other

An array of allowed dependency types. When set, only the specified dependency types can be created. Use values from DependencyModel.Type:

  • 0 - StartToStart (SS)
  • 1 - StartToEnd (SF)
  • 2 - EndToStart (FS)
  • 3 - EndToEnd (FF)
const scheduler = new Scheduler({
    project : {
        dependencyStore : {
            // Only allow Finish-to-Start and Start-to-Start dependencies
            allowedDependencyTypes : [DependencyModel.Type.EndToStart, DependencyModel.Type.EndToEnd]
        }
    }
});

When null (default), all dependency types are allowed.

This config affects:

  • Drag-creating dependencies (invalid types will be rejected)
  • The dependency editor type combo (only allowed types are shown)
  • The Predecessors and Successors tabs in the Task Editor
lazyLoadAjaxStore
useSparseIndexStoreSparseIndex

Advanced

stmStoreStm
storageStore
useLocaleSortStoreSort

Chained store

chainedFieldsStoreChained
chainedFilterFnStoreChained
chainFiltersStoreChained
dontRelayToMasterStoreChained
doRelayToMasterStoreChained
ignoreLinkRecordsStoreChained
masterStoreStoreChained
syncOrderStoreChained
syncSortStoreChained

CRUD

createUrlAjaxStore
deleteUrlAjaxStore
readUrlAjaxStore
updateUrlAjaxStore

Filtering

filtersStoreFilter
remoteFilterStoreFilter

Misc

Paging

pageParamNameStorePaging
pageSizeStorePaging
remotePagingStorePaging

Records

Remote

fetchOptionsAjaxStore
filterParamNameStoreFilter
headersAjaxStore
httpMethodsAjaxStore
paramsAjaxStore
paramsInBodyAjaxStore
restfulFilterAjaxStore

Sorting

remoteSortStoreSort
sortParamNameStoreSort

Tree

treeStore

Properties

77

Common

idStore

Class hierarchy

isDependencyStore: Boolean= truereadonly
Identifies an object as an instance of DependencyStore class, or subclass thereof.
isDependencyStore: Boolean= truereadonlystatic
Identifies an object as an instance of DependencyStore class, or subclass thereof.
Identifies an object as an instance of DependencyStoreMixin class, or subclass thereof.
isDependencyStoreMixin: Boolean= truereadonlystaticDependencyStoreMixin
Identifies an object as an instance of DependencyStoreMixin class, or subclass thereof.
isAjaxStoreAjaxStore
isEventsEvents
isPartOfProjectPartOfProject
isStoreStore
isStoreChainedStoreChained
isStoreChangesStoreChanges
isStoreCRUDStoreCRUD
isStoreFilterStoreFilter
isStoreGroupStoreGroup
isStorePagingStorePaging
isStoreRelationStoreRelation
isStoreSearchStoreSearch
isStoreSortStoreSort
isStoreSparseIndexStoreSparseIndex
isStoreStateStoreState
isStoreStmStoreStm
isStoreSumStoreSum
isStoreSyncStoreSync
isStoreTreeStoreTree

Records

Applies a new dataset to the DependencyStore. Use it to plug externally fetched data into the store.

NOTE: References (fromEvent, toEvent) on the dependencies are determined async by a calculation engine. Thus they cannot be directly accessed after assigning the new dataset.

For example:

dependencyStore.data = [{ from, to }];
// dependencyStore.first.fromEvent is not yet available

To guarantee references are available, wait for calculations for finish:

dependencyStore.data = [{ from, to }];
await dependencyStore.project.commitAsync();
// dependencyStore.first.fromEvent is available

Alternatively use loadDataAsync() instead:

await dependencyStore.loadDataAsync([{ from, to }]);
// dependencyStore.first.fromEvent is available
autoCommitStoreCRUD
changesStoreCRUD
countStore
firstStore
hasChangesStoreCRUD
lastStore
recordsStore

Advanced

isChainedStoreChained
StopBranchstaticStoreTree

CRUD

createUrlAjaxStore
deleteUrlAjaxStore
isCommittingAjaxStore
isLoadingAjaxStore
readUrlAjaxStore
updateUrlAjaxStore

Filtering

Lifecycle

configBase

Misc

Models & Stores

assignmentStorePartOfProject
dependencyStorePartOfProject
eventStorePartOfProject
projectPartOfProject
resourceStorePartOfProject

Other

currentPageStorePaging
jsonStore
lazyLoadAjaxStore
storesstaticStore

Paging

isPagedStorePaging
lastPageStorePaging
pageSizeStorePaging

Remote

paramsAjaxStore

Sort, group & filter

filtersStoreFilter
groupersStoreGroup
isFilteredStoreFilter
isGroupedStoreGroup
isSortedStoreSort
sortersStoreSort

Tree

isTreeStoreTree
leavesStoreTree

Functions

110

CRUD

Add dependencies to the store.

NOTE: References (fromEvent, toEvent) on the dependencies are determined async by a calculation engine. Thus they cannot be directly accessed after using this function.

For example:

const [dependency] = dependencyStore.add({ from, to });
// dependency.fromEvent is not yet available

To guarantee references are set up, wait for calculations for finish:

const [dependency] = dependencyStore.add({ from, to });
await dependencyStore.project.commitAsync();
// dependency.fromEvent is available (assuming EventStore is loaded and so on)

Alternatively use addAsync() instead:

const [dependency] = await dependencyStore.addAsync({ from, to });
// dependency.fromEvent is available (assuming EventStore is loaded and so on)
ParameterTypeDescription
recordsDependencyModel | DependencyModel[] | DependencyModelConfig | DependencyModelConfig[]

Array of records/data or a single record/data to add to store

silentBoolean

Specify true to suppress events

Returns: DependencyModel[] -

Added records

Add dependencies to the store and triggers calculations directly after. Await this function to have up to date references on the added dependencies.

const [dependency] = await dependencyStore.addAsync({ from, to });
// dependency.fromEvent is available (assuming EventStore is loaded and so on)
ParameterTypeDescription
recordsDependencyModel | DependencyModel[] | DependencyModelConfig | DependencyModelConfig[]

Array of records/data or a single record/data to add to store

silentBoolean

Specify true to suppress events

Returns: DependencyModel[] -

Added records

Applies a new dataset to the DependencyStore and triggers calculations directly after. Use it to plug externally fetched data into the store.

await dependencyStore.loadDataAsync([{ from, to }]);
// dependencyStore.first.fromEvent is available
ParameterTypeDescription
dataDependencyModelConfig[]

Array of DependencyModel data objects

applyChangesetStoreChanges
commitAjaxStore
insertStoreCRUD
loadAjaxStore
loadChildrenAjaxStore
loadPageAjaxStore
moveStoreCRUD
nextPageStorePaging
previousPageStorePaging
removeStoreCRUD
removeAllStoreCRUD
revertChangesStoreCRUD

Other

Returns dependency model instance linking tasks with given ids. The dependency can be forward (from 1st task to 2nd) or backward (from 2nd to 1st).

ParameterTypeDescription
sourceEventEventModel | String

1st event

targetEventEventModel | String

2nd event

Returns all dependencies for a certain event (both incoming and outgoing)

ParameterTypeDescription
eventEventModel
Returns: DependencyModel[]

Returns a dependency model instance linking given events if such dependency exists in the store. The dependency can be forward (from 1st event to 2nd) or backward (from 2nd to 1st).

ParameterTypeDescription
sourceEventEventModel | String
targetEventEventModel | String

Returns all dependencies highlighted with the given CSS class

ParameterTypeDescription
clsString

Returns true if the specified dependency type is allowed according to the allowedDependencyTypes configuration.

ParameterTypeDescription
typeNumber

Dependency Type

Returns: Boolean

Validation method used to validate a dependency. Override and return true to indicate that an existing dependency between two tasks is valid. For a new dependency being created please see isValidDependencyToCreate.

ParameterTypeDescription
dependencyOrFromIdDependencyModel | TimeSpan | Number | String

The dependency model, the from task/event or the id of the from task/event

toIdTimeSpan | Number | String

To task/event or id thereof if the first parameter is not a dependency record

typeNumber

Dependency Type if the first parameter is not a dependency model instance.

Returns: Boolean

Validation method used to validate a dependency while creating. Override and return true to indicate that a new dependency is valid to be created.

ParameterTypeDescription
fromIdTimeSpan | Number | String

From event/task or id

toIdTimeSpan | Number | String

To event/task or id

typeNumber

Dependency Type

Returns: Boolean
getStorestaticStore
onEvents
relayAllEvents
toJSONStore
triggerEvents
unEvents

Chained store

chainStoreChained
chainTreeStoreChained
fillFromMasterStoreChained

Configuration

applyDefaultsstaticBase

Events

Iteration

everyStore
flatMapStore
forEachStore
mapStore
reduceStore

Lifecycle

destroystaticBase

Misc

initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase

Records

getAtStore
getByIdStore
indexOfStore

Search

findStoreSearch
findByFieldStoreSearch
findRecordStoreSearch
queryStoreSearch
searchStoreSearch
someStoreSearch

Sort, group & filter

addFilterStoreFilter
addSorterStoreSort
clearFiltersStoreFilter
clearGroupersStoreGroup
clearSortersStoreSort
filterStoreFilter
filterByStoreFilter
getGroupRecordsStoreGroup
getGroupTitlesStoreGroup
groupStoreGroup
isRecordInGroupStoreGroup
removeFilterStoreFilter
removeSorterStoreSort
setGroupersStoreGroup
sortStoreSort

Sum

averageStoreSum
groupSumStoreSum
maxStoreSum
minStoreSum
sumStoreSum

Traverse

getNextStore
getPrevStore

Tree

getChildrenStoreTree
indentStoreTree
outdentStoreTree

Values

Events

45
addStoreCRUD
beforeAddStoreCRUD
beforeCommitStoreCRUD
beforeFilterStoreFilter
beforeIndentStoreTree
beforeLoadAjaxStore
beforeLoadPageStorePaging
beforeOutdentStoreTree
beforeRemoveStoreCRUD
beforeSortStoreSort
catchAllEvents
changeStore
commitStoreCRUD
commitAddedAjaxStore
commitRemovedAjaxStore
destroyEvents
exceptionAjaxStore
filterStoreFilter
groupStoreGroup
indentStoreTree
loadAjaxStore
loadChildrenAjaxStore
loadPageStorePaging
loadPageStartAjaxStore
loadStartAjaxStore
moveStore
outdentStoreTree
refreshStore
removeStoreCRUD
removeAllStoreCRUD
sortStoreSort
updateStore

Event handlers

45
onAddStoreCRUD
onBeforeAddStoreCRUD
onBeforeFilterStoreFilter
onBeforeLoadAjaxStore
onBeforeLoadPageStorePaging
onBeforeSortStoreSort
onCommitStoreCRUD
onCommitAddedAjaxStore
onDestroyEvents
onExceptionAjaxStore
onFilterStoreFilter
onGroupStoreGroup
onIndentStoreTree
onLoadAjaxStore
onLoadPageStorePaging
onLoadStartAjaxStore
onMoveStore
onOutdentStoreTree
onRemoveStoreCRUD
onRemoveAllStoreCRUD
onSortStoreSort

Typedefs

9