Hi everyone.
Is it possible to call a Python rule from within a delayExec called by another Python rule?
For example.
I have the following rule that I want to execute the following rule asynchronously from pep_api_data_obj_put_post.
def bulk_checksum(DataPathList, RescHier, Callback):
for dataPath in DataPathList:
_checksum(dataPath, RescHier, Callback)
Here's my incorrect guess at an implementation of pep_api_data_obj_put_post.
def pep_api_bulk_data_obj_put_post(RuleArgs, Callback, Rei):
bulkOpInp = RuleArgs[2]
dataPaths = [
bulkOpInp.attriArray.sqlResult[0].row(r)
for r in range(bulkOpInp.attriArray.rowCnt)]
cond = "<PLUSET>0s</PLUSET><EF>0s REPEAT 0 TIMES</EF>" \
+ "<INST_NAME>irods_rule_engine_plugin-python-instance</INST_NAME>"
rule = "Callback.bulk_checksum({paths},'{hier}')".format(
paths=dataPaths,
hier=bulkOpInp.condInput['resc_hier'])
Callback.delayExec(cond, rule, "")
If I run this, it tells me that the global name 'Callback' is undefined. I can't figure out how to pass Callback to bulk_checksum. Is it even possible to call a python function from a delayExec()?
Cheers,
Tony