31 lines
809 B
Python
31 lines
809 B
Python
import logging
|
|
|
|
from core.apirequest import executeRequest
|
|
from core.runtime.runtimecontract import buildRuntimeAttr, buildPreRuntimeAttr
|
|
#from core.runtime.stopsignals import addStopSignal
|
|
|
|
|
|
def buildAction (action, outputs, process):
|
|
action_log = True
|
|
|
|
outputs, resolved, match, filter = buildPreRuntimeAttr(action, outputs, process)
|
|
|
|
if hasattr(action, "allowaction"):
|
|
if not action.allowaction:
|
|
return outputs, None
|
|
|
|
if match:
|
|
return outputs, None
|
|
|
|
response, outputs = executeRequest(action, outputs, resolved)
|
|
|
|
if response is None:
|
|
return outputs, None
|
|
|
|
outputs, response = buildRuntimeAttr(action, outputs, resolved, response, process)
|
|
|
|
if action_log:
|
|
logging.info(f"{action.name} completed")
|
|
|
|
return outputs, response
|