Skip to content

bpmn-server / DataStore

Class: DataStore#

super class for various objects that are part of the server

Hierarchy#

DataStore

Implements#

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new DataStore(server): DataStore

Parameters#

Name Type
server IBPMNServer

Returns#

DataStore

Overrides#

ServerComponent.constructor

Defined in#

datastore/DataStore.ts:35

Properties#

dbConfiguration#

dbConfiguration: any

Implementation of#

IDataStore.dbConfiguration

Defined in#

datastore/DataStore.ts:24


db#

db: any

Implementation of#

IDataStore.db

Defined in#

datastore/DataStore.ts:25


execution#

execution: Execution

Defined in#

datastore/DataStore.ts:27


isModified#

isModified: boolean = false

Defined in#

datastore/DataStore.ts:28


isRunning#

isRunning: boolean = false

Defined in#

datastore/DataStore.ts:29


inSaving#

inSaving: boolean = false

Defined in#

datastore/DataStore.ts:30


promises#

promises: any[] = []

Defined in#

datastore/DataStore.ts:31


locker#

locker: any

Implementation of#

IDataStore.locker

Defined in#

datastore/DataStore.ts:32


enableSavePoints#

enableSavePoints: boolean = false

Defined in#

datastore/DataStore.ts:33


seq#

Static seq: number = 0

Defined in#

datastore/DataStore.ts:99


server#

server: any

Inherited from#

ServerComponent.server

Defined in#

server/ServerComponent.ts:9

Accessors#

configuration#

get configuration(): any

Returns#

any

Inherited from#

ServerComponent.configuration

Defined in#

server/ServerComponent.ts:14


logger#

get logger(): any

Returns#

any

Implementation of#

IDataStore.logger

Inherited from#

ServerComponent.logger

Defined in#

server/ServerComponent.ts:15


cron#

get cron(): Cron

Returns#

Cron

Inherited from#

ServerComponent.cron

Defined in#

server/ServerComponent.ts:16


cache#

get cache(): CacheManager

Returns#

CacheManager

Inherited from#

ServerComponent.cache

Defined in#

server/ServerComponent.ts:17


appDelegate#

get appDelegate(): any

Returns#

any

Inherited from#

ServerComponent.appDelegate

Defined in#

server/ServerComponent.ts:18


engine#

get engine(): IEngine

Returns#

IEngine

Inherited from#

ServerComponent.engine

Defined in#

server/ServerComponent.ts:19


dataStore#

get dataStore(): any

Returns#

any

Inherited from#

ServerComponent.dataStore

Defined in#

server/ServerComponent.ts:20


definitions#

get definitions(): any

Returns#

any

Inherited from#

ServerComponent.definitions

Defined in#

server/ServerComponent.ts:21


listener#

get listener(): any

Returns#

any

Inherited from#

ServerComponent.listener

Defined in#

server/ServerComponent.ts:22

Methods#

save#

save(instance, options?): Promise\<void>

Parameters#

Name Type
instance any
options Object

Returns#

Promise\<void>

Implementation of#

IDataStore.save

Defined in#

datastore/DataStore.ts:48


loadInstance#

loadInstance(instanceId, options?): Promise\<{ instance: IInstanceData = instanceData; items: any[] }>

Parameters#

Name Type
instanceId any
options Object

Returns#

Promise\<{ instance: IInstanceData = instanceData; items: any[] }>

Implementation of#

IDataStore.loadInstance

Defined in#

datastore/DataStore.ts:51


getItemsFromInstances#

getItemsFromInstances(instances, condition?, trans?): any[]

Parameters#

Name Type Default value
instances any undefined
condition any null
trans any null

Returns#

any[]

Defined in#

datastore/DataStore.ts:69


saveInstance#

saveInstance(instance, options?): Promise\<void>

Parameters#

Name Type
instance any
options Object

Returns#

Promise\<void>

Defined in#

datastore/DataStore.ts:100


findItem#

findItem(query): Promise\<IItemData>

Parameters#

Name Type
query any

Returns#

Promise\<IItemData>

Implementation of#

IDataStore.findItem

Defined in#

datastore/DataStore.ts:149


findInstance#

findInstance(query, options): Promise\<IInstanceData>

Parameters#

Name Type
query any
options any

Returns#

Promise\<IInstanceData>

Implementation of#

IDataStore.findInstance

Defined in#

datastore/DataStore.ts:159


convertObj#

convertObj(obj, cls): any

Parameters#

Name Type
obj any
cls any

Returns#

any

Defined in#

datastore/DataStore.ts:180


convertColl#

convertColl(coll, cls): void

Parameters#

Name Type
coll any
cls any

Returns#

void

Defined in#

datastore/DataStore.ts:184


findInstances#

findInstances(query, option?): Promise\<IInstanceData[]>

Parameters#

Name Type Default value
query any undefined
option any 'summary'

Returns#

Promise\<IInstanceData[]>

Implementation of#

IDataStore.findInstances

Defined in#

datastore/DataStore.ts:195


findItems#

findItems(query): Promise\<IItemData[]>

scenario:

itemId          { items { id : value } }
itemKey         { items {key: value } }
instance, task  { instance: { id: instanceId }, items: { elementId: value }}
message         { items: { messageId: nameofmessage, key: value } {}
status          { items: {status: 'wait' } }
custom: { query: query, projection: projection }
New approach: just like MongoDB
itemId          { items { id : value } }
itemKey         { items {key: value } }
instance, task  {  id: instanceId , items.elementId: value }
message         { items.messageId: nameofmessage, key: value } {}
status          { items.status: 'wait' } }
custom: { query: query, projection: projection }

Problem with Mongodb: projection $elematch returns only the first record

Parameters#

Name Type
query any

Returns#

Promise\<IItemData[]>

Implementation of#

IDataStore.findItems

Defined in#

datastore/DataStore.ts:235


deleteInstances#

deleteInstances(query): Promise\<any>

Parameters#

Name Type
query any

Returns#

Promise\<any>

Implementation of#

IDataStore.deleteInstances

Defined in#

datastore/DataStore.ts:248


install#

install(): Promise\<void>

first time installation of DB

creates a new collection and add an index

Returns#

Promise\<void>

Implementation of#

IDataStore.install

Defined in#

datastore/DataStore.ts:262


archive#

archive(query): Promise\<void>

Parameters#

Name Type
query any

Returns#

Promise\<void>

Implementation of#

IDataStore.archive

Defined in#

datastore/DataStore.ts:268