Extends
Members
attrs
static
Attributes defined in metadata. This property not exist in real life and added just for help
entity: UBEntity
Reference to entity metadata
Methods
addNew(ctx)
api
Create record with filled default values and return it to caller.
Newly created record is not inserted to database. For inserting record to the database insert
method should be called
Arguments:
-
ctx
(ubMethodParams)
- Mixes In:
-
mStorage.addNew   
delete(ctx)
api
Delete data
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams.execParams.ID
(number)
 element ID to be deleted
- Mixes In:
-
mStorage.delete   
insert(ctx)
api
Insert new row to the entity.
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
-
mStorage.insert   
select(ctx)
api
Read entity data
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams
(UBQL)
 ORM query in UBQL format
- Mixes In:
-
mStorage.select   
update(ctx)
api
Update data
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
-
mStorage.update   
addqueue(ctxt) → Boolean
api
Add item to queue.
Used by server FTS mixin - do not remove
Arguments:
-
ctxt
(ubMethodParams)
Properties
executeSchedulerTask(nullCtxt, req, resp) → Boolean
api
REST endpoint for executing a scheduler task.
Queue worker will sent the tasks in async mode to this endpoint according to a schedulers.
Endpoint wait a POST requests from a local IP with JSON in body:
{
schedulerName: cfg.name, command: cfg.command, module: cfg.module,
singleton: cfg.singleton !== false, logSuccessful: cfg.logSuccessful
}
command
must be a function name (may including namespace), for example UB.UBQ.sendQueueMail
or ubs_message_edit.notifyAllRecipients
in case command
not passed module
must be a module what export default a function, for example module: '@unitybase/myModule/schedTask'
and in schedTask.js module exports = function() {...}
In case singleton
parameter is missing or === false scheduler can run a multiple instances of the same task,
otherwise - if previous task with the same name not finished yet current task will not be executed
- If command executed success, record with resultError===0 will be written to
ubq_runstat
entity.
- If command executed with exception, record with resultError===1 will be written to
ubq_runstat
entity,
Exception text will be written written to ubq_runstat.resultErrorMsg
.
Arguments:
-
nullCtxt
(null)
-
req
(THTTPRequest)
 Name of a scheduler item
-
resp
(THTTPResponse)
 Command to execute
success(ctxt)
api
Mark queue task as successfully executed
Arguments:
-
ctxt
(ubMethodParams)
Properties
-
mParams.ID
(Number)
addNew(ctx) api
insert
method should be called
Arguments:
-
ctx
(ubMethodParams)
- Mixes In:
- mStorage.addNew   
delete(ctx) api
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams.execParams.ID
(number)
 element ID to be deleted
-
- Mixes In:
- mStorage.delete   
insert(ctx) api
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
- mStorage.insert   
select(ctx) api
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams
(UBQL)
 ORM query in UBQL format
-
- Mixes In:
- mStorage.select   
update(ctx) api
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
- mStorage.update   
addqueue(ctxt) → Boolean api
Used by server FTS mixin - do not remove
Arguments:
-
ctxt
(ubMethodParams)
Properties
executeSchedulerTask(nullCtxt, req, resp) → Boolean api
REST endpoint for executing a scheduler task. Queue worker will sent the tasks in async mode to this endpoint according to a schedulers. Endpoint wait a POST requests from a local IP with JSON in body:
{
schedulerName: cfg.name, command: cfg.command, module: cfg.module,
singleton: cfg.singleton !== false, logSuccessful: cfg.logSuccessful
}
command
must be a function name (may including namespace), for example UB.UBQ.sendQueueMail
or ubs_message_edit.notifyAllRecipients
in case command
not passed module
must be a module what export default a function, for example module: '@unitybase/myModule/schedTask'
and in schedTask.js module exports = function() {...}
In case singleton
parameter is missing or === false scheduler can run a multiple instances of the same task,
otherwise - if previous task with the same name not finished yet current task will not be executed
- If command executed success, record with resultError===0 will be written to
ubq_runstat
entity. - If command executed with exception, record with resultError===1 will be written to
ubq_runstat
entity, Exception text will be written written toubq_runstat.resultErrorMsg
.
Arguments:
-
nullCtxt
(null)
-
req
(THTTPRequest)
 Name of a scheduler item -
resp
(THTTPResponse)
 Command to execute
success(ctxt) api
Arguments:
-
ctxt
(ubMethodParams)
Properties
-
mParams.ID
(Number)
-