selectTaskRunList {openMpp} | R Documentation |
Select list of modeling task runs
selectTaskRunList(dbCon, taskId)
dbCon |
database connection |
taskId |
id of modeling task |
This call return for specified task id list task run id's, status and time.
Task run status can be one of:
i
= not yet started
p
= run in progress
w
= run in progress, wait for additional input
s
= completed successfully
e
= failed (error)
x
= reserved
Status w
means task can be dynamically updated by external script.
Model executable is waiting for additional input into or for "ready to be completed" signal.
Use setTaskWaitCompleted
function to mark task as "ready to be completed".
Use updateTask
function to insert additional task input.
List of database rows:
taskLst |
task_lst row: task id and name |
taskRunLst |
task_run_lst rows: task run id, status and time |
To run examples you must have modelOne database modelOne.sqlite in current directory
amc1999
OpenM++ documentation: https://github.com/openmpp/openmpp.github.io/wiki
getModel
getTaskIdByName
getTaskFirstRunId
getTaskLastRunId
selectTask
selectTaskList
selectTaskRun
setTaskWaitCompleted
# # connect to database # theDb <- dbConnect(RSQLite::SQLite(), "modelOne.sqlite", synchronous = "full") invisible(dbGetQuery(theDb, "PRAGMA busy_timeout = 86400")) # recommended # get definition for "modelOne" model # # use model name only to identify the model # if there are multiple versions of the model in database # then first one is selected: where model id = min(model_id) for "modelOne" # defRs <- getModel(theDb, "modelOne") taskId <- getTaskIdByName(theDb, defRs, "taskOne") if (taskId <= 0L) stop("task: ", "taskOne", " not found for model: ", defRs$modelDic$model_name, " ", defRs$modelDic$model_digest) # last (most recent) run of that task lastId <- getTaskLastRunId(theDb, taskId) if (lastId <= 0L) stop("task run(s) not found, task: ", taskId) # select task run status, input and output taskRunRs <- selectTaskRun(theDb, lastId) # select list of all task runs taskRunLstRs <- selectTaskRunList(theDb, taskId) dbDisconnect(theDb)