Skip to content

Commit

Permalink
fix #262 align custom global action check new action params
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed May 28, 2023
1 parent 0b9731b commit 2443d09
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion R/geoflow_action.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' packages = list(),
#' pid_generator = NULL,
#' generic_uploader = FALSE,
#' fun = function(config, entity){},
#' fun = function(action, entity, config){},
#' available_options = list(
#' option_name = list(def = "option description", default = FALSE)
#' ),
Expand Down
12 changes: 6 additions & 6 deletions R/initWorkflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,21 +568,21 @@ initWorkflow <- function(file, dir = ".", jobDirPath = NULL, handleMetadata = TR
stop(errMsg)
}
funparams <- unlist(names(formals(customfun)))
if(!("entity" %in% funparams)){
if(!("action" %in% funparams)){
config$logger.warn(sprintf("Action '%s' - Custom action arguments: [%s]", action$id, paste(funparams, collapse=",")))
errMsg <- sprintf("Missing parameter 'entity' in function '%s'", action$id)
errMsg <- sprintf("Missing parameter 'action' in function '%s'", action$id)
config$logger.error(errMsg)
stop(errMsg)
}
if(!("config" %in% funparams)){
if(!("entity" %in% funparams)){
config$logger.warn(sprintf("Custom action arguments: [%s]", paste(funparams, collapse=",")))
errMsg <- sprintf("Missing parameter 'config' in function '%s'", action$id)
errMsg <- sprintf("Missing parameter 'entity' in function '%s'", action$id)
config$logger.error(errMsg)
stop(errMsg)
}
if(!("options" %in% funparams)){
if(!("config" %in% funparams)){
config$logger.warn(sprintf("Custom action arguments: [%s]", paste(funparams, collapse=",")))
errMsg <- sprintf("Missing parameter 'options' in function '%s'", action$id)
errMsg <- sprintf("Missing parameter 'config' in function '%s'", action$id)
config$logger.error(errMsg)
stop(errMsg)
}
Expand Down
2 changes: 1 addition & 1 deletion man/geoflow_action.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2443d09

Please sign in to comment.