def store_process_system_document(_process_id, _name, _parent_id=None):
"""
Creates a process instance structure, automatically sets systemPid, spawnedBy, host and spawnedWhen
"""
_struct = {
"_id": _process_id,
"systemPid": os.getpid(),
"spawnedBy": get_current_login(),
"name": _name,
"host": socket.getfqdn(),
"spawnedWhen": str(datetime.datetime.utcnow()),
"schemaRef": "ref://of.process.system"
}
if _parent_id:
_struct["parent_id"] = _parent_id,
return _struct
评论列表
文章目录