Skip to content

Commit

Permalink
check of the application configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Feb 1, 2024
1 parent 3a66cf0 commit 45489b5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions R/application/hook.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@ const hook = function(app) {
app <- __build_app(f = app);
}

const app_name = app$name;

if (nchar(app_name) == 0) {
print("We found that an application module has in-correct configuration:");
str(app);
throw_err("workflow app name could not be empty!");
}

if (!app_check.signature(app)) {
throw_err([
"invalid app object signature",
"you sould construct the app module via the 'app' function!"
]);
} else {
pool[[app$name]] = app;
symbolMap[[get_functionName(app$call)]] = app$name;
pool[[app_name]] = app;
symbolMap[[get_functionName(app$call)]] = app_name;
}

# turn on/activate current analysis app by default
context$pipeline = append(context$pipeline, app$name);
context$pipeline = append(context$pipeline, app_name);
context$symbols = symbolMap;

# update the global context symbol
Expand Down

0 comments on commit 45489b5

Please sign in to comment.