selectTaskRun {openMpp}R Documentation

Select task run

Description

Select modeling task run: status and results

Usage

selectTaskRun(dbCon, taskRunId)

Arguments

dbCon

database connection

taskRunId

id of modeling task run

Details

This call return task run status, time and id's of input working sets and output results.

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:

taskRunLst

task_run_lst row: task run id, status and time

taskRunSet

task_run_set rows: input workset id's and result run id's

Note

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

Author(s)

amc1999

References

OpenM++ documentation: http://ompp.sourceforge.net/wiki/

See Also

getModel getTaskIdByName getTaskFirstRunId getTaskLastRunId selectTask selectTaskList selectTaskRunList 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.1 Index]