selectTaskRunList {openMpp}R Documentation

Select list of modeling task runs

Description

Select list of modeling task runs

Usage

selectTaskRunList(dbCon, taskId)

Arguments

dbCon

database connection

taskId

id of modeling task

Details

This call return for specified task id list task run id's, status and time.

Task run status can be one of:

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.

Value

List of database rows:

taskLst

task_lst row: task id and name

taskRunLst

task_run_lst rows: task run id, status and time

Note

To run examples you must have modelOne database modelOne.sqlite in current directory

Author(s)

amc1999

References

OpenM++ documentation: https://github.com/openmpp/openmpp.github.io/wiki

See Also

getModel getTaskIdByName getTaskFirstRunId getTaskLastRunId selectTask selectTaskList selectTaskRun setTaskWaitCompleted

Examples

  #
  # 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)

[Package openMpp version 0.8.6 Index]