added a module version of call_module which automatically handles parent ids in the backend
This commit is contained in:
parent
6558b7a026
commit
5a2e6277e5
@ -1,6 +1,6 @@
|
||||
--- Process functions for orgs
|
||||
|
||||
function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
function modpol.orgs:call_module(module_slug, initiator, config, result, parent_id)
|
||||
if not modpol.modules[module_slug] then
|
||||
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. module_slug .. '" not found')
|
||||
return
|
||||
@ -34,18 +34,23 @@ function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- setting default params
|
||||
local new_process = {
|
||||
metatable = {__index = module},
|
||||
initiator = initiator,
|
||||
org = self,
|
||||
id = index,
|
||||
parent_id = parent_id,
|
||||
config = config,
|
||||
data = module.data,
|
||||
slug = module_slug
|
||||
}
|
||||
|
||||
-- call module wrapper for modules, passes its id to child process when called
|
||||
function new_process:call_module(module_slug, initiator, config, result)
|
||||
self.org:call_module(module_slug, initiator, config, result, self.id)
|
||||
end
|
||||
|
||||
setmetatable(new_process, new_process.metatable)
|
||||
|
||||
self.processes[index] = new_process
|
||||
|
Loading…
x
Reference in New Issue
Block a user