wireup script execution

This commit is contained in:
gowthaman.b
2023-11-11 18:14:57 +05:30
parent f35851d339
commit 1a22043cf2
8 changed files with 55 additions and 15 deletions

View File

@@ -57,7 +57,8 @@ object Entities {
val name = ctx.pathParam("name")
val params = ctx.bodyAsClass<Map<String, Any>>()
ctx.json(
Scripting.execute(name, params)
Scripting.
execute(name, "execute", params, logger)
)
}
@@ -202,6 +203,12 @@ object Entities {
}
}
}
if (!setupEntity.preSaveScript.isNullOrEmpty()) {
val ok = Scripting.preSave(setupEntity.preSaveScript!!, "preSave", this, logger) as Boolean
if (!ok) {
throw BadRequestResponse("PreSave Failed")
}
}
if (setupEntity.approvalLevels > 0) {
@@ -210,7 +217,8 @@ object Entities {
}
}
})
}
)
}
private fun isValidDate(f: String) = try {